diff --git a/lib/processNested.js b/lib/processNested.js index aeb9225..f6a8ff0 100644 --- a/lib/processNested.js +++ b/lib/processNested.js @@ -21,7 +21,8 @@ module.exports = function(data){ let k = keyParts[index]; // Ensure we don't allow prototype pollution - if (OBJECT_PROTOTYPE_KEYS.includes(k) || (ARRAY_PROTOTYPE_KEYS.includes(k) && Array.isArray(current))) { + const IN_ARRAY_PROTOTYPE = ARRAY_PROTOTYPE_KEYS.includes(k) && Array.isArray(current); + if (OBJECT_PROTOTYPE_KEYS.includes(k) || IN_ARRAY_PROTOTYPE) { continue; }