schema icon indicating copy to clipboard operation
schema copied to clipboard

pipe behavior is different than described in docs

Open darkowic opened this issue 3 years ago • 2 comments

Hi ;)

pipe schema validation is executed in reversed order than expected.

const schema = pipe(string, minStringLength(10));

First minStringLength will be validated instead of string and if you try to validate e.g. undefined the type error will be thrown. See https://codesandbox.io/s/adoring-galileo-76vtn?file=/src/index.ts

darkowic avatar Mar 27 '21 19:03 darkowic

How should it work in your opinion @mmiszy ?

darkowic avatar May 03 '21 11:05 darkowic

Not sure yet ;)

typeofweb avatar May 05 '21 23:05 typeofweb