![]() | Name | Last modified | Size | Description |
---|---|---|---|---|
![]() | Parent Directory | - | ||
![]() | node_modules/ | 5 days ago | - | |
![]() | test/ | 5 days ago | - | |
![]() | actualApply.d.ts | 39 years ago | 23 | |
![]() | functionCall.d.ts | 39 years ago | 33 | |
![]() | functionApply.d.ts | 39 years ago | 34 | |
![]() | reflectApply.d.ts | 39 years ago | 82 | |
![]() | functionCall.js | 39 years ago | 97 | |
![]() | functionApply.js | 39 years ago | 99 | |
![]() | tsconfig.json | 39 years ago | 115 | |
![]() | reflectApply.js | 39 years ago | 132 | |
![]() | applyBind.js | 39 years ago | 264 | |
![]() | actualApply.js | 39 years ago | 280 | |
![]() | index.js | 39 years ago | 511 | |
![]() | applyBind.d.ts | 39 years ago | 614 | |
![]() | LICENSE | 39 years ago | 1.0K | |
![]() | CHANGELOG.md | 39 years ago | 1.9K | |
![]() | index.d.ts | 39 years ago | 2.2K | |
![]() | README.md | 39 years ago | 2.3K | |
![]() | package.json | 39 years ago | 2.4K |
Helper functions around Function call/apply/bind, for use in call-bind
.
The only packages that should likely ever use this package directly are call-bind
and get-intrinsic
.
Please use call-bind
unless you have a very good reason not to.
npm install --save call-bind-apply-helpers
const assert = require('assert');
const callBindBasic = require('call-bind-apply-helpers');
function f(a, b) {
assert.equal(this, 1);
assert.equal(a, 2);
assert.equal(b, 3);
assert.equal(arguments.length, 2);
}
const fBound = callBindBasic([f, 1]);
delete Function.prototype.call;
delete Function.prototype.bind;
fBound(2, 3);
Clone the repo, npm install
, and run npm test