You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

54 lines
1.9 KiB

1 month ago
  1. # dunder-proto <sup>[![Version Badge][npm-version-svg]][package-url]</sup>
  2. [![github actions][actions-image]][actions-url]
  3. [![coverage][codecov-image]][codecov-url]
  4. [![License][license-image]][license-url]
  5. [![Downloads][downloads-image]][downloads-url]
  6. [![npm badge][npm-badge-png]][package-url]
  7. If available, the `Object.prototype.__proto__` accessor and mutator, call-bound.
  8. ## Getting started
  9. ```sh
  10. npm install --save dunder-proto
  11. ```
  12. ## Usage/Examples
  13. ```js
  14. const assert = require('assert');
  15. const getDunder = require('dunder-proto/get');
  16. const setDunder = require('dunder-proto/set');
  17. const obj = {};
  18. assert.equal('toString' in obj, true);
  19. assert.equal(getDunder(obj), Object.prototype);
  20. setDunder(obj, null);
  21. assert.equal('toString' in obj, false);
  22. assert.equal(getDunder(obj), null);
  23. ```
  24. ## Tests
  25. Clone the repo, `npm install`, and run `npm test`
  26. [package-url]: https://npmjs.org/package/dunder-proto
  27. [npm-version-svg]: https://versionbadg.es/es-shims/dunder-proto.svg
  28. [deps-svg]: https://david-dm.org/es-shims/dunder-proto.svg
  29. [deps-url]: https://david-dm.org/es-shims/dunder-proto
  30. [dev-deps-svg]: https://david-dm.org/es-shims/dunder-proto/dev-status.svg
  31. [dev-deps-url]: https://david-dm.org/es-shims/dunder-proto#info=devDependencies
  32. [npm-badge-png]: https://nodei.co/npm/dunder-proto.png?downloads=true&stars=true
  33. [license-image]: https://img.shields.io/npm/l/dunder-proto.svg
  34. [license-url]: LICENSE
  35. [downloads-image]: https://img.shields.io/npm/dm/dunder-proto.svg
  36. [downloads-url]: https://npm-stat.com/charts.html?package=dunder-proto
  37. [codecov-image]: https://codecov.io/gh/es-shims/dunder-proto/branch/main/graphs/badge.svg
  38. [codecov-url]: https://app.codecov.io/gh/es-shims/dunder-proto/
  39. [actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/es-shims/dunder-proto
  40. [actions-url]: https://github.com/es-shims/dunder-proto/actions