call-bind-apply-helpers
Helper functions around Function call/apply/bind, for use in `call-bind`
Last updated 2 years ago by ljharb .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install call-bind-apply-helpers 
SYNC missed versions from official npm registry.

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

Current Tags

  • 1.0.2                                ...           latest (2 years ago)

3 Versions

  • 1.0.2                                ...           2 years ago
  • 1.0.1                                ...           2 years ago
  • 1.0.0                                ...           2 years ago
Maintainers (1)
Downloads
Total 6
Today 0
This Week 0
This Month 4
Last Day 0
Last Week 0
Last Month 1
Dependencies (2)
Dev Dependencies (21)

© 2010 - cnpmjs.org x YWFE | Home | YWFE