@cfworker/json-schema 1.12.6 → 1.12.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/format.js +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/validate.js +2 -2
- package/package.json +1 -1
- package/src/format.ts +1 -1
- package/src/types.ts +1 -1
- package/src/validate.ts +2 -2
package/dist/format.js
CHANGED
package/dist/types.d.ts
CHANGED
|
@@ -37,7 +37,7 @@ export interface Schema {
|
|
|
37
37
|
dependentRequired?: Record<string, string[]>;
|
|
38
38
|
dependentSchemas?: Record<string, Schema>;
|
|
39
39
|
dependencies?: Record<string, Schema | string[]>;
|
|
40
|
-
prefixItems?: Array<Schema | boolean
|
|
40
|
+
prefixItems?: Array<Schema | boolean>;
|
|
41
41
|
items?: Schema | boolean | Array<Schema | boolean>;
|
|
42
42
|
additionalItems?: Schema | boolean;
|
|
43
43
|
unevaluatedItems?: Schema | boolean;
|
package/dist/validate.js
CHANGED
|
@@ -426,7 +426,7 @@ export function validate(instance, schema, draft = '2019-09', lookup = dereferen
|
|
|
426
426
|
if (!stop && $patternProperties !== undefined) {
|
|
427
427
|
const keywordLocation = `${schemaLocation}/patternProperties`;
|
|
428
428
|
for (const pattern in $patternProperties) {
|
|
429
|
-
const regex = new RegExp(pattern);
|
|
429
|
+
const regex = new RegExp(pattern, 'u');
|
|
430
430
|
const subSchema = $patternProperties[pattern];
|
|
431
431
|
for (const key in instance) {
|
|
432
432
|
if (!regex.test(key)) {
|
|
@@ -779,7 +779,7 @@ export function validate(instance, schema, draft = '2019-09', lookup = dereferen
|
|
|
779
779
|
error: `String is too long (${length} > ${$maxLength}).`
|
|
780
780
|
});
|
|
781
781
|
}
|
|
782
|
-
if ($pattern !== undefined && !new RegExp($pattern).test(instance)) {
|
|
782
|
+
if ($pattern !== undefined && !new RegExp($pattern, 'u').test(instance)) {
|
|
783
783
|
errors.push({
|
|
784
784
|
instanceLocation,
|
|
785
785
|
keyword: 'pattern',
|
package/package.json
CHANGED
package/src/format.ts
CHANGED
package/src/types.ts
CHANGED
|
@@ -51,7 +51,7 @@ export interface Schema {
|
|
|
51
51
|
dependentSchemas?: Record<string, Schema>;
|
|
52
52
|
dependencies?: Record<string, Schema | string[]>;
|
|
53
53
|
|
|
54
|
-
prefixItems?: Array<Schema | boolean
|
|
54
|
+
prefixItems?: Array<Schema | boolean>;
|
|
55
55
|
items?: Schema | boolean | Array<Schema | boolean>;
|
|
56
56
|
additionalItems?: Schema | boolean;
|
|
57
57
|
unevaluatedItems?: Schema | boolean;
|
package/src/validate.ts
CHANGED
|
@@ -673,7 +673,7 @@ export function validate(
|
|
|
673
673
|
if (!stop && $patternProperties !== undefined) {
|
|
674
674
|
const keywordLocation = `${schemaLocation}/patternProperties`;
|
|
675
675
|
for (const pattern in $patternProperties) {
|
|
676
|
-
const regex = new RegExp(pattern);
|
|
676
|
+
const regex = new RegExp(pattern, 'u');
|
|
677
677
|
const subSchema = $patternProperties[pattern];
|
|
678
678
|
for (const key in instance) {
|
|
679
679
|
if (!regex.test(key)) {
|
|
@@ -1142,7 +1142,7 @@ export function validate(
|
|
|
1142
1142
|
error: `String is too long (${length} > ${$maxLength}).`
|
|
1143
1143
|
});
|
|
1144
1144
|
}
|
|
1145
|
-
if ($pattern !== undefined && !new RegExp($pattern).test(instance)) {
|
|
1145
|
+
if ($pattern !== undefined && !new RegExp($pattern, 'u').test(instance)) {
|
|
1146
1146
|
errors.push({
|
|
1147
1147
|
instanceLocation,
|
|
1148
1148
|
keyword: 'pattern',
|