Skip to content
This repository has been archived by the owner on Jan 10, 2024. It is now read-only.

Commit

Permalink
idx: Fix Flow type error
Browse files Browse the repository at this point in the history
  • Loading branch information
yungsters committed Jun 28, 2023
1 parent 35e9ae7 commit 90f0743
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/idx/src/idx.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ function idx<Ti, Tv>(input: Ti, accessor: (input: Ti) => Tv): ?Tv {
return accessor(input);
} catch (error) {
if (error instanceof TypeError) {
if (nullPattern.test(error)) {
if (nullPattern.test(error.message)) {
return null;
} else if (undefinedPattern.test(error)) {
} else if (undefinedPattern.test(error.message)) {
return undefined;
}
}
Expand Down

0 comments on commit 90f0743

Please sign in to comment.