Skip to content

Commit

Permalink
Block prototype keywords from key paths (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
huntr-helper committed Jul 27, 2022
1 parent 1c87f5e commit 9eda37e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/create.js
Expand Up @@ -33,6 +33,10 @@ function create(obj, str, val) {
for (var k = 0; k < last; k++) {
var key = keys[k];

if (key === '__proto__' || key === 'constructor' || key === 'prototype') {
return container;
}

if (!tmp[key]) {
tmp[key] = typed(keys[k + 1]);
}
Expand Down

0 comments on commit 9eda37e

Please sign in to comment.