Skip to content

Commit

Permalink
Prohibit prototype pollution
Browse files Browse the repository at this point in the history
  • Loading branch information
dfahlander committed Apr 27, 2022
1 parent b350b8c commit 1d655a6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/functions/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ export function setByKeyPath(obj, keyPath, value) {
} else obj[currentKeyPath] = value;
else {
var innerObj = obj[currentKeyPath];
if (!innerObj) innerObj = (obj[currentKeyPath] = {});
if (!innerObj || !hasOwn(obj, currentKeyPath)) innerObj = (obj[currentKeyPath] = {});
setByKeyPath(innerObj, remainingKeyPath, value);
}
} else {
Expand Down

0 comments on commit 1d655a6

Please sign in to comment.