node_modules updated, buefy add to lib folder
This commit is contained in:
+24
-15
@@ -1,6 +1,3 @@
|
||||
// Make sure Map exists for old Node.js versions
|
||||
var Map = global.Map != null ? global.Map : function() {};
|
||||
|
||||
// These properties are special and can open client libraries to security
|
||||
// issues
|
||||
var ignoreProperties = ['__proto__', 'constructor', 'prototype'];
|
||||
@@ -66,7 +63,9 @@ exports.get = function (path, o, special, map) {
|
||||
// reading a property from the array items
|
||||
var paths = parts.slice(i);
|
||||
|
||||
return obj.map(function (item) {
|
||||
// Need to `concat()` to avoid `map()` calling a constructor of an array
|
||||
// subclass
|
||||
return [].concat(obj).map(function (item) {
|
||||
return item
|
||||
? exports.get(paths, item, special || lookup, map)
|
||||
: map(undefined);
|
||||
@@ -255,17 +254,7 @@ exports.set = function (path, val, o, special, map, _copying) {
|
||||
// set the value on the last branch
|
||||
if (Array.isArray(obj) && !/^\d+$/.test(part)) {
|
||||
if (!copy && Array.isArray(val)) {
|
||||
for (var item, j = 0; j < obj.length && j < val.length; ++j) {
|
||||
item = obj[j];
|
||||
if (item) {
|
||||
if (lookup) {
|
||||
lookup(item, part, map(val[j]));
|
||||
} else {
|
||||
if (item[special]) item = item[special];
|
||||
item[part] = map(val[j]);
|
||||
}
|
||||
}
|
||||
}
|
||||
_setArray(obj, val, part, lookup, special, map);
|
||||
} else {
|
||||
for (var j = 0; j < obj.length; ++j) {
|
||||
item = obj[j];
|
||||
@@ -290,6 +279,26 @@ exports.set = function (path, val, o, special, map, _copying) {
|
||||
}
|
||||
}
|
||||
|
||||
/*!
|
||||
* Recursively set nested arrays
|
||||
*/
|
||||
|
||||
function _setArray(obj, val, part, lookup, special, map) {
|
||||
for (var item, j = 0; j < obj.length && j < val.length; ++j) {
|
||||
item = obj[j];
|
||||
if (Array.isArray(item) && Array.isArray(val[j])) {
|
||||
_setArray(item, val[j], part, lookup, special, map);
|
||||
} else if (item) {
|
||||
if (lookup) {
|
||||
lookup(item, part, map(val[j]));
|
||||
} else {
|
||||
if (item[special]) item = item[special];
|
||||
item[part] = map(val[j]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*!
|
||||
* Returns the value passed to it.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user