-
Renamed
unwrapErrors
tounwrapErrs
,unwrapAndThrowErrors
tothrowErrs
, andunwrapResults
tounwrapOks
. Despite the suggestion inherent in the name, anErr
is not necessarily an error, and they not related to theError
exception class. The old names are deprecated and will be removed for 1.0.The implementation for the old and new names is identical (they are documented alias constants).
-
Improved the typings of
unwrapErrs
andunwrapOks
so that it is clear that both the input and output arrays may contain heterogeneous types. This involved the use of some explicitany
typing, but testing in the Typescript playground suggests that the internal utility typesInferErr
andInferOk
cause Typescript to properly resolve disparate types. -
Ensured that
new Result()
throws an exception; the only way to instantiate aResult
is throughOk
orErr
, which construct internal (non-exported)OkResult
andErrResult
classes.- Unbound methods from
Result.prototype
throw better exceptions when rebound.
- Unbound methods from
-
Deprecated
Result#isOkAnd
andResult#isErrAnd
in favour ofResult#isOk
andResult#isErr
with an optional predicate. -
Deprecated
Result#mapOrElse
in favour ofResult#mapOr
where the provided default can either be a value or a function that returns a value. -
Deprecated
Result#unwrapOrElse
in favour ofResult#unwrapOr
where the provided default can either be a value or a function that returns a value. -
Improved documentation.
-
Fixed GitHub pages deploy: This has been adapted from the "Jekyll" workflow that GitHub proposes.
- Initial release. The APIs are heavily based on the Rust interface, but it does not feel entirely correct for JavaScript / Typescript APIs. Until the final shape of the APIs have been resolved, this is considered a pre-release version.