用工小程序前端代码
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.

53 lines
1.9 KiB

2 months ago
  1. # call-bound <sup>[![Version Badge][npm-version-svg]][package-url]</sup>
  2. [![github actions][actions-image]][actions-url]
  3. [![coverage][codecov-image]][codecov-url]
  4. [![dependency status][deps-svg]][deps-url]
  5. [![dev dependency status][dev-deps-svg]][dev-deps-url]
  6. [![License][license-image]][license-url]
  7. [![Downloads][downloads-image]][downloads-url]
  8. [![npm badge][npm-badge-png]][package-url]
  9. Robust call-bound JavaScript intrinsics, using `call-bind` and `get-intrinsic`.
  10. ## Getting started
  11. ```sh
  12. npm install --save call-bound
  13. ```
  14. ## Usage/Examples
  15. ```js
  16. const assert = require('assert');
  17. const callBound = require('call-bound');
  18. const slice = callBound('Array.prototype.slice');
  19. delete Function.prototype.call;
  20. delete Function.prototype.bind;
  21. delete Array.prototype.slice;
  22. assert.deepEqual(slice([1, 2, 3, 4], 1, -1), [2, 3]);
  23. ```
  24. ## Tests
  25. Clone the repo, `npm install`, and run `npm test`
  26. [package-url]: https://npmjs.org/package/call-bound
  27. [npm-version-svg]: https://versionbadg.es/ljharb/call-bound.svg
  28. [deps-svg]: https://david-dm.org/ljharb/call-bound.svg
  29. [deps-url]: https://david-dm.org/ljharb/call-bound
  30. [dev-deps-svg]: https://david-dm.org/ljharb/call-bound/dev-status.svg
  31. [dev-deps-url]: https://david-dm.org/ljharb/call-bound#info=devDependencies
  32. [npm-badge-png]: https://nodei.co/npm/call-bound.png?downloads=true&stars=true
  33. [license-image]: https://img.shields.io/npm/l/call-bound.svg
  34. [license-url]: LICENSE
  35. [downloads-image]: https://img.shields.io/npm/dm/call-bound.svg
  36. [downloads-url]: https://npm-stat.com/charts.html?package=call-bound
  37. [codecov-image]: https://codecov.io/gh/ljharb/call-bound/branch/main/graphs/badge.svg
  38. [codecov-url]: https://app.codecov.io/gh/ljharb/call-bound/
  39. [actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/call-bound
  40. [actions-url]: https://github.com/ljharb/call-bound/actions