冯博深 f143f24da4 first hace 18 horas
..
.github f143f24da4 first hace 18 horas
test f143f24da4 first hace 18 horas
.eslintrc f143f24da4 first hace 18 horas
CHANGELOG.md f143f24da4 first hace 18 horas
LICENSE f143f24da4 first hace 18 horas
README.md f143f24da4 first hace 18 horas
gOPD.d.ts f143f24da4 first hace 18 horas
gOPD.js f143f24da4 first hace 18 horas
index.d.ts f143f24da4 first hace 18 horas
index.js f143f24da4 first hace 18 horas
package.json f143f24da4 first hace 18 horas
tsconfig.json f143f24da4 first hace 18 horas

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');
}