@oneci/core
v1.0.0-alpha.1
Published
``` yarn add @oneci/core // or npm i @oneci/core ```
Downloads
6
Readme
@oneci/core
installation
yarn add @oneci/core
// or
npm i @oneci/core
usage
import { [Function] } from '@oneci/core'
functions
validate
function (data): void
Validates a JSON data structure (most likely an object) against the spec. Throws an error if the data is not valid.
example
import { validate } from "@oneci/core";
try {
validate({ foo: bar });
} catch (error) {
console.error(error.message);
// --> "data.jobs should be array"
}
isValid
function (data): boolean
Validates a JSON data structure (most likely an object) against the spec. Returns true is the data adheres to the spec, false otherwise.