Added the underscore node_module.
All checks were successful
Auto Maintenance Cycle / pre-commit Autoupdate (push) Successful in 39s
All checks were successful
Auto Maintenance Cycle / pre-commit Autoupdate (push) Successful in 39s
This commit is contained in:
30
node_modules/underscore/amd/underscore-array-methods.js
generated
vendored
Normal file
30
node_modules/underscore/amd/underscore-array-methods.js
generated
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
define(['./underscore', './each', './_setup', './_chainResult'], function (underscore, each, _setup, _chainResult) {
|
||||
|
||||
// Add all mutator `Array` functions to the wrapper.
|
||||
each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) {
|
||||
var method = _setup.ArrayProto[name];
|
||||
underscore.prototype[name] = function() {
|
||||
var obj = this._wrapped;
|
||||
if (obj != null) {
|
||||
method.apply(obj, arguments);
|
||||
if ((name === 'shift' || name === 'splice') && obj.length === 0) {
|
||||
delete obj[0];
|
||||
}
|
||||
}
|
||||
return _chainResult(this, obj);
|
||||
};
|
||||
});
|
||||
|
||||
// Add all accessor `Array` functions to the wrapper.
|
||||
each(['concat', 'join', 'slice'], function(name) {
|
||||
var method = _setup.ArrayProto[name];
|
||||
underscore.prototype[name] = function() {
|
||||
var obj = this._wrapped;
|
||||
if (obj != null) obj = method.apply(obj, arguments);
|
||||
return _chainResult(this, obj);
|
||||
};
|
||||
});
|
||||
|
||||
return underscore;
|
||||
|
||||
});
|
Reference in New Issue
Block a user