1.0.7 • Published 1 month ago

call-bind v1.0.7

Weekly downloads
15,111,743
License
MIT
Repository
github
Last release
1 month ago

call-bind Version Badge

github actions coverage dependency status dev dependency status License Downloads

npm badge

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

es-abstractis-regexobject.assignutil.promisifystring.prototype.trimendstring.prototype.trimstartobject.getownpropertydescriptorsobject.valuesdeep-equalobject-isregexp.prototype.flagsarray-includesis-argumentsobject.entriesarray.prototype.flatobject.fromentriesside-channelstring.prototype.matchallarray.prototype.flatmapjson-stable-stringifystring.prototype.trimleftfunction.prototype.namestring.prototype.padendstring.prototype.trimrightis-nanis-boolean-objectes-get-iteratorhtml-element-mappromise.prototype.finallypromise.allsettledsymbol.prototype.descriptionstring.prototype.padstartstring.prototype.trimreflect.ownkeysarray.prototype.maparray.prototype.findwhich-typed-arrayarchetype-librarycomponennentt@dinert/utilseasy-select-rnvuedragdropuploadimagesairscanairscan-examplereact-native-esc-pos-sahaab@borisovart/atol-kkt-module@frxf/frxf@phil8795/pecuniarius-apideneme323112@texttree/demo-bsa-reference-rcl@fundefund/funde_ck@ntt_app/react-native-custom-notificationreact-native-custom-text-hwjamesreact-native-covid-sdkgql_din_modafryxiconsmutasi-bca@jttechnic/interpreter@saeon/ol-react@saeon/quick-form@olivervorasai/sliderreact-native-printer-brothersrn-pdf-reader-offlinecbmis-ai-toolboxreact-native-shekhar-bridge-testasterjscogoportutilsuncoded-connectlevibestliblevibestlib2levilibtest19levilibtest24levilibtest25levilibtest26levilibtest27levilibtest28levilibtest29wilscanner@khalitovadel/abstract-repository@oiti/documentoscopy-react-native@mink-opn/build-tokensquoc-testreact-native-slider-kfhexa-node-common@prodam/prodam-typescclibyarntest@saaspe/componentshyperpass-sdkexpand-react-bridgeexpress-api-pack-tropea-bootstraapluminos-ui-coresklif-ui-kitsklif-api@everything-registry/sub-chunk-1287iqra-calculatorjawwy-sdkjawwy_gamification_release@314oner_npm/universal-components-library@deepakorg/test
1.0.7

1 month ago

1.0.6

2 months ago

1.0.5

5 months ago

1.0.4

5 months ago

1.0.3

5 months ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago