fix(deps): ⬆️ Upgrade dependency option-t to v51 #448
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
39.0.3
->51.0.0
Release Notes
option-t/option-t (option-t)
v51.0.0
Compare Source
Breaking Changes
Internals
v50.0.2
Compare Source
Documentations
try!
like control flow sugar utility to README. #2415Internals
always-auth
from .npmrc. #2422v50.0.1
Compare Source
Notable Changes
Update TypeScript to 5.7 #2412
According to the release blog, we would be able to update TypeScript without the breaking change release of ourselves.
Internals
Documentation
v50.0.0
Compare Source
Breaking Changes
Move public APIs that do unsafe operations into
unsafe/
subdirs. #2378For almost users, this change might not relate.
We provide some unsafe operations for a long time that allow to mutate a value for performance issue or disposing a contained value.
But they are foundamentally unsafe. As a not recommendation to use, we rename some items.
Path
option-t/plain_option/as_mut
option-t/plain_option/unsafe/as_mut
option-t/plain_option/drop
option-t/plain_option/unsafe/drop
option-t/plain_result/as_mut
option-t/plain_result/unsafe/as_mut
option-t/plain_result/drop
option-t/plain_result/unsafe/drop
Exposed Items
option-t/plain_option/unsafe/as_mut
asMutOption
unsafeAsMutOption
option-t/plain_result/unsafe/as_mut
asMutResult
unsafeAsMutResult
Announcement
Please use public operators instead of touching fields directly on
Result<T, E>
We consider and experiment to overhaul the object shape of
Result<T, E>
for plain_result in #2244.This is not concluded decision, but might happens in near future.
For the safety of future breaking changes,
Result<T, E>
.For simple usecases
Bad
Nice
For library authors that returns a value generated by this library
We recommend to provide some basic operators (
isOk
,unwrapOk
,unwrapErr
) as a part of your library, or installing this package as a peer dependencies to avoid to touch fields directly from your library user.v49.3.0
Compare Source
New Features
Support
module-sync
export condition. #2382, #2381We support
module-sync
export condition that is introduced in Node.js v23.0.Previously, the following code would throw some assertion errors because the backed actual implementation file is different between
require()
(cjs) andimport()
(mjs). This is not a problematic for our package due to we don't share an internal state as like illustrate as dual package hazard problem. In some cases, however, some module graphs could take both of esm and cjs variants of same our API. It sometimes increases a final bundled code or require to set multiple breakpoints on debugging.By this change, the above example code would be fine without any assertion errors if your runtime or module bundler supports this condition. For supported environment, it would always only a esm backed implementation.
Internals
import/order
. #2373v49.2.1
Compare Source
Documentation
Internals
New Contributors
v49.2.0
Compare Source
Notable Changes
Update TypeScript to 5.6 #2354
According to the release blog, we would be able to update TypeScript without the breaking change release of ourselves.
Internals
--isolatedDeclarations
. #2327v49.1.0
Compare Source
Notable Changes
Update TypeScript to 5.5 #2324
According to the release blog, we would be able to update TypeScript without the breaking change release of ourselves.
Internals
v49.0.1
Compare Source
Internals
tryCatchIntoResultWithEnsureError()
. #2320v49.0.0
Compare Source
Breaking Changes
Summary
option-t/plain_result/unwrap_or_throw_error
option-t/plain_result/unwrap_or_throw_unknown
option-t/plain_result/experimental/try_catch
option-t/plain_result/experimental/try_catch_async
option-t/plain_result
,option-t/plain_result/try_catch
tryCatchIntoResultWithEnsureError
option-t/plain_result
,option-t/plain_result/try_catch_async
tryCatchIntoResultWithEnsureErrorAsync
option-t/plain_result/namespace
Result.unwrapOrThrowWithEnsureError
option-t/plain_result/namespace
Result.unwrapOrThrowWithEnsureErrorAsync
Details
Move
option-t/plain_result/unwrap_or_throw_error
&option-t/plain_result/unwrap_or_throw_unknown
tooption-t/plain_result/deprecated/
#2313They were deprecated paths.
Please rewrite their import path or migrate to use
option-t/plain_result/unwrap_or_throw
.Remove deprecated items from
option-t/plain_result
andoption-t/plain_result/namespace
. #2310These items are removed.
option-t/plain_result
unwrapOrThrowWithEnsureErrorForResult()
: Replace withunwrapOrThrowWithAssertErrorForResult()
fromoption-t/plain_result/deprecated/unwrap_or_throw_error
instead.option-t/plain_result/namespace
Result.unwrapOrThrowWithEnsureError()
: Replace withunwrapOrThrowWithAssertErrorForResult()
fromoption-t/plain_result/deprecated/unwrap_or_throw_error
instead.tryCatchIntoResultWithEnsureError()
does not throwTypeError
if the passed producer function throws nonError
instance of the current realm. #2307 #2311 #2317This is behavior change.
Previously, their operators throw an error if throw
TypeError
if the passed producer function throws a value that is not anError
instance of current realm. Even if the thrown value isError
instance of cross-realm (e.g.node:vm
or iframe), their operators throws as "not anError
object". It was tricky and strange behavior.Now, we wrap it with a new
Error
instance of current realm with setting a value that is not anError
instance of current realm to.cause
property of that newError
instance. For almost use case, we think this is not a problematic. But this might change a error telemetry or its stack trace in your observability tools. If would like to use a previous behavior, please use followings:tryCatchIntoResultWithAssertError()
fromoption-t/plain_result/deprecated/try_catch_with_assert_error
tryCatchIntoResultWithAssertErrorAsync()
fromoption-t/plain_result/deprecated/try_catch_with_assert_error_async
Please see #2286 to know why we do this change.
Experimental Features
End of
option-t/plain_result/experimental/try_catch
&option-t/plain_result/experimental/try_catch_async
#2312They become new implementations for
tryCatchIntoResultWithEnsureError
fromoption-t/plain_result/try_catch
(option-t/plain_result/try_catch_async
) now. Please use them.Documentation
tryCatchIntoResultWithEnsureError
impls. #2315v48.2.1
Compare Source
Documentation
Internals
v48.2.0
Compare Source
New Features
Add variants of
tryCatchIntoResult
that wrapping automatically a thrown something with current realm'sError
if it is not anError
instance of current realm. #2287Documentation
tryCatchIntoWithEnsureError
&unwrapOrThrowWithEnsureError
when they meet a cross-relamError
instance. #2289docs/
in the published package. #2273plain_result/unwrap_or_throw_error
&plain_result/unwrap_or_throw_unknown
as deprecated in docs/public_api_list.md. #2299Internals
Error
instance totryCatchIntoWithEnsureError
&unwrapOrThrowWithEnsureError
. #2289v48.1.0
Compare Source
New Features
unwrapOrThrowForResult
fromplain_result
. #2280Result.unwrapOrThrow
fromoption-t/plain_result/namespace
. #2280New Deprecations #2280
unwrapOrThrowWithEnsureErrorForResult()
exported fromoption-t/plain_result
.option-t/plain_result/unwrap_or_throw_error
.option-t/plain_result/namespace
asunwrapOrThrowWithEnsureError()
.unwrapOrThrowUnknownDirectlyForResult()
exported fromoption-t/plain_result/unwrap_or_throw_unknown
.Their operator rethrow directly the
Error
contained in a passed result object. However, by rethrowing, its stack trace information lacks the information about where throws it actually. Instead, we recommend to useunwrapOrThrowForResult
.Internals
CausalCarrierError
into the dedicated file. #2278v48.0.1
Compare Source
v48.0.0 is missing number due to our release accident.
Breaking Changes
CausalCarrierError.name
to'CausalCarrierError'
. #2274unwrapOrThrowUnknownDirectlyForResult()
from./plain_result
. #2275Result.unwrapOrThrowUnknownDirectly()
fromoption-t/plain_result/namespace
is also affected.option-t/plain_result/unwrap_or_throw_unknown
instead.v48.0.0
Compare Source
v47.0.0
Compare Source
Breaking Changes
Remove deprecated
unwrapOrThrowErrorForResult
&unwrapOrThrowErrorWithAssertForResult
. #2269See /docs/migration/v47.md to migrate your code.
Infrastructure
Documentation
v46.3.0
Compare Source
New Feature
unwrapOrThrow()
forPlainResult
. #2262v46.2.0
Compare Source
New Features
unwrapOrThrowWithEnsureErrorForResult()
foroption-t/plain_result
. #2264New Deprecation
unwrapOrThrowErrorWithAssertForResult()
foroption-t/plain_result
. #2264unwrapOrThrowWithEnsureErrorForResult
instead.v46.1.0
Compare Source
New Features
unwrapOrThrowUnknownDirectlyForResult()
foroption-t/plain_result
. #2261New Deprecation
unwrapOrThrowErrorForResult()
foroption-t/plain_result
. #2259unwrapOrThrowErrorWithAssertForResult
instead.Internals
v46.0.0
Compare Source
Breaking Changes
Remove PascalCase style path #2251
They has been deprecated in v45.2.0.
Please see the release note to migrate your projects.
Documentation
v45.3.0
Compare Source
New Features
unwrapOrThrowError
fromplain_result
orplain_result/namespace
. #2253Internals
Documentation
unwrapOrThrowErrorForResult()
. #2254v45.2.0
Compare Source
New Deprecations
Deprecate old PascalCase style API paths #2242
The motivation is here (#1594).
We plan to remove the old PascalCase style path in the next major release. To migrate your code, please try to use the following codemod.
Codemod
Please run the following script by
npx jscodeshift --transform <codemod_script>.mjs <target_dir> --parser ts
.Documentations.
Internals
v45.1.0
Compare Source
New Feature
Experimental
These are still under experimental and unstable. We might change this path and exposed items from here without any breaking change.
Documentation
v45.0.0
Compare Source
Breaking Changes
Make types both
Err.val
&Ok.err
tonull
. #2205This breaking change does not affect for plain JavaScript code.
This change only affects TypeScript user code.
For this library side, this fixes the long standing issue about mismatching between actual value and types.
For user side, typescript compiler causes a compile error in the place passing a value generated from different version of option-t (~v44) to the current one (v45).
Migration Path
case 1. Update all option-t dependencies (best)
case 2. Use package manager's package alias feature to make a compat bridge them.
E.g.
npm install option-t44@​npm:option-t@^44
pnpm add option-t44@​npm:option-t@^44
Use ES2020 as our ESM format. #2239
Please update your toolchains (including module bundler) to latest version that supports ES2020 syntax.
v44.0.0
Compare Source
Breaking Changes
Export
<TypeName>
namespace module object only from<TypeName>/namespace
. #2235Please migrate your code as following:
Internals
./PlainOption/namespace
. #2234export * as ns
syntax. #2236Type
from<TypeName>/namespace
. #2233Add why we don't export self type asType
from<TypeName>/namespace
. #2233v43.2.1
Compare Source
Bug Fix
Experiments
./Nullable/ns
should export items asNullable
. #2229Internals
v43.2.0
Compare Source
New Features
Experiments
These are still under experimental and unstable. We might change this path and exposed items from here without any breaking change.
Result.ok()
&Result.err()
fromPlainOption/ns
. #2227./{Maybe, Nullable, Undefinable}/ns
as experimental API`. #2227v43.1.0
Compare Source
New Features
./PlainResult/experimental_ns
. #2225v43.0.1
Compare Source
Internals
Documentation
PlainResult.{Ok, Err}
for your types. #2213v43.0.0
Compare Source
Breaking Changes
Remove deprecated classic aliases for
ClassOption
&ClassResult
. #2201Some deprecated items has been removed from
option-t/ClassicOption
andoption-t/ClassResult
.For years ago, we added them in
dfac180
(v33.9) with the announcement that we plan to remove them in v34 or later.Internals
v42.1.0
Compare Source
New Features
isOkAnd()
/isErrAnd()
forPlainResult
. #1804, #2199Internals
sort-keys
forpackages/api_tests/__tests__/exposed_path/
. #2200, #2203Nullable
,Maybe
, andUndefinable
.#2196v42.0.1
Compare Source
What's Changed
26d59e0
. #2195v42.0.0
Compare Source
Breaking Changes
Remove deprecated
unwrapOrThrowErrorFromResult
. #2191unwrapOrThrowErrorFromResult
inoption-t/PlainResult/unwrapOrThrowError
has been deprecated in v41.2.0 by the same reason with #2188.Please use
unwrapOrThrowErrorForResult
provided byoption-t/PlainResult/unwrapOrThrowError
instead.Unship filter from
option-t/{Maybe, Nullable, Undefinable}
andoption-t/{Maybe, Nullable, Undefinable}/namespace
. #2192We introduced them in v41.1.0 but it was too early decision.
We unship them from
option-t/{Maybe, Nullable, Undefinable}
andoption-t/{Maybe, Nullable, Undefinable}/namespace
.If you would like to use them, please use
option-t/<TypeName>/{filter, filterAsync}
.v41.2.1
Compare Source
Fix Regressions
26d59e0
. #2194v41.2.0
Compare Source
New Deprecations
unwrapOrThrowErrorFromResult
in./PlainResult/unwrapOrThrowError
. #2189v41.1.0
Compare Source
New Features
Nullable<T>
,Maybe<T>
, andUndefinable<T>
. #2179, #2180, #2182, #2183, #2184Documentation
option-t/<TypeName>/namespace
. #2172option-t/*/namespace
. #2174Internals
v41.0.0
Compare Source
Breaking Changes
This version removed bunch of deprecated items.
See more details https://github.com/option-t/option-t/blob/main/docs/migration/v41.md
NotNullAndUndefined
/isNotNullAndUndefined
in./Maybe/Maybe
. #2164./<TypeName>/expect
&./<TypeName>/unwrap
. #2165unwrapOrFrom***
/unwrapOrElseFrom***
/unwrapOrElseAsyncFrom***
. #2167./PlainResult/toOption
. #2158./PlainResult/transpose
. #2159inspectOk
/inspectErr
/inspectBoth
. #2160Documentation
6424d95
: Remove comments about./PlainResult/toOption
. #2169v40.7.0
Compare Source
Deprecation
Use
For
instead ofOf
preposition to types for./PlainResult/inspect
. #2161option-t/PlainResult
inspectBothOfResult
: UseinspectBothForResult
instead.inspectErrOfResult
: UseinspectErrForResult
instead.inspectOkForResult
: UseinspectOkForResult
instead.option-t/PlainResult/inspect
inspectBothOfResult
: UseinspectBothForResult
instead.inspectErrOfResult
: UseinspectErrForResult
instead.inspectOkForResult
: UseinspectOkForResult
instead.Internals
Documentation
v40.6.1
Compare Source
Documentation
@deprecated
tag added recently. #2154v40.6.0
Compare Source
New Deprecation
Use
For
instead ofFrom
preposition to types for unwrapOr/unwrapOrElse/unwrapOrElseAsync. #2151It was a long standing issue since
2d77cf8
....By this change, we use
From
preposition only if an item is designed to type conversion. It simplifies the naming rule and improves naming consistency with mapOr, mapOrElse, or others.NOTE: We filed #2152 to clean up this deprecation
Followings are deprecated items:
PlainOption
unwrapOrFromOption
exported byoption-t/PlainOption/unwrapOr
oroption-t/PlainOption
.unwrapOrForOption
instead.unwrapOrElseFromOption
exported byoption-t/PlainOption/unwrapOrElse
oroption-t/PlainOption
.unwrapOrElseForOption
instead.unwrapOrElseAsyncFromOption
exported byoption-t/PlainOption/unwrapOrElseAsync
oroption-t/PlainOption
.unwrapOrElseAsyncForOption
instead.PlainResult
unwrapOrFromResult
exported byoption-t/PlainResult/unwrapOr
oroption-t/PlainResult
.unwrapOrForResult
instead.unwrapOrElseFromResult
exported byoption-t/PlainResult/unwrapOrElse
oroption-t/PlainResult
.unwrapOrElseForResult
instead.unwrapOrElseAsyncFromResult
exported byoption-t/PlainResult/unwrapOrElseAsync
oroption-t/PlainResult
.unwrapOrElseAsyncForResult
instead.Maybe
unwrapOrFromMaybe
exported byoption-t/Maybe/unwrapOr
oroption-t/Maybe
.unwrapOrForMaybe
instead.unwrapOrElseFromMaybe
exported byoption-t/Maybe/unwrapOrElse
oroption-t/Maybe
.unwrapOrElseForMaybe
instead.unwrapOrElseAsyncFromMaybe
exported byoption-t/Maybe/unwrapOrElseAsync
oroption-t/Maybe
.unwrapOrElseAsyncForMaybe
instead.Nullable
unwrapOrFromNullable
exported byoption-t/Nullable/unwrapOr
oroption-t/Nullable
.unwrapOrForNullable
instead.unwrapOrElseFromNullable
exported byoption-t/Nullable/unwrapOrElse
oroption-t/Nullable
.unwrapOrElseForNullable
instead.unwrapOrElseAsyncFromNullable
exported byoption-t/Nullable/unwrapOrElseAsync
oroption-t/Nullable
.unwrapOrElseAsyncForNullable
instead.Undefinable
unwrapOrFromUndefinable
exported byoption-t/Undefinable/unwrapOr
oroption-t/Undefinable
.unwrapOrForUndefinable
instead.unwrapOrElseFromUndefinable
exported byoption-t/Undefinable/unwrapOrElse
oroption-t/Undefinable
.unwrapOrElseForUndefinable
instead.unwrapOrElseAsyncFromUndefinable
exported byoption-t/Undefinable/unwrapOrElseAsync
oroption-t/Undefinable
.unwrapOrElseAsyncForUndefinable
instead.v40.5.1
Compare Source
Documentation
Internals
v40.5.0
Compare Source
New Deprecations
These items are deprecated.
in
option-t/PlainOption
#2143transposeForOption
transposeOptionToResult
in the same module instead.in
option-t/PlainOption/transpose
#2143transposeForOption
transposeOptionToResult
in the same module instead.in
option-t/PlainResult
#2143transposeNullableForResult
transposeResultToNullable
in the same module instead.transposeUndefinableForResult
in
option-t/PlainResult/namespace
#2143transposeNullable
transposeToNullable
in the same module instead.transposeUndefinable
transposeToUndefinable
in the same module instead.in
option-t/PlainResult/transpose
#2143transposeForResult
transposeResultToOption
inoption-t/PlainOption
oroption-t/PlainOption/transpose
.transposeNullableForResult
transposeResultToNullable
in the same module instead.transposeUndefinableForResult
transposeResultToUndefinable
in the same module instead.option-t/PlainResult/toOption
#2136toOptionFromOk
fromOkToOption
inoption-t/PlainOption/fromResult
instead.toOptionFromErr
fromErrToOption
inoption-t/PlainOption/fromResult
instead.v40.4.0
Compare Source
New Features
Export more items from
option-t/PlainResult
. #2137option-t/PlainResult
fromPromiseSettledResultToResult
tryCatchIntoResult
tryCatchIntoResultAsync
tryCatchIntoResultWithEnsureError
tryCatchIntoResultWithEnsureErrorAsync
Internals
./PlainResult/namespace
&./PlainResult
. #2138./PlainOption/namespace
&./PlainOption
. #2139v40.3.0
Compare Source
New Features
Export
toResult
fromoption-t/{Nullable, Maybe, Undefinable}
. #2133option-t/Nullable
toResultErrFromNullable()
toResultOkFromNullable()
option-t/Maybe
toResultErrFromMaybe()
toResultOkFromMaybe()
option-t/Undefinable
toResultErrFromUndefinable()
toResultOkFromUndefinable()
Internals
packages/option-t/src/*/index.ts
. #2132asMut()
operator from the each of root endpoint. #2134v40.2.0
Compare Source
New Features
option-t/Nullable
#2127okOrForNullable()
okOrElseForNullable()
okOrElseAsyncForNullable()
option-t/Maybe
#2128okOrForMaybe()
okOrElseForMaybe()
okOrElseAsyncForMaybe()
option-t/Undefinable
#2129okOrForUndefinable()
okOrElseForUndefinable()
okOrElseAsyncForUndefinable()
option-t/PlainOption
#2130okOrForPlainOption()
okOrElseForPlainOption()
v40.1.0
Compare Source
New Features
option-t/Nullable
#2124toUndefinableFromNullable()
option-t/Nullable/namespace
#2070toResultErr()
toResultOk()
option-t/Maybe
#2078toNullableFromMaybe()
toUndefinableFromMaybe()
option-t/Undefinable
. #2125toNullableFromUndefinable()
option-t/PlainResult
#2122toNullableFromErr()
toNullableFromOk()
toUndefinableFromErr()
toUndefinableFromOk()
option-t/PlainResult/namespace
#2069fromPromiseSettledResult()
tryCatchInto()
tryCatchIntoAsync()
tryCatchIntoWithEnsureError()
tryCatchIntoWithEnsureErrorAsync()
option-t/PlainOption
#2123toNullableFromOption()
toUndefinableFromOption()
option-t/PlainOption/namespace
#2053toNullable()
toUndefinable()
Internals
v40.0.0
Compare Source
Breaking Changes
We were burned out to maintain these legacy compats. This release remove them.
Drop legacy
option-t/cjs/*
. #2014Please replace
option-t/cjs/*
withoption-t/*
.Drop
option-t/esm/*
. #2017Please replace
option-t/esm/*
withoption-t/*
.Remove
option-t/**/compat/v33
. [#2021](https://redirect.github.com/optionConfiguration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.