We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 404223b commit 2be3354Copy full SHA for 2be3354
index.js
@@ -112,6 +112,10 @@
112
}
113
var currentPath = path[0];
114
var currentValue = getShallowProperty(obj, currentPath);
115
+ if (options.includeInheritedProps && (currentPath === '__proto__' ||
116
+ (currentPath === 'constructor' && typeof currentValue === 'function'))) {
117
+ throw new Error('For security reasons, object\'s magic properties cannot be set')
118
+ }
119
if (path.length === 1) {
120
if (currentValue === void 0 || !doNotReplace) {
121
obj[currentPath] = value;
0 commit comments