Buckets:
6.69 GB
45,738 files
Updated about 2 months ago
Ctrl+K
| Name | Size | Uploaded | Xet hash |
|---|---|---|---|
| .github | 1 items | ||
| test | 2 items | ||
| .eslintignore | 10 Bytes xet | e8d1b70a | |
| .eslintrc | 208 Bytes xet | b834ba31 | |
| .nycrc | 139 Bytes xet | 4fec1c2b | |
| CHANGELOG.md | 8.14 kB xet | c1e536cf | |
| LICENSE | 1.07 kB xet | 8eb499f2 | |
| README.md | 2.03 kB xet | 46cf6a19 | |
| callBound.js | 413 Bytes xet | 5be0d6a6 | |
| index.js | 1.04 kB xet | 284c2c28 | |
| package.json | 2.3 kB xet | 8a902077 |
call-bind
Robustly .call.bind() a function.
Getting started
npm install --save call-bind
Usage/Examples
const assert = require('assert');
const callBind = require('call-bind');
const callBound = require('call-bind/callBound');
function f(a, b) {
assert.equal(this, 1);
assert.equal(a, 2);
assert.equal(b, 3);
assert.equal(arguments.length, 2);
}
const fBound = callBind(f);
const slice = callBound('Array.prototype.slice');
delete Function.prototype.call;
delete Function.prototype.bind;
fBound(1, 2, 3);
assert.deepEqual(slice([1, 2, 3, 4], 1, -1), [2, 3]);
Tests
Clone the repo, npm install, and run npm test
- Total size
- 6.69 GB
- Files
- 45,738
- Last updated
- Sep 12
- Pre-warmed CDN
- US EU US EU
