app-service
Compose transforming, validation and actual service methods in a strict pipeline
Installation
npm install app-service
Usage
Define transform, validate function and actual method and wire up it through app-service
var build = ; { console; paramsemail = paramsemail; return params;} { console: if paramsemaillength > 100 throw 'Email is toooo long'; } { console; return 'got it!';} var service = ; service;
outputs:
transform { email: 'Johny.Dust@example.com' }
validate { email: 'johny.dust@example.com' }
{ email: 'johny.dust@example.com' }
got it!
LICENSE
MIT