@oneci/core

``` yarn add @oneci/core // or npm i @oneci/core ```

Usage no npm install needed!

<script type="module">
  import oneciCore from 'https://cdn.skypack.dev/@oneci/core';
</script>

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.