This repository has been archived on 2025-07-07. You can view files and clone it, but cannot push or open issues or pull requests.
Files
2025-01-13 09:33:52 +03:00

25 lines
643 B
JavaScript

'use strict';
var setFunctionLength = require('set-function-length');
var $defineProperty = require('es-define-property');
var callBindBasic = require('call-bind-apply-helpers');
var applyBind = require('call-bind-apply-helpers/applyBind');
module.exports = function callBind(originalFunction) {
var func = callBindBasic(arguments);
var adjustedLength = originalFunction.length - (arguments.length - 1);
return setFunctionLength(
func,
1 + (adjustedLength > 0 ? adjustedLength : 0),
true
);
};
if ($defineProperty) {
$defineProperty(module.exports, 'apply', { value: applyBind });
} else {
module.exports.apply = applyBind;
}