Releases: janglad/safe-fn
Releases · janglad/safe-fn
safe-fn-react@0.2.0
safe-fn@0.2.1
Patch Changes
-
172faf3: Temporary fix for #15. By default errors are now not passed along but logged.
-
382bb1a: ## Changes
- Type
unparsedInput
asnever
when there is no input
Fixes
- Fix bug when typing merged unparsed inputs where one is unknown
- Fix bug when typing merged parsed input when one schema is not defined
- Prettify user facing types where needed (and missing before)
- Fix bug in Generator typing when no error is yielded
- Fix bug where transformed errors from
action()
were not correctly typed
- Type
-
3194b4a: Add callbacks (onError, onStart, onComplete, onSuccess)
-
2bcb820: - Fix bad inference when not yielding an error in an async generator
safeHandler
-
c8f8132: - Add InferActionErrError and InferActionOkData types
- Add InferAsyncOkData and InferAsyncErrError types
- Rename some types for clarity
- Improve type docs
-
f55152a: Fix errors not being typed when coming from parent
Fix parse errors not being typed correct when parent has them -
cf9893e: IDK a lot lol. Nobody reads this anyway.
safe-fn-react@0.1.3
Patch Changes
- ef41088: Return ResultAsync instead of Promise from hook
- cf9893e: IDK a lot lol. Nobody reads this anyway.
- Updated dependencies [172faf3]
- Updated dependencies [382bb1a]
- Updated dependencies [3194b4a]
- Updated dependencies [2bcb820]
- Updated dependencies [c8f8132]
- Updated dependencies [f55152a]
- Updated dependencies [cf9893e]
- safe-fn@0.2.1
safe-fn@0.2.0
Minor Changes
- 9b6b0d0: Implements
safeHandler
, a function that takes in an async generator similar to Neverthrow's ownsafeTry
enabling an ergonomic way to deal with return early upon error.
safe-fn@0.1.3
Patch Changes
-
7b2cb2b: Fix #7 where
UnparsedInput
type if not properly merged. -
92bb8e5: Features
- Implement NeverThrow instead of own Result type
- Add separate typing for running as a server action, in which case Zod errors are stripped from stack traces etc.
- move Zod to peer dependency
-
687640d: Clean up internal workings
- set up Knip
- Move safe-fn to separate builder and runnable classes
- clean up types
safe-fn-react@0.1.2
Patch Changes
- Updated dependencies [9b6b0d0]
- safe-fn@0.2.0
safe-fn-react@0.1.1
safe-fn@0.1.2
Patch Changes
- 3572d25: - Add new types to infer result, ok/err data from action
- Fix bug in not exporting
ok()
/err()
properly - Add
createAction()
and addAnyCompleteSafeFn
to easily use as server action - Add types for inferring result and argument for completeSafeFns
- Fix
Result
type union by typingdata
andcause
asundefined
instead ofnever
- Don't catch framework errors (currently only filtering Next
redirect()
andnotFound()
)
- Fix bug in not exporting
safe-fn-react@0.1.0
safe-fn@0.1.1
Patch Changes
- 2b72e15: Renames
Ok()
andErr()
took()
anderr()
to avoid overlap with types. Exportsok()
,err()
,Ok
,Err
,Result
to be available to users.