@framed/scrub
TypeScript icon, indicating that this package has built-in type declarations

0.0.1 • Public • Published

Jazz

Documentation Status

Scrub

Scrub is a simple object validator.

import * as scrub from '@framed/scrub';

const personValidator = scrub.object({
  name: scrub.string({ transformString: ['trim', 'title'] }),
  age: scrub.number({ min: 18 }),
});

type PersonType = scrub.GetType<typeof personValidator>;

const validPerson: PersonType = {
  name: 'Homer Simpson',
  age: 39,
};

personValidator.validate(validPerson);
// { name: 'Homer Simpson', age: 39 }

Documentation

To install run npm i @framed/scrub.

Please read the documentation at https://scrub.readthedocs.io/en/latest/.

Readme

Keywords

none

Package Sidebar

Install

npm i @framed/scrub

Weekly Downloads

2

Version

0.0.1

License

ISC

Unpacked Size

206 kB

Total Files

86

Last publish

Collaborators

  • lukeg