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:
21
node_modules/underscore/amd/_set.js
generated
vendored
Normal file
21
node_modules/underscore/amd/_set.js
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
define(['./isNumber', './isArray', './isObject'], function (isNumber, isArray, isObject) {
|
||||
|
||||
function set (obj, path, value) {
|
||||
var key = String(path[0]);
|
||||
|
||||
if (path.length === 1) {
|
||||
obj[key] = value;
|
||||
return;
|
||||
}
|
||||
|
||||
if (!isArray(obj[key]) || !isObject(obj[key])) {
|
||||
var nextKey = path[1];
|
||||
obj[key] = isNumber(nextKey) ? [] : {};
|
||||
}
|
||||
|
||||
return set(obj[key], path.slice(1), value);
|
||||
}
|
||||
|
||||
return set;
|
||||
|
||||
});
|
Reference in New Issue
Block a user