UNPKG

@squiz/json-schema-library

Version:

Customizable and hackable json-validator and json-schema utilities for traversal, data generation and validation

13 lines 451 B
/** * Test if the data is valid according to the given schema * * @param core - validator * @param value - value to validate * @param [schema] - json schema * @param [pointer] - json pointer pointing to value * @return if schema does match given value */ export default function isValid(core, value, schema = core.rootSchema, pointer = "#") { return core.validate(value, schema, pointer).length === 0; } //# sourceMappingURL=isValid.js.map