Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: delete deprecated fns and methods #7

Merged
merged 2 commits into from
Aug 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 6 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -454,10 +454,9 @@ Calls the provided closure with a reference to the contained value if `Ok`.
Examples:

```ts
import { resultify } from 'rustlike-result';
import { resultifySync } from 'rustlike-result';

const num = resultify
.sync<SyntaxError>()(JSON.parse)('4')
const num = resultifySync<SyntaxError>()(JSON.parse)('4')
.inspect((value: number) => console.log(`original: ${value}`))
.map((value) => value ** 3)
.expect('failed to parse number');
Expand All @@ -471,10 +470,9 @@ Calls the provided closure with a reference to the contained value if `Err`.
Examples:

```ts
import { resultify } from 'rustlike-result';
import { resultifySync } from 'rustlike-result';

const num = resultify
.sync<SyntaxError>()(JSON.parse)('asdf')
const num = resultifySync<SyntaxError>()(JSON.parse)('asdf')
.inspectErr((err) => console.log(`failed to parse json string: ${err.message}`));
assert(num.err() instanceof SyntaxError);
```
Expand Down Expand Up @@ -660,12 +658,10 @@ This function can be used for control flow based on `Result` values.
Examples:

```ts
import { Err, Ok } from 'rustlike-result';
import { Err, Ok, resultifySync } from 'rustlike-result';

const parseJSON = (json: string) =>
resultify
.sync<SyntaxError>()(JSON.parse)(json)
.mapErr((err) => err.message);
resultifySync<SyntaxError>()(JSON.parse)(json).mapErr((err) => err.message);

assert(Ok<string, string>('2').andThen(parseJSON).equal(Ok(2)));
assert(
Expand Down
Loading