metabin-schema-validator

1.0.0 • Public • Published

Metabin Schema Validator

Metabin schemas validation tool

Installation

npm install metabin-schema-validator

Usage

import schemaValidator from 'metabin-schema-validator'

const schema = {
  "title": "string",
  "genres": [],
  "author": {
    "name": "string",
    "age": "number"
  },
  "band": "$schema_hash",
  "tracks": [ "$schema_hash", "number" ],
  "text": [[ "e", "n", "u", "m" ]]
}

const report = schemaValidator(schema)

console.log(report)

/*
{
  title: 'STRING',
  genres: '!Empty array of types.',
  author: { name: 'STRING', age: 'NUMBER' },
  band: 'SCHEMA_LINK',
  tracks: [ 'SCHEMA_LINK', 'NUMBER' ],
  text: 'ENUM' 
} 
*/

Readme

Keywords

Package Sidebar

Install

npm i metabin-schema-validator

Weekly Downloads

2

Version

1.0.0

License

MIT

Last publish

Collaborators

  • negamaxi