gopd
TypeScript icon, indicating that this package has built-in type declarations

1.2.0 • Public • Published

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

Package Sidebar

Install

npm i gopd

Weekly Downloads

61,683,334

Version

1.2.0

License

MIT

Unpacked Size

9.87 kB

Total Files

12

Last publish

Collaborators

  • ljharb