0.2.2 • Published 7 years ago
classpass v0.2.2
classpass
A light-weight es5-compatible typescript class validator for basic types (string, number and boolean).
Installation
Run npm install --save classpass
Example Use
import { Model, attr, string, boolean, number, validate } from 'classpass';
class Person extends Model {
@attr(string)
name: string;
}
let p = new Person({ name: 'John'});
validate(p).then(doSth).catch(doSth);