From b19da31dc4d40ffccbd8bd38d3bd410fce604172 Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Mon, 4 Jan 2021 11:48:30 -0800 Subject: [PATCH] [Refactor] use `call-bind/callBound` instead of `function-bind` directly --- lib/results.js | 4 ++-- lib/test.js | 12 ++++++------ package.json | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/results.js b/lib/results.js index ed1de927..e07ac0d9 100644 --- a/lib/results.js +++ b/lib/results.js @@ -6,9 +6,9 @@ var inherits = require('inherits'); var through = require('through'); var resumer = require('resumer'); var inspect = require('object-inspect'); -var bind = require('function-bind'); +var callBound = require('call-bind/callBound'); var has = require('has'); -var regexpTest = bind.call(Function.call, RegExp.prototype.test); +var regexpTest = callBound('RegExp.prototype.test'); var yamlIndicators = /:|-|\?/; var nextTick = typeof setImmediate !== 'undefined' ? setImmediate diff --git a/lib/test.js b/lib/test.js index e1b56686..12065092 100644 --- a/lib/test.js +++ b/lib/test.js @@ -8,15 +8,15 @@ var EventEmitter = require('events').EventEmitter; var has = require('has'); var isRegExp = require('is-regex'); var trim = require('string.prototype.trim'); -var bind = require('function-bind'); +var callBound = require('call-bind/callBound'); var forEach = require('for-each'); var inspect = require('object-inspect'); var is = require('object-is'); -var isEnumerable = bind.call(Function.call, Object.prototype.propertyIsEnumerable); -var toLowerCase = bind.call(Function.call, String.prototype.toLowerCase); -var isProto = bind.call(Function.call, Object.prototype.isPrototypeOf); -var $test = bind.call(Function.call, RegExp.prototype.test); -var objectToString = bind.call(Function.call, Object.prototype.toString); +var isEnumerable = callBound('Object.prototype.propertyIsEnumerable'); +var toLowerCase = callBound('String.prototype.toLowerCase'); +var isProto = callBound('Object.prototype.isPrototypeOf'); +var $test = callBound('RegExp.prototype.test'); +var objectToString = callBound('Object.prototype.toString'); module.exports = Test; diff --git a/package.json b/package.json index 215c61c9..21e14946 100644 --- a/package.json +++ b/package.json @@ -22,11 +22,11 @@ "test": "test" }, "dependencies": { + "call-bind": "^1.0.0", "deep-equal": "^2.0.5", "defined": "^1.0.0", "dotignore": "^0.1.2", "for-each": "^0.3.3", - "function-bind": "^1.1.1", "glob": "^7.1.6", "has": "^1.0.3", "inherits": "^2.0.4",