@takeshape/json-schema 10.4.9 → 10.6.1
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.
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import type { ErrorObject, Options, SchemaObject } from 'ajv';
|
|
2
2
|
import Ajv from 'ajv';
|
|
3
3
|
export type Data = any;
|
|
4
|
-
export
|
|
4
|
+
export type ValidateParams = {
|
|
5
5
|
ignoreMissing: boolean;
|
|
6
6
|
ignoreNulls: boolean;
|
|
7
7
|
errorsText: boolean;
|
|
8
|
-
}
|
|
9
|
-
export
|
|
8
|
+
};
|
|
9
|
+
export type ValidateResult = {
|
|
10
10
|
valid: boolean;
|
|
11
11
|
errorsText: string;
|
|
12
12
|
errors: ErrorObject[];
|
|
13
|
-
}
|
|
13
|
+
};
|
|
14
14
|
export type Validator = (data: Data, options?: Partial<ValidateParams>) => ValidateResult;
|
|
15
15
|
export declare function parseDataPath(instancePath: string): string[];
|
|
16
16
|
export declare function isInvalidPropertyRequired(topLevelSchema: SchemaObject, error: ErrorObject): boolean;
|
|
@@ -21,7 +21,7 @@ export declare function refToPath(ref: string): string[];
|
|
|
21
21
|
export declare function followSchemaPath(topLevelSchema: SchemaObject, instancePath: string[]): SchemaObject | undefined;
|
|
22
22
|
export type MinimalAjv = Pick<Ajv, 'validate' | 'errors' | 'getSchema' | 'errorsText'>;
|
|
23
23
|
export declare function validate(ajv: MinimalAjv, id: string, data: Data, options?: Partial<ValidateParams>): ValidateResult;
|
|
24
|
-
export { Ajv, ErrorObject };
|
|
24
|
+
export { Ajv, type ErrorObject };
|
|
25
25
|
export declare function createAjv(options?: Options): Ajv;
|
|
26
26
|
/**
|
|
27
27
|
* Apply various fixes to the schema to work around AJV issues and bugs.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema-validator.d.ts","sourceRoot":"","sources":["../../src/schema-validator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,WAA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AAC,CAAC;AAsBvF,wBAAgB,QAAQ,CAAC,GAAG,EAAE,UAAU,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,GAAG,cAAc,CA2BnH;AAED,OAAO,EAAC,GAAG,EAAE,KAAK,WAAW,EAAC,CAAC;AAC/B,wBAAgB,SAAS,CAAC,OAAO,CAAC,EAAE,OAAO,GAAG,GAAG,CAmBhD;AAeD;;;GAGG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,YAAY,GAAG,YAAY,CAmB5D;AAED,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,YAAY,GAAG,YAAY,EAAE,EACrC,WAAW,GAAE,YAAY,EAAO,EAChC,OAAO,GAAE,OAAY,GACpB,SAAS,CAqBX"}
|
package/dist/schema-validator.js
CHANGED
package/es/schema-validator.js
CHANGED
|
@@ -153,7 +153,7 @@ export function createAjv(options) {
|
|
|
153
153
|
*/
|
|
154
154
|
function isValidRegex(str) {
|
|
155
155
|
try {
|
|
156
|
-
// eslint-disable-next-line no-new
|
|
156
|
+
// eslint-disable-next-line no-new
|
|
157
157
|
new RegExp(str, 'u');
|
|
158
158
|
return true;
|
|
159
159
|
} catch {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@takeshape/json-schema",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.6.1",
|
|
4
4
|
"description": "JSON Schema validator",
|
|
5
5
|
"homepage": "https://www.takeshape.io",
|
|
6
6
|
"repository": {
|
|
@@ -20,11 +20,11 @@
|
|
|
20
20
|
"ajv": "^8.11.0",
|
|
21
21
|
"ajv-formats": "^2.1.1",
|
|
22
22
|
"lodash": "^4.17.21",
|
|
23
|
-
"@takeshape/util": "10.
|
|
23
|
+
"@takeshape/util": "10.6.1"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@types/lodash": "^4.14.165",
|
|
27
|
-
"@takeshape/typescript-jest-junit-reporter": "10.
|
|
27
|
+
"@takeshape/typescript-jest-junit-reporter": "10.6.1"
|
|
28
28
|
},
|
|
29
29
|
"engines": {
|
|
30
30
|
"node": ">=18"
|