Utility for type casting & data conversion.
Chaste is a tiny library for handle type casting.
Basically you stablish the output type to convert your input data, for example:
var Chaste =var chaste =
Now, when you provide a input value it always return the
String casting version:
// => '12'
By default, it's support native types (like
Also you can provide a function-type-like, for example:
var chaste =shouldbe// => '_-abc_-_'
As you can see, rest param are supported!
You can use it as little middleware to be sure about the value of something.
$ npm install chaste --save
If you want to use in the browser (powered by Browserify):
$ bower install chaste --save
and later link in your HTML:
var Chaste =var chaste =// => '12'
Factory function to create output type.
Notes that you can provide your own factory function as well, but it needs to create instances without using
MIT © Kiko Beats