A library for safer and smarter error- and "nothing"-handling in TypeScript.
transposeArray
(@chriskrycho)exports
map (@chriskrycho)There is only one actual breaking change since 6.x: dropping support for Node versions earlier than Node 18 LTS. (While that is a small breaking change, around here we like taking care of technical details and SemVer.)
The main benefit here is adding back support for CJS consumption—though it still requires using a recent TS version with support for exports
maps and using an appropriate module resolution mode. (We may be able to add support for more "classic" module resolution modes later, as a non-breaking change, with this in place—but make no guarantees!)
Ok.cast()
and Err.cast()
methods (@chriskrycho)Toolbelt
from root for consumers not using TS 4.7’s exports
support (@chriskrycho)There are two significant breaking changes in v6.0:
exports
syntax without hacks.Result
or Maybe
classes meant you also pulled in the other, since they had code to interoperate with each other. These now live only in the toolbelt
module, along with the Array
helpers.To upgrade:
Update your project to at least Node 14 and TypeScript 4.7.
Switch from using any deprecated code to the supported replacements (as described in the docs for each deprecated function).
Set compilerOptions.module
to Node16
or nodenext
in your tsconfig.json
. Note: this is the most significant breaking change here: it requires that every other TS package you consume also be compatible with the new mode, and if you are using True Myth in a library, cascades that requirement to your consumers as well.
Update to True Myth v6. :tada:
toString
handling (forward-port from v5) (@chriskrycho)true-myth/toolbelt
module for better tree shaking (@chriskrycho)package.json
to actual current (@chriskrycho)preversion
npm script (@chriskrycho)exports
definitions for types (@chriskrycho)Omit
rather than Exclude
+ keyof
in Maybe (@chriskrycho)Omit
rather than Exclude
+ keyof
in Maybe (@chriskrycho)This is the final release for v5.x, and only exists to make sure there are fully overlapping supported TypeScript versions for True Myth v5 and v6. See the release notes for the upcoming v6.0 release for upgrade notes.
preversion
npm script (@chriskrycho)Omit
rather than Exclude
+ keyof
in Maybe (@chriskrycho)