-
-
Notifications
You must be signed in to change notification settings - Fork 821
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
…874) * fix: `BaseError@walk` to return `null` when predicate fn not matches * Update young-spiders-taste.md --------- Co-authored-by: jxom <[email protected]>
- Loading branch information
Showing
3 changed files
with
18 additions
and
2 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,5 @@ | ||
--- | ||
"viem": patch | ||
--- | ||
|
||
Fixed `BaseError.walk` to return `null` if the predicate callback is not satisfied. |
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 |
---|---|---|
|
@@ -153,3 +153,13 @@ test('walk: predicate fn', () => { | |
Version: [email protected]] | ||
`) | ||
}) | ||
|
||
test('walk: predicate fn (no match)', () => { | ||
class FooError extends BaseError {} | ||
class BarError extends BaseError {} | ||
|
||
const err = new BaseError('test1', { | ||
cause: new Error('test2', { cause: new BarError('test3') }), | ||
}) | ||
expect(err.walk((err) => err instanceof FooError)).toBeNull() | ||
}) |
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
a9bc9f6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
viem – ./
viem-git-main-wagmi-dev.vercel.app
viem-site.vercel.app
viem-wagmi-dev.vercel.app
viem.vercel.app
viem.sh
www.viem.sh