Security upgrades
This commit is contained in:
28
node_modules/@material-ui/utils/esm/deepmerge.js
generated
vendored
Normal file
28
node_modules/@material-ui/utils/esm/deepmerge.js
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
import _extends from "@babel/runtime/helpers/esm/extends";
|
||||
import _typeof from "@babel/runtime/helpers/esm/typeof";
|
||||
export function isPlainObject(item) {
|
||||
return item && _typeof(item) === 'object' && item.constructor === Object;
|
||||
}
|
||||
export default function deepmerge(target, source) {
|
||||
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {
|
||||
clone: true
|
||||
};
|
||||
var output = options.clone ? _extends({}, target) : target;
|
||||
|
||||
if (isPlainObject(target) && isPlainObject(source)) {
|
||||
Object.keys(source).forEach(function (key) {
|
||||
// Avoid prototype pollution
|
||||
if (key === '__proto__') {
|
||||
return;
|
||||
}
|
||||
|
||||
if (isPlainObject(source[key]) && key in target) {
|
||||
output[key] = deepmerge(target[key], source[key], options);
|
||||
} else {
|
||||
output[key] = source[key];
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return output;
|
||||
}
|
||||
Reference in New Issue
Block a user