Skip to content

Releases: everweij/typescript-result

v1.2.0

02 Sep 12:13

Choose a tag to compare

  • Result.safe() now accepts a error-class as parameter:
class CustomError() {}
const result = Result.safe(CustomError, () => 2 * 2);
  • Result.safe() now accepts a callback which returns another Result an will merge both Results:
class CustomError() {}
function doStuff(): Result<CustomError, number> {}
const result = Result.safe(() => doStuff()); // Result<Error | CustomError, number>
  • Result#map() now accepts a callback that returns another result (flat-map) or a callback that transforms the value directly:
function doStuff(): Result<CustomError, number> {}

const result = doStuff().map(num => num * 2); // Result<Error | CustomError, number>

v1.1.0

01 Sep 10:15

Choose a tag to compare

Added Result.forward()

v1.0.0

22 Aug 16:34

Choose a tag to compare

Initial release!

v0.1.0

22 Aug 16:02

Choose a tag to compare

This is the initial release!