v5.0.0
5.0.0 (2025-04-07)
Features
now enforces support for typescript's --erasableSyntaxOnly flag (60f2431)
converted all enums to objects (1cffb1e)
BREAKING CHANGE: Dropped all enums. This is to be compatible with typescript's
new erasableSyntaxOnly option.
To convert an existing enum, you need to create an object, ENUM = { ... } as const then also create an enum type ENUM_TYPE = EnumLike<typeof ENUM> for
where the enum was used as a type. And all keys must now be accessed like
typeof ENUM.KEY.
Added EnumLike type util to help with migration.
removed Result namespace (89bf255)
BREAKING CHANGE: Dropped Result namespace usage. This is to be compatible with
typescript's new erasableSyntaxOnly option. It also makes the package
completely tree-shakeable now.
While this is a breaking change, it should pretty much work out of the box if
you're importing the parts of the namespace individually. Just change the
Result import to a type import (type Result).
If you're doing Result.Ok/Err, etc, change the import to import * as Result ....
Then you'll need to change any references to Result to Result.Result or the
more sensible Result.Type alias.
made Result slightly more flexible (cad2e0d)
Now checking for result.error or result.data won't give a type error.
added unwrapOr to Result monad (96ce84e)
added jsonSafeParse (JSON.parse wrapped in Result) (f2712e8)
added ceil/floor options to snapNumber (1ee02fb)
Bug Fixes
fix throttle type to match debounce (a2b589a)
BREAKING CHANGES
- Dropped all enums. This is to be compatible with typescript's
newerasableSyntaxOnlyoption.
To convert an existing enum, you need to create an object, ENUM = { ... } as const then also create an enum type ENUM_TYPE = EnumLike<typeof ENUM> for
where the enum was used as a type. And all keys must now be accessed like
typeof ENUM.KEY.
Added EnumLike type util to help with migration.
- Dropped Result namespace usage. This is to be compatible with
typescript's newerasableSyntaxOnlyoption. It also makes the package
completely tree-shakeable now.
While this is a breaking change, it should pretty much work out of the box if
you're importing the parts of the namespace individually. Just change the
Result import to a type import (type Result).
If you're doing Result.Ok/Err, etc, change the import to import * as Result ....
Then you'll need to change any references to Result to Result.Result or the
more sensible Result.Type alias.