Tower Type
API for defining/sanitizing custom resource attribute types.
Installation
node.js:
$ npm install tower-type
browser:
$ component install tower/type
Example
Define comparators/validators for basic types:
var type = ; ;
Define a custom type with custom validators:
var now = Date; ; var validate = type;; // true
Sanitize values:
; ; // 123 { return val;} { return val;}
Testing
Install testem:
$ npm install -g testem
Run tests:
$ testem
Then, open all the browsers you want to test by going to the outputted url defaulted to http://localhost:7357
Tests will run on any open browser linked to the stated url and your current Node environment.
Contributing
Before you send a pull request, make sure your code meets the style guidelines at https://github.com/tower/style-guide and all tests pass.
License
MIT