Closed nicolaslt closed 7 years ago
Of course. I prefer do all the thing async in node.js so I've created only async method. Do you think that I should create new function transformAndValidateSync
or just implement it as an option { sync: true }
to the already existing transformAndValidate
function?
My personal preference would be a new, it makes the return type clearer.
Typescript allows for changing return type of overloaded function, so when { sync: true }
option is passed, the returned type is T
, not Promise<T>
. It is used to return Promise<T[]>
when array is passed as parameter.
But as the internals needs to be changes, it's better to create new function than overloading the overloaded method.
Just noticed you implemented it already. :+1: Any indicative release date?
Yes, it's not a breaking change so I will release it today in 0.3.1 😉 0.4.0 has to wait for transform/validate json array.
:+1:
Released in v0.4.0! 🎉
Would it be possible to add wrapping of synchronous validation ?