1 | # gopd <sup>[![Version Badge][npm-version-svg]][package-url]</sup>
|
---|
2 |
|
---|
3 | [![github actions][actions-image]][actions-url]
|
---|
4 | [![coverage][codecov-image]][codecov-url]
|
---|
5 | [![License][license-image]][license-url]
|
---|
6 | [![Downloads][downloads-image]][downloads-url]
|
---|
7 |
|
---|
8 | [![npm badge][npm-badge-png]][package-url]
|
---|
9 |
|
---|
10 | `Object.getOwnPropertyDescriptor`, but accounts for IE's broken implementation.
|
---|
11 |
|
---|
12 | ## Usage
|
---|
13 |
|
---|
14 | ```javascript
|
---|
15 | var gOPD = require('gopd');
|
---|
16 | var assert = require('assert');
|
---|
17 |
|
---|
18 | if (gOPD) {
|
---|
19 | assert.equal(typeof gOPD, 'function', 'descriptors supported');
|
---|
20 | // use gOPD like Object.getOwnPropertyDescriptor here
|
---|
21 | } else {
|
---|
22 | assert.ok(!gOPD, 'descriptors not supported');
|
---|
23 | }
|
---|
24 | ```
|
---|
25 |
|
---|
26 | [package-url]: https://npmjs.org/package/gopd
|
---|
27 | [npm-version-svg]: https://versionbadg.es/ljharb/gopd.svg
|
---|
28 | [deps-svg]: https://david-dm.org/ljharb/gopd.svg
|
---|
29 | [deps-url]: https://david-dm.org/ljharb/gopd
|
---|
30 | [dev-deps-svg]: https://david-dm.org/ljharb/gopd/dev-status.svg
|
---|
31 | [dev-deps-url]: https://david-dm.org/ljharb/gopd#info=devDependencies
|
---|
32 | [npm-badge-png]: https://nodei.co/npm/gopd.png?downloads=true&stars=true
|
---|
33 | [license-image]: https://img.shields.io/npm/l/gopd.svg
|
---|
34 | [license-url]: LICENSE
|
---|
35 | [downloads-image]: https://img.shields.io/npm/dm/gopd.svg
|
---|
36 | [downloads-url]: https://npm-stat.com/charts.html?package=gopd
|
---|
37 | [codecov-image]: https://codecov.io/gh/ljharb/gopd/branch/main/graphs/badge.svg
|
---|
38 | [codecov-url]: https://app.codecov.io/gh/ljharb/gopd/
|
---|
39 | [actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/gopd
|
---|
40 | [actions-url]: https://github.com/ljharb/gopd/actions
|
---|