pave-basic-types

0.1.2 • Public • Published

Pave Basic Types

A set of basic types for Pave

Included Types

  • String
  • Number
  • Object
  • Time
  • Datetime
  • Date
  • Boolean

Installation

Simply include this in your package.json and then spread this into your Pave schema index to have pre-baked types ready to go, as shown below

// In your schema root

import types from 'pave-basic-types';

export default {
 ...types
}

// ...or, if you prefer a selective choosing of the types provided by this package

import types from 'pave-basic-types';

const { string, boolean, ...etc } = types;

export default {
 string,
 boolean,
 ...etc
}

And now you have your basic scalar types defined

Footnotes

All errors thrown by values that don't fit types fit the same form;

Expected a value of type Type but was provided value Value

This is useful in the case that you'd like to implement your own wrapper error catching function, as you'll be able to predict the format of the caught error, and be able to do from there as you please.

Readme

Keywords

none

Package Sidebar

Install

npm i pave-basic-types

Weekly Downloads

3

Version

0.1.2

License

MIT

Unpacked Size

5.55 kB

Total Files

11

Last publish

Collaborators

  • nathanielopdev