From 0a609f1be6269cbf501482aacd9a0a1bd8596108 Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Sun, 24 Apr 2022 22:09:01 -0700 Subject: [PATCH] [Refactor] use `call-bind` instead of `function-bind` --- index.js | 12 ++++++------ package.json | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/index.js b/index.js index f5e9f3b..5cde479 100644 --- a/index.js +++ b/index.js @@ -1,15 +1,15 @@ 'use strict'; var whichBoxedPrimitive = require('which-boxed-primitive'); -var bind = require('function-bind'); +var callBound = require('call-bind/callBound'); var hasSymbols = require('has-symbols')(); var hasBigInts = require('has-bigints')(); -var stringToString = bind.call(Function.call, String.prototype.toString); -var numberValueOf = bind.call(Function.call, Number.prototype.valueOf); -var booleanValueOf = bind.call(Function.call, Boolean.prototype.valueOf); -var symbolValueOf = hasSymbols && bind.call(Function.call, Symbol.prototype.valueOf); -var bigIntValueOf = hasBigInts && bind.call(Function.call, BigInt.prototype.valueOf); +var stringToString = callBound('String.prototype.toString'); +var numberValueOf = callBound('Number.prototype.valueOf'); +var booleanValueOf = callBound('Boolean.prototype.valueOf'); +var symbolValueOf = hasSymbols && callBound('Symbol.prototype.valueOf'); +var bigIntValueOf = hasBigInts && callBound('BigInt.prototype.valueOf'); module.exports = function unboxPrimitive(value) { var which = whichBoxedPrimitive(value); diff --git a/package.json b/package.json index 2415578..f920cc4 100644 --- a/package.json +++ b/package.json @@ -49,7 +49,7 @@ "tape": "^5.3.2" }, "dependencies": { - "function-bind": "^1.1.1", + "call-bind": "^1.0.2", "has-bigints": "^1.0.1", "has-symbols": "^1.0.2", "which-boxed-primitive": "^1.0.2"