冯博深 f143f24da4 first 12 hours ago
..
.github f143f24da4 first 12 hours ago
test f143f24da4 first 12 hours ago
.eslintrc f143f24da4 first 12 hours ago
CHANGELOG.md f143f24da4 first 12 hours ago
LICENSE f143f24da4 first 12 hours ago
README.md f143f24da4 first 12 hours ago
gOPD.d.ts f143f24da4 first 12 hours ago
gOPD.js f143f24da4 first 12 hours ago
index.d.ts f143f24da4 first 12 hours ago
index.js f143f24da4 first 12 hours ago
package.json f143f24da4 first 12 hours ago
tsconfig.json f143f24da4 first 12 hours 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');
}