jsonschema
Advanced tools
Comparing version 1.2.8 to 1.2.9
@@ -263,4 +263,10 @@ 'use strict'; | ||
for (var pattern in patternProperties) { | ||
var expr = new RegExp(pattern, 'u'); | ||
if (!expr.test(property)) { | ||
try { | ||
var regexp = new RegExp(pattern, 'u'); | ||
} catch(_e) { | ||
// In the event the stricter handling causes an error, fall back on the forgiving handling | ||
// DEPRECATED | ||
regexp = new RegExp(pattern); | ||
} | ||
if (!regexp.test(property)) { | ||
continue; | ||
@@ -522,3 +528,10 @@ } | ||
var result = new ValidatorResult(instance, schema, options, ctx); | ||
var regexp = new RegExp(schema.pattern, 'u'); | ||
var pattern = schema.pattern; | ||
try { | ||
var regexp = new RegExp(pattern, 'u'); | ||
} catch(_e) { | ||
// In the event the stricter handling causes an error, fall back on the forgiving handling | ||
// DEPRECATED | ||
regexp = new RegExp(pattern); | ||
} | ||
if (!instance.match(regexp)) { | ||
@@ -525,0 +538,0 @@ result.addError({ |
@@ -98,2 +98,3 @@ /* | ||
allowUnknownAttributes?: boolean; | ||
preValidateProperty?: function; | ||
rewrite?: RewriteFunction; | ||
@@ -110,2 +111,6 @@ propertyName?: string; | ||
export interface preValidatePropertyFunction { | ||
(instance: any, key: string, schema: Schema, options: Options, ctx: SchemaContext): any; | ||
} | ||
export interface SchemaContext { | ||
@@ -112,0 +117,0 @@ schema: Schema; |
{ | ||
"author": "Tom de Grunt <tom@degrunt.nl>", | ||
"name": "jsonschema", | ||
"version": "1.2.8", | ||
"version": "1.2.9", | ||
"license": "MIT", | ||
@@ -6,0 +6,0 @@ "dependencies": {}, |
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
68381
1556