react-bsonschema-form
Advanced tools
Comparing version 0.41.4 to 0.41.5
@@ -37,18 +37,18 @@ "use strict"; | ||
var reEscapeChar = /\\(\\)?/g; | ||
var reLeadingDot = /^\./; | ||
var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; | ||
function errorPropertyToPath(property) { | ||
// Parse array indices, eg. "instance.level1.level2[2].level3" | ||
// => ["instance", "level1", "level2", 2, "level3"] | ||
return property.split(".").reduce(function (path, node) { | ||
var match = node.match(RE_ERROR_ARRAY_PATH); | ||
if (match) { | ||
var nodeName = node.slice(0, node.indexOf("[")); | ||
var indices = match.map(function (str) { | ||
return parseInt(str.slice(1, -1), 10); | ||
}); | ||
path = path.concat(nodeName, indices); | ||
} else { | ||
path.push(node); | ||
} | ||
return path; | ||
}, []); | ||
// copied from lodash https://github.com/lodash/lodash/blob/4.17.1/lodash.js#L6744 | ||
var result = []; | ||
if (reLeadingDot.test(property)) { | ||
result.push(''); | ||
} | ||
property.replace(rePropName, function (match, number, quote, string) { | ||
result.push(quote ? string.replace(reEscapeChar, '$1') : number || match); | ||
}); | ||
return result; | ||
} | ||
@@ -55,0 +55,0 @@ |
{ | ||
"name": "react-bsonschema-form", | ||
"version": "0.41.4", | ||
"version": "0.41.5", | ||
"description": "A simple React component capable of building HTML forms out of a JSON schema.", | ||
@@ -5,0 +5,0 @@ "scripts": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3884567
5065