Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

call-bind-apply-helpers

ljharb81.3mMIT1.0.2TypeScript support: included

Helper functions around Function call/apply/bind, for use in call-bind

readme

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

changelog

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog and this project adheres to Semantic Versioning.

v1.0.2 - 2025-02-12

Commits

  • [types] improve inferred types e6f9586
  • [Dev Deps] update @arethetypeswrong/cli, @ljharb/tsconfig, @types/tape, es-value-fixtures, for-each, has-strict-mode, object-inspect e43d540

v1.0.1 - 2024-12-08

Commits

  • [types] reflectApply: fix types 4efc396
  • [Fix] reflectApply: oops, Reflect is not a function 83cc739
  • [Dev Deps] update @arethetypeswrong/cli 80bd5d3

v1.0.0 - 2024-12-05

Commits