diff options
| author | Leonardo Bishop <me@leonardobishop.com> | 2023-11-04 23:59:44 +0000 |
|---|---|---|
| committer | Leonardo Bishop <me@leonardobishop.com> | 2023-11-04 23:59:44 +0000 |
| commit | c6c93acc32893d891adb39011674c02f3f04999e (patch) | |
| tree | c58a17d789301cbc59bef1e0e3730dd9dc9aae98 /backend/node_modules/call-bind/index.js | |
| parent | 9125c0bc964e499b40ddfa3e87d0b474dc63f5db (diff) | |
gitignore some shit
Diffstat (limited to 'backend/node_modules/call-bind/index.js')
| -rw-r--r-- | backend/node_modules/call-bind/index.js | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/backend/node_modules/call-bind/index.js b/backend/node_modules/call-bind/index.js deleted file mode 100644 index 184ee2b..0000000 --- a/backend/node_modules/call-bind/index.js +++ /dev/null @@ -1,44 +0,0 @@ -'use strict'; - -var bind = require('function-bind'); -var GetIntrinsic = require('get-intrinsic'); -var setFunctionLength = require('set-function-length'); - -var $TypeError = GetIntrinsic('%TypeError%'); -var $apply = GetIntrinsic('%Function.prototype.apply%'); -var $call = GetIntrinsic('%Function.prototype.call%'); -var $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply); - -var $defineProperty = GetIntrinsic('%Object.defineProperty%', true); -var $max = GetIntrinsic('%Math.max%'); - -if ($defineProperty) { - try { - $defineProperty({}, 'a', { value: 1 }); - } catch (e) { - // IE 8 has a broken defineProperty - $defineProperty = null; - } -} - -module.exports = function callBind(originalFunction) { - if (typeof originalFunction !== 'function') { - throw new $TypeError('a function is required'); - } - var func = $reflectApply(bind, $call, arguments); - return setFunctionLength( - func, - 1 + $max(0, originalFunction.length - (arguments.length - 1)), - true - ); -}; - -var applyBind = function applyBind() { - return $reflectApply(bind, $apply, arguments); -}; - -if ($defineProperty) { - $defineProperty(module.exports, 'apply', { value: applyBind }); -} else { - module.exports.apply = applyBind; -} |
