mirror of
https://code.forgejo.org/actions/setup-node.git
synced 2025-05-20 13:14:44 +00:00
.
This commit is contained in:
parent
fc725ba36b
commit
422b9fdb15
7395 changed files with 1786235 additions and 3476 deletions
41
node_modules/lodash/bindAll.js
generated
vendored
Normal file
41
node_modules/lodash/bindAll.js
generated
vendored
Normal file
|
@ -0,0 +1,41 @@
|
|||
var arrayEach = require('./_arrayEach'),
|
||||
baseAssignValue = require('./_baseAssignValue'),
|
||||
bind = require('./bind'),
|
||||
flatRest = require('./_flatRest'),
|
||||
toKey = require('./_toKey');
|
||||
|
||||
/**
|
||||
* Binds methods of an object to the object itself, overwriting the existing
|
||||
* method.
|
||||
*
|
||||
* **Note:** This method doesn't set the "length" property of bound functions.
|
||||
*
|
||||
* @static
|
||||
* @since 0.1.0
|
||||
* @memberOf _
|
||||
* @category Util
|
||||
* @param {Object} object The object to bind and assign the bound methods to.
|
||||
* @param {...(string|string[])} methodNames The object method names to bind.
|
||||
* @returns {Object} Returns `object`.
|
||||
* @example
|
||||
*
|
||||
* var view = {
|
||||
* 'label': 'docs',
|
||||
* 'click': function() {
|
||||
* console.log('clicked ' + this.label);
|
||||
* }
|
||||
* };
|
||||
*
|
||||
* _.bindAll(view, ['click']);
|
||||
* jQuery(element).on('click', view.click);
|
||||
* // => Logs 'clicked docs' when clicked.
|
||||
*/
|
||||
var bindAll = flatRest(function(object, methodNames) {
|
||||
arrayEach(methodNames, function(key) {
|
||||
key = toKey(key);
|
||||
baseAssignValue(object, key, bind(object[key], object));
|
||||
});
|
||||
return object;
|
||||
});
|
||||
|
||||
module.exports = bindAll;
|
Loading…
Add table
Add a link
Reference in a new issue