NODE-TYPE
Installation
npm install nodetype
Usage
// nodetype.check(type, value, convert);
nodetype.check('Boolean', 'True', true);
function MyObject () {
this.hello = 'world';
this.world = 'hello';
}
nodetype.set('MyObject', function (val) {
return (val.hello || undefined) === 'world' && (val.world || undefined) === 'hello';
});
var myobj = new MyObject;
console.log(nodetype.check('MyObject', myobj));