vscode-json-languageservice
Advanced tools
Comparing version 4.1.9 to 4.1.10
@@ -620,3 +620,3 @@ /*--------------------------------------------------------------------------------------------- | ||
var regex = extendedRegExp(schema.pattern); | ||
if (!regex.test(node.value)) { | ||
if (!(regex === null || regex === void 0 ? void 0 : regex.test(node.value))) { | ||
validationResult.problems.push({ | ||
@@ -815,3 +815,3 @@ location: { offset: node.offset, length: node.length }, | ||
var propertyName = _j[_h]; | ||
if (regex.test(propertyName)) { | ||
if (regex === null || regex === void 0 ? void 0 : regex.test(propertyName)) { | ||
propertyProcessed(propertyName); | ||
@@ -818,0 +818,0 @@ var child = seenKeys[propertyName]; |
@@ -443,3 +443,3 @@ /*--------------------------------------------------------------------------------------------- | ||
var regex = extendedRegExp(pattern); | ||
if (regex.test(parentKey)) { | ||
if (regex === null || regex === void 0 ? void 0 : regex.test(parentKey)) { | ||
propertyMatched = true; | ||
@@ -446,0 +446,0 @@ var propertySchema = s.schema.patternProperties[pattern]; |
@@ -122,3 +122,3 @@ /*--------------------------------------------------------------------------------------------- | ||
var regex = Strings.extendedRegExp(pattern); | ||
if (regex.test(next)) { | ||
if (regex === null || regex === void 0 ? void 0 : regex.test(next)) { | ||
return this.getSectionRecursive(path, schema.patternProperties[pattern]); | ||
@@ -125,0 +125,0 @@ } |
@@ -46,8 +46,20 @@ /*--------------------------------------------------------------------------------------------- | ||
export function extendedRegExp(pattern) { | ||
var flags = ''; | ||
if (startsWith(pattern, '(?i)')) { | ||
return new RegExp(pattern.substring(4), 'iu'); | ||
pattern = pattern.substring(4); | ||
flags = 'i'; | ||
} | ||
else { | ||
return new RegExp(pattern, 'u'); | ||
try { | ||
return new RegExp(pattern, flags + 'u'); | ||
} | ||
catch (e) { | ||
// could be an exception due to the 'u ' flag | ||
try { | ||
return new RegExp(pattern, flags); | ||
} | ||
catch (e) { | ||
// invalid pattern | ||
return undefined; | ||
} | ||
} | ||
} |
@@ -455,3 +455,3 @@ /*--------------------------------------------------------------------------------------------- | ||
var regex = strings_1.extendedRegExp(pattern); | ||
if (regex.test(parentKey)) { | ||
if (regex === null || regex === void 0 ? void 0 : regex.test(parentKey)) { | ||
propertyMatched = true; | ||
@@ -458,0 +458,0 @@ var propertySchema = s.schema.patternProperties[pattern]; |
@@ -134,3 +134,3 @@ /*--------------------------------------------------------------------------------------------- | ||
var regex = Strings.extendedRegExp(pattern); | ||
if (regex.test(next)) { | ||
if (regex === null || regex === void 0 ? void 0 : regex.test(next)) { | ||
return this.getSectionRecursive(path, schema.patternProperties[pattern]); | ||
@@ -137,0 +137,0 @@ } |
@@ -62,10 +62,22 @@ /*--------------------------------------------------------------------------------------------- | ||
function extendedRegExp(pattern) { | ||
var flags = ''; | ||
if (startsWith(pattern, '(?i)')) { | ||
return new RegExp(pattern.substring(4), 'iu'); | ||
pattern = pattern.substring(4); | ||
flags = 'i'; | ||
} | ||
else { | ||
return new RegExp(pattern, 'u'); | ||
try { | ||
return new RegExp(pattern, flags + 'u'); | ||
} | ||
catch (e) { | ||
// could be an exception due to the 'u ' flag | ||
try { | ||
return new RegExp(pattern, flags); | ||
} | ||
catch (e) { | ||
// invalid pattern | ||
return undefined; | ||
} | ||
} | ||
} | ||
exports.extendedRegExp = extendedRegExp; | ||
}); |
{ | ||
"name": "vscode-json-languageservice", | ||
"version": "4.1.9", | ||
"version": "4.1.10", | ||
"description": "Language service for JSON", | ||
@@ -17,5 +17,2 @@ "main": "./lib/umd/jsonLanguageService.js", | ||
}, | ||
"engines": { | ||
"npm": ">=7.0.0" | ||
}, | ||
"devDependencies": { | ||
@@ -22,0 +19,0 @@ "@types/mocha": "^9.0.0", |
Sorry, the diff of this file is too big to display
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
497494
10064