These are in a separate module so that they don't increase the size of Maybe since they might not be used
Clarify that Maybe converts null/undefined to 'no value'
MaybeAsync
Allow MaybeAsync.from to accept null/undefined values
Users won't need to guard against when integrating MaybeAsync into existing code
Add getValueOrDefault and getValueOrThrow to MaybeAsync
Utilities
Add noop utility method and expose it as public API
Can be used with match to pass a value through
Notes
I tested updating Jest to Jest 29 broke it the custom assertions/matchers used by this library. I investigated the issue for awhile but was unable to figure out the right combination of hacks. It seems like the ecosystem is full of outdated information and a simple solution still hasn't been figured out.
See: https://github.com/facebook/jest/issues/12267 and https://github.com/facebook/jest/issues/12424
For now I'm staying on the latest of Jest 28, which works fine.
Library
1.4.0
Docs
ResultAsync
andMaybeAsync
are still missing examplesREADME.md
README.md
Maybe
Maybe
utitlity factory functions:zeroAsNone
,emptyStringAsNone
,emptyOrWhiteSpaceStringAsNone
Maybe
since they might not be usedMaybe
convertsnull
/undefined
to 'no value'MaybeAsync
MaybeAsync.from
to acceptnull
/undefined
valuesMaybeAsync
into existing codegetValueOrDefault
andgetValueOrThrow
toMaybeAsync
Utilities
noop
utility method and expose it as public APImatch
to pass a value throughNotes
I tested updating Jest to Jest 29 broke it the custom assertions/matchers used by this library. I investigated the issue for awhile but was unable to figure out the right combination of hacks. It seems like the ecosystem is full of outdated information and a simple solution still hasn't been figured out. See: https://github.com/facebook/jest/issues/12267 and https://github.com/facebook/jest/issues/12424
For now I'm staying on the latest of Jest 28, which works fine.