3 ms·
In JS/TS with this package[0] const firstSuccessfulOptionValue = fnReturnsOption .orElse(fn2ReturnsOption()) .orElse(fn3ReturnsOption())
by bern4444 5y ago
In JS/TS with this package[0]
const firstSuccessfulOptionValue = fnReturnsOption
.orElse(fn2ReturnsOption())
.orElse(fn3ReturnsOption())
.orElse(fn4ReturnsOption())
.getOrElse("val");
[0]https://github.com/sbernheim4/excoptional/blob/main/src/index.ts#L108-L127 https://github.com/sbernheim4/excoptional/blob/main/src/inde...