Pipe required before narrow
Results in error:
However, adding
pipe before calling narrow works:Is this intentional?
error TS2345: Argument of type 'is<MoreThanLength<50> & LessThanLength<200>>' is not assignable to parameter of type 'string'.pipenarrowconst myFunc = (v: string) => true;
const MyString = type("50<string<200").narrow((s) => myFunc(s));const myFunc = (v: string) => true;
const MyString = type("50<string<200").pipe((s) => s).narrow((s) => myFunc(s));