0.3.0 • Published 9 months ago

nons v0.3.0

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

Installation

npm i nons

Usage

const validate = require("nons");
const types = require("nons/types");

const scheme = {
  this: {
    can: {
      as: {
        nested: {
          as: types.string,
        },
        you: types.array,
      },
      like: types.number,
    },
    with: {
      "optional?": types.string,
    },
  },
};

validate(schema, {
  this: {
    can: {
      as: {
        nested: {
          as: "works!",
        },
        you: ["also", "works!"],
      },
      like: 1,
    },
    with: {}, // only child is optional, but parent is required
  },
});
0.3.0

9 months ago

0.2.1

9 months ago

0.2.0

10 months ago

0.1.1

11 months ago

0.1.0

11 months ago