validateWithObject validates a value using a JSON schema supplied as object.
const result = validateWithObject(5, { type: 'number' });
validateWithResource validates a value using a schema location at
the given path relative to the module represented by moduleRef
;
this is intended to be used by wrapping it in
@jkcfg/std/resource#withModuleRef
.
import { withModuleRef } from '@jkcfg/std/resource';
export function validate(value) {
return withModuleRef(ref => validateWithSchema(value, 'schema.json', ref));
}
validateWithFile validates a value using a schema located at the path (relative to the input directory).