Skip to content

Commit 3aed785

Browse files
committed
chore: remove type assertion in getDynamoDBDocClientArgs
1 parent 2cbc06d commit 3aed785

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

src/transforms/v2-to-v3/client-instances/getDynamoDBDocClientArgs.ts

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import type { ASTPath, JSCodeshift, NewExpression, ObjectProperty, Property } from "jscodeshift";
2-
import { OBJECT_PROPERTY_TYPE_LIST } from "../config";
1+
import type { ASTPath, JSCodeshift, NewExpression } from "jscodeshift";
32
import { getDynamoDBForDocClient } from "./getDynamoDBForDocClient";
43

54
export const getDynamoDBDocClientArgs = (
@@ -16,11 +15,11 @@ export const getDynamoDBDocClientArgs = (
1615
const params = v2DocClientArgs[0];
1716
if (params.type === "ObjectExpression") {
1817
for (const property of params.properties) {
19-
if (!OBJECT_PROPERTY_TYPE_LIST.includes(property.type)) {
18+
if (property.type !== "Property" && property.type !== "ObjectProperty") {
2019
continue;
2120
}
2221

23-
const propertyKey = (property as Property | ObjectProperty).key;
22+
const propertyKey = property.key;
2423
if (propertyKey.type !== "Identifier") {
2524
continue;
2625
}
@@ -36,11 +35,7 @@ export const getDynamoDBDocClientArgs = (
3635
"init",
3736
j.identifier(docClientOptionsHash[propertyKey.name]),
3837
j.objectExpression([
39-
j.property(
40-
"init",
41-
j.identifier(propertyKey.name),
42-
(property as Property | ObjectProperty).value
43-
),
38+
j.property("init", j.identifier(propertyKey.name), property.value),
4439
])
4540
)
4641
);

0 commit comments

Comments
 (0)