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;