Transforms a JSON Schema to a type tcomb type.
Example
var transform = require('tcomb-json-schema');
var TcombType = transform({
"type": "string",
"enum": ["Street", "Avenue", "Boulevard"]
});
Registers a new format.
Example
function isEmail(x) {
return /(.)+@(.)+/.test(x);
}
transform.registerFormat('email', isEmail);
var TcombType = transform({
"type": "string",
"format": 'email'
});
Removes all registered formats.
transform.resetFormats();