-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
result 0.6: First deprecations and renames
- Renamed `unwrapErrors` to `unwrapErrs`, `unwrapAndThrowErrors` to `throwErrs`, and `unwrapResults` to `unwrapOks`. Despite the suggestion inherent in the name, an `Err` is not _necessarily_ an error, and they not related to the `Error` 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` and `unwrapOks` so that it is clear that both the input and output arrays may contain heterogeneous types. This involved the use of some explicit `any` typing, but testing in the Typescript playground suggests that the internal utility types `InferErr` and `InferOk` cause Typescript to properly resolve disparate types. - Ensured that `new Result()` throws an exception; the only way to instantiate a `Result` is through `Ok` or `Err`, which construct internal (non-exported) `OkResult` and `ErrResult` classes. - Unbound methods from `Result.prototype` throw better exceptions when rebound. - Deprecated `Result#isOkAnd` and `Result#isErrAnd` in favour of `Result#isOk` and `Result#isErr` with an optional predicate. - Deprecated `Result#mapOrElse` in favour of `Result#mapOr` where the provided default can either be a value or a function that returns a value. - Deprecated `Result#unwrapOrElse` in favour of `Result#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.
- Loading branch information
1 parent
a1c77a2
commit bc33dc3
Showing
9 changed files
with
800 additions
and
316 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# EditorConfig is awesome: http://EditorConfig.org | ||
|
||
# top-most EditorConfig file | ||
root = true | ||
|
||
# all files | ||
[*] | ||
indent_style = space | ||
indent_size = 2 | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
max_line_length = 90 | ||
|
||
[*.{md,.markdown}] | ||
trim_trailing_whitespace = false | ||
max_line_length = 78 | ||
|
||
[node_modules/**] | ||
ignore = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.