@oneci/core
TypeScript icon, indicating that this package has built-in type declarations

1.0.0-alpha.1 • Public • Published

@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.

Readme

Keywords

none

Package Sidebar

Install

npm i @oneci/core

Weekly Downloads

1

Version

1.0.0-alpha.1

License

MIT

Unpacked Size

4.97 kB

Total Files

11

Last publish

Collaborators

  • hongaar