CoolFace
Apppublic

AK-21/Graphite-Industrial-Intelligence

sourceHugging Faceupdated 3mo agoView on Hugging Face
0likes
1# call-bind-apply-helpers <sup>[![Version Badge][npm-version-svg]][package-url]</sup>2 3[![github actions][actions-image]][actions-url]4[![coverage][codecov-image]][codecov-url]5[![dependency status][deps-svg]][deps-url]6[![dev dependency status][dev-deps-svg]][dev-deps-url]7[![License][license-image]][license-url]8[![Downloads][downloads-image]][downloads-url]9 10[![npm badge][npm-badge-png]][package-url]11 12Helper functions around Function call/apply/bind, for use in `call-bind`.13 14The only packages that should likely ever use this package directly are `call-bind` and `get-intrinsic`.15Please use `call-bind` unless you have a very good reason not to.16 17## Getting started18 19```sh20npm install --save call-bind-apply-helpers21```22 23## Usage/Examples24 25```js26const assert = require('assert');27const callBindBasic = require('call-bind-apply-helpers');28 29function f(a, b) {30	assert.equal(this, 1);31	assert.equal(a, 2);32	assert.equal(b, 3);33	assert.equal(arguments.length, 2);34}35 36const fBound = callBindBasic([f, 1]);37 38delete Function.prototype.call;39delete Function.prototype.bind;40 41fBound(2, 3);42```43 44## Tests45 46Clone the repo, `npm install`, and run `npm test`47 48[package-url]: https://npmjs.org/package/call-bind-apply-helpers49[npm-version-svg]: https://versionbadg.es/ljharb/call-bind-apply-helpers.svg50[deps-svg]: https://david-dm.org/ljharb/call-bind-apply-helpers.svg51[deps-url]: https://david-dm.org/ljharb/call-bind-apply-helpers52[dev-deps-svg]: https://david-dm.org/ljharb/call-bind-apply-helpers/dev-status.svg53[dev-deps-url]: https://david-dm.org/ljharb/call-bind-apply-helpers#info=devDependencies54[npm-badge-png]: https://nodei.co/npm/call-bind-apply-helpers.png?downloads=true&stars=true55[license-image]: https://img.shields.io/npm/l/call-bind-apply-helpers.svg56[license-url]: LICENSE57[downloads-image]: https://img.shields.io/npm/dm/call-bind-apply-helpers.svg58[downloads-url]: https://npm-stat.com/charts.html?package=call-bind-apply-helpers59[codecov-image]: https://codecov.io/gh/ljharb/call-bind-apply-helpers/branch/main/graphs/badge.svg60[codecov-url]: https://app.codecov.io/gh/ljharb/call-bind-apply-helpers/61[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/call-bind-apply-helpers62[actions-url]: https://github.com/ljharb/call-bind-apply-helpers/actions63