Skip to content

A simple collection of pave schema types for jump-starting a pave project

License

Notifications You must be signed in to change notification settings

pavejs/pave-basic-types

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

A simple collection of pave schema types for jump-starting a pave project

Resources

License

Stars

Watchers

Forks

Packages

No packages published