冯博深 e3294c98a1 first 2 months ago
..
.github e3294c98a1 first 2 months ago
test e3294c98a1 first 2 months ago
.eslintrc e3294c98a1 first 2 months ago
CHANGELOG.md e3294c98a1 first 2 months ago
LICENSE e3294c98a1 first 2 months ago
README.md e3294c98a1 first 2 months ago
gOPD.d.ts e3294c98a1 first 2 months ago
gOPD.js e3294c98a1 first 2 months ago
index.d.ts e3294c98a1 first 2 months ago
index.js e3294c98a1 first 2 months ago
package.json e3294c98a1 first 2 months ago
tsconfig.json e3294c98a1 first 2 months ago

README.md

gopd Version Badge

github actions coverage License Downloads

npm badge

Object.getOwnPropertyDescriptor, but accounts for IE's broken implementation.

Usage

var gOPD = require('gopd');
var assert = require('assert');

if (gOPD) {
	assert.equal(typeof gOPD, 'function', 'descriptors supported');
	// use gOPD like Object.getOwnPropertyDescriptor here
} else {
	assert.ok(!gOPD, 'descriptors not supported');
}