From 21a9046cfa0c2697cb41990f3b4316db410e6c8a Mon Sep 17 00:00:00 2001 From: Adam Gold Date: Tue, 25 Aug 2020 15:37:44 +0300 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9B=20fix=20prototype=20polluti?= =?UTF-8?q?on?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/index.js b/index.js index 1ec2148..a5b46c3 100644 --- a/index.js +++ b/index.js @@ -76,6 +76,9 @@ function parsePath(path) { var str = path.replace(/([^\\])\[/g, '$1.['); var parts = str.match(/(\\\.|[^.]+?)+/g); return parts.map(function mapMatches(value) { + if (value === "constructor" || value === "__proto__" || value === "prototype") { + return {} + } var regexp = /^\[(\d+)\]$/; var mArr = regexp.exec(value); var parsed = null;