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 99db636 commit d61a14bCopy full SHA for d61a14b
src/transforms/v2-to-v3/apis/getS3SignedUrlApiNames.ts
@@ -1,4 +1,4 @@
1
-import type { Collection, JSCodeshift, Literal } from "jscodeshift";
+import type { Collection, JSCodeshift } from "jscodeshift";
2
3
import type { ClientIdentifier } from "../types";
4
@@ -20,7 +20,14 @@ export const getS3SignedUrlApiNames = (
20
},
21
})
22
.forEach((callExpression) => {
23
- apiNames.add((callExpression.value.arguments[0] as Literal).value as string);
+ const callExpressionArg = callExpression.value.arguments[0];
24
+ if (callExpressionArg.type !== "Literal" && callExpressionArg.type !== "StringLiteral") {
25
+ return;
26
+ }
27
+ if (typeof callExpressionArg.value !== "string") {
28
29
30
+ apiNames.add(callExpressionArg.value);
31
});
32
}
33
0 commit comments