npm.io
0.0.6 • Published 14 years ago

nodetype

Licence
BSD
Version
0.0.6
Deps
0
Vulns
0
Weekly
0

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));

Keywords