mini-type-decorator
Concise type assertions like a<map<fn:s>>
for class constructors and methods. For details on the type expressions, refer to mini-type-assert.
example
const t = @ { thistags = tags } @ { console } // Throws because 200 is not a string'ok' 200 2 a: true // Throws because 200 is more than 10'ok' 200 a: true // Throws because 200 is not a boolean'ok' 2 a: 200
Note: optional arguments (o<b>?
) as well as wildcards (*
) are on the roadmap.
install
With npm do:
npm install mini-type-decorator
license
MIT © Vincent Weevers