Closed
Description
If the first function in R.pipeP
doesn't return a Promise, it fails during execution, but the typings allow it.
e.g. the declared type :
declare function $<R1, R2>(fn1: () => PromiseLike<R1> | R1, fn2: (v: R1) => PromiseLike<R2> | R2): () => PromiseLike<R2>;
should be :
declare function $<R1, R2>(fn1: () => PromiseLike<R1>, fn2: (v: R1) => PromiseLike<R2> | R2): () => PromiseLike<R2>;
Alternatively, since the function signature in the doc is :
((a → Promise b), (b → Promise c), …, (y → Promise z)) → (a → Promise z)
even though the implementation allows functions that return simple values, maybe the typings should enforce Promises for every function? WDYT?