[d565449] | 1 | # es-define-property <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.defineProperty`, but not IE 8's broken one.
|
---|
| 11 |
|
---|
| 12 | ## Example
|
---|
| 13 |
|
---|
| 14 | ```js
|
---|
| 15 | const assert = require('assert');
|
---|
| 16 |
|
---|
| 17 | const $defineProperty = require('es-define-property');
|
---|
| 18 |
|
---|
| 19 | if ($defineProperty) {
|
---|
| 20 | assert.equal($defineProperty, Object.defineProperty);
|
---|
| 21 | } else if (Object.defineProperty) {
|
---|
| 22 | assert.equal($defineProperty, false, 'this is IE 8');
|
---|
| 23 | } else {
|
---|
| 24 | assert.equal($defineProperty, false, 'this is an ES3 engine');
|
---|
| 25 | }
|
---|
| 26 | ```
|
---|
| 27 |
|
---|
| 28 | ## Tests
|
---|
| 29 | Simply clone the repo, `npm install`, and run `npm test`
|
---|
| 30 |
|
---|
| 31 | ## Security
|
---|
| 32 |
|
---|
| 33 | Please email [@ljharb](https://github.com/ljharb) or see https://tidelift.com/security if you have a potential security vulnerability to report.
|
---|
| 34 |
|
---|
| 35 | [package-url]: https://npmjs.org/package/es-define-property
|
---|
| 36 | [npm-version-svg]: https://versionbadg.es/ljharb/es-define-property.svg
|
---|
| 37 | [deps-svg]: https://david-dm.org/ljharb/es-define-property.svg
|
---|
| 38 | [deps-url]: https://david-dm.org/ljharb/es-define-property
|
---|
| 39 | [dev-deps-svg]: https://david-dm.org/ljharb/es-define-property/dev-status.svg
|
---|
| 40 | [dev-deps-url]: https://david-dm.org/ljharb/es-define-property#info=devDependencies
|
---|
| 41 | [npm-badge-png]: https://nodei.co/npm/es-define-property.png?downloads=true&stars=true
|
---|
| 42 | [license-image]: https://img.shields.io/npm/l/es-define-property.svg
|
---|
| 43 | [license-url]: LICENSE
|
---|
| 44 | [downloads-image]: https://img.shields.io/npm/dm/es-define-property.svg
|
---|
| 45 | [downloads-url]: https://npm-stat.com/charts.html?package=es-define-property
|
---|
| 46 | [codecov-image]: https://codecov.io/gh/ljharb/es-define-property/branch/main/graphs/badge.svg
|
---|
| 47 | [codecov-url]: https://app.codecov.io/gh/ljharb/es-define-property/
|
---|
| 48 | [actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/es-define-property
|
---|
| 49 | [actions-url]: https://github.com/ljharb/es-define-property/actions
|
---|