@takeshape/json-schema
Advanced tools
Comparing version 7.14.0 to 7.38.2
@@ -195,6 +195,7 @@ import Ajv, { ErrorObject } from 'ajv'; | ||
} | ||
export function createSchemaValidator(schema, metaSchemas = []) { | ||
export function createSchemaValidator(schema, metaSchemas = [], options = {}) { | ||
const schemas = Array.isArray(schema) ? schema : [schema]; | ||
const ajv = createAjv({ | ||
removeAdditional: true | ||
removeAdditional: true, | ||
...options | ||
}); | ||
@@ -201,0 +202,0 @@ |
@@ -32,3 +32,3 @@ import Ajv, { ErrorObject, Options, SchemaObject } from 'ajv'; | ||
export declare function fixSchema(schema: SchemaObject): SchemaObject; | ||
export declare function createSchemaValidator(schema: SchemaObject | SchemaObject[], metaSchemas?: SchemaObject[]): Validator; | ||
export declare function createSchemaValidator(schema: SchemaObject | SchemaObject[], metaSchemas?: SchemaObject[], options?: Options): Validator; | ||
//# sourceMappingURL=schema-validator.d.ts.map |
@@ -232,6 +232,7 @@ "use strict"; | ||
function createSchemaValidator(schema, metaSchemas = []) { | ||
function createSchemaValidator(schema, metaSchemas = [], options = {}) { | ||
const schemas = Array.isArray(schema) ? schema : [schema]; | ||
const ajv = createAjv({ | ||
removeAdditional: true | ||
removeAdditional: true, | ||
...options | ||
}); | ||
@@ -238,0 +239,0 @@ |
{ | ||
"name": "@takeshape/json-schema", | ||
"version": "7.14.0", | ||
"version": "7.38.2", | ||
"description": "JSON Schema validator", | ||
@@ -5,0 +5,0 @@ "homepage": "https://www.takeshape.io", |
Sorry, the diff of this file is not supported yet
19158
419