This repository has been archived on 2026-03-06. You can view files and clone it, but cannot push or open issues or pull requests.
todo/client/node_modules/underscore/cjs/bind.js

16 lines
559 B
JavaScript
Raw Normal View History

2025-06-13 06:04:40 +00:00
var isFunction = require('./isFunction.js');
var _executeBound = require('./_executeBound.js');
var restArguments = require('./restArguments.js');
// Create a function bound to a given object (assigning `this`, and arguments,
// optionally).
var bind = restArguments(function(func, context, args) {
if (!isFunction(func)) throw new TypeError('Bind must be called on a function');
var bound = restArguments(function(callArgs) {
return _executeBound(func, bound, context, this, args.concat(callArgs));
});
return bound;
});
module.exports = bind;