This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

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

2.0.2 • Public • Published

schema

TypeScript ready object schema validation

NPM Version TypeScript Version Tested With Jest Pull Requests License Build Status Coverage Status Package Quality Dependencies Status NPM Total Downloads NPM Monthly Downloads Open Issues Closed Issues known vulnerabilities Github Stars Github Forks

Table of Content

Getting Started

Installation

NPM:

npm i @foxify/schema

Yarn:

yarn add @foxify/schema

Github Packages:

npm i @foxifyjs/schema

Usage

import Schema from "@foxify/schema";

const schema = {
  username: Schema.string()
    .alphanum()
    .required(),
  name: Schema.object().keys({
    first: Schema.string()
      .min(3)
      .required(),
    last: Schema.string().min(3),
  }).required(),
  datetime: Schema.date().default(Date.now),
};

try {
  const result = Schema.object().keys(schema).validate(value);
} catch (error) {
  // your error handler
}

for more details read the documents

Sponsors

Support this project by becoming a sponsor. Your logo will show up here. [Become a sponsor]

Sponsors

Authors

See also the list of contributors who participated in this project.

Versioning

We use SemVer for versioning. For the versions available, see the releases.

License

This project is licensed under the MIT License - see the LICENSE file for details

Package Sidebar

Install

npm i @foxify/schema

Weekly Downloads

0

Version

2.0.2

License

MIT

Unpacked Size

38 kB

Total Files

27

Last publish

Collaborators

  • ardalanamini