Releases: might-fail/ts
Releases · might-fail/ts
0.7.3
0.7.0
2024-10-27
Changed
- The either type now accepts type without promise and returns the awaited type.
0.6.3
Added
build.ts
to build the project with esbuild
Changed
- the build process for npm uses a build.ts file to build the project with esbuild. This gives esm js files the .js extension which is needed for some environments.
[0.6.1] - 2024-10-6
[0.6.1] - 2024-10-6
Added
Might
andFail
functions- new docs page in the readme
Changed
mightFail
andmightFailSync
now return an object tuple so you can destructure it as an object or a tuple, your choice.- removed the
/tuple
folder since the normalmight-fail
import will work the same.
0.5.0
[0.5.0] - 2024-10-2
Added
mightFail.any
supportmightFail.race
supportmightFail.all
supportmightFail.allSettled
support
[0.4.0] - 2024-09-29
Added
/go
folder for a Go-style tuple implementation.const [result, error] = mightFail(promise)
/tuple
folder for a tuple implementation.const [error, result] = mightFail(promise)
Changed
- If a function throws a string, the string will be the message of the new Error object.
- If a function throws an object with a message property, the message will be the message of the new Error object.
- If a function throws an object it will be passed to the Error object constructor as is.
0.3.0
Added
- Support for synchronous error handling with
mightFailSync
andmakeMightFailSync
functions. - A new
publish
script inpackage.json
to streamline the build and publish process.
Changed
- The library now officially supports both async and sync error handling. This change is reflected in the README to emphasize the library's versatility in handling errors in different contexts.
- Updated
Either.ts
to streamline the type definition for a more straightforward implementation.