We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 07e2379 commit 79d9a13Copy full SHA for 79d9a13
src/transforms/v2-to-v3/apis/renameErrorCodeWithName.ts
@@ -5,7 +5,6 @@ import type {
5
Collection,
6
FunctionExpression,
7
JSCodeshift,
8
- TryStatement,
9
} from "jscodeshift";
10
11
import type { ClientIdentifier } from "../types";
@@ -59,7 +58,7 @@ export const renameErrorCodeWithName = (
59
58
60
// Replace error.code with error.name in try-catch clauses.
61
callExpressions.forEach((callExpression) => {
62
- const tryStatement = j(callExpression).closest(j.TryStatement).nodes()[0] as TryStatement;
+ const tryStatement = j(callExpression).closest(j.TryStatement).nodes()[0];
63
64
if (!tryStatement || !tryStatement.handler) {
65
return;
0 commit comments