潘超林 b17e38f0e7 新建 3 月之前
..
.github b17e38f0e7 新建 3 月之前
test b17e38f0e7 新建 3 月之前
.eslintrc b17e38f0e7 新建 3 月之前
CHANGELOG.md b17e38f0e7 新建 3 月之前
LICENSE b17e38f0e7 新建 3 月之前
README.md b17e38f0e7 新建 3 月之前
gOPD.d.ts b17e38f0e7 新建 3 月之前
gOPD.js b17e38f0e7 新建 3 月之前
index.d.ts b17e38f0e7 新建 3 月之前
index.js b17e38f0e7 新建 3 月之前
package.json b17e38f0e7 新建 3 月之前
tsconfig.json b17e38f0e7 新建 3 月之前

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