ts-essentials icon indicating copy to clipboard operation
ts-essentials copied to clipboard

Add createFactoryWithConstrain function utility

Open Beraliv opened this issue 2 years ago • 0 comments

Add new function utility which is useful in tests:

const createFactoryWithConstrain =
    <Constrain>() =>
    <U extends Constrain>(value: U): U =>
        value;

Playground with use cases – tsplay.dev/Ndo6Yw

Beraliv avatar Jun 29 '22 09:06 Beraliv

Merged it to master branch

I will release it soon in https://github.com/ts-essentials/ts-essentials/pull/326

Beraliv avatar Aug 19 '22 11:08 Beraliv

Released in 9.3.0 ✅

Beraliv avatar Aug 23 '22 18:08 Beraliv