zheng 8213b23298 webpack 21 hours ago
..
.github 8213b23298 webpack 21 hours ago
test 8213b23298 webpack 21 hours ago
.eslintrc 8213b23298 webpack 21 hours ago
CHANGELOG.md 8213b23298 webpack 21 hours ago
LICENSE 8213b23298 webpack 21 hours ago
README.md 8213b23298 webpack 21 hours ago
gOPD.d.ts 8213b23298 webpack 21 hours ago
gOPD.js 8213b23298 webpack 21 hours ago
index.d.ts 8213b23298 webpack 21 hours ago
index.js 8213b23298 webpack 21 hours ago
package.json 8213b23298 webpack 21 hours ago
tsconfig.json 8213b23298 webpack 21 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');
}