1.0.8 • Published 6 months ago

call-bind v1.0.8

Weekly downloads
15,111,743
License
MIT
Repository
github
Last release
6 months 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-abstractobject.assignstring.prototype.trimendstring.prototype.trimstartutil.promisifyobject.getownpropertydescriptorsobject.valuesdeep-equalobject-isregexp.prototype.flagsarray-includesobject.entriesarray.prototype.flatobject.fromentriesstring.prototype.matchallarray.prototype.flatmapjson-stable-stringifystring.prototype.trimleftstring.prototype.padendstring.prototype.trimrightfunction.prototype.nameis-nanes-get-iteratorsymbol.prototype.descriptionstring.prototype.padstartstring.prototype.trimpromise.allsettledpromise.prototype.finallyreflect.ownkeyshtml-element-maparray.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@deepakorg/test@deepak757/testreact-native-sphereuisphereuijawwy_libraryreact-native-credit-card-pkg
1.0.8

6 months ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

5 years ago