冯博深 f143f24da4 first преди 12 часа
..
.github f143f24da4 first преди 12 часа
test f143f24da4 first преди 12 часа
.eslintrc f143f24da4 first преди 12 часа
.nycrc f143f24da4 first преди 12 часа
CHANGELOG.md f143f24da4 first преди 12 часа
LICENSE f143f24da4 first преди 12 часа
README.md f143f24da4 first преди 12 часа
actualApply.d.ts f143f24da4 first преди 12 часа
actualApply.js f143f24da4 first преди 12 часа
applyBind.d.ts f143f24da4 first преди 12 часа
applyBind.js f143f24da4 first преди 12 часа
functionApply.d.ts f143f24da4 first преди 12 часа
functionApply.js f143f24da4 first преди 12 часа
functionCall.d.ts f143f24da4 first преди 12 часа
functionCall.js f143f24da4 first преди 12 часа
index.d.ts f143f24da4 first преди 12 часа
index.js f143f24da4 first преди 12 часа
package.json f143f24da4 first преди 12 часа
reflectApply.d.ts f143f24da4 first преди 12 часа
reflectApply.js f143f24da4 first преди 12 часа
tsconfig.json f143f24da4 first преди 12 часа

README.md

call-bind-apply-helpers Version Badge

github actions coverage dependency status dev dependency status License Downloads

npm badge

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.

Getting started

npm install --save call-bind-apply-helpers

Usage/Examples

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);

Tests

Clone the repo, npm install, and run npm test