@acot/schema-validator
TypeScript icon, indicating that this package has built-in type declarations

0.0.19 • Public • Published

@acot/schema-validator

A simple wrapper module for schema-utils.

Installation

Install via npm:

$ npm install --save @acot/schema-validator

Usage

T.B.A

import { validate } from '@acot/schema-validator';

type User = {
  id: string;
  name: string;
  age: string;
};

const user = {
  id: 'akfgayq12ugb',
  name: 'Iron Man',
  age: 55,
};

validate<User>(
  {
    properties: {
      id: {
        type: 'string',
      },
      name: {
        type: 'string',
      },
      age: {
        type: 'integer',
      },
    },
    additionalProperties: false,
  },
  user,
  {
    name: 'User',
    base: 'options',
  },
);

Readme

Keywords

none

Package Sidebar

Install

npm i @acot/schema-validator

Weekly Downloads

155

Version

0.0.19

License

MIT

Unpacked Size

4.88 kB

Total Files

11

Last publish

Collaborators

  • wadackel