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