Skip to content

Commit 2cbc06d

Browse files
committed
chore: remove type assertion in getWaiterConfigValue
1 parent 2d81813 commit 2cbc06d

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

src/transforms/v2-to-v3/apis/getWaiterConfigValue.ts

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,15 @@
1-
import type { ObjectExpression, ObjectProperty, Property } from "jscodeshift";
2-
3-
import { OBJECT_PROPERTY_TYPE_LIST } from "../config";
1+
import type { ObjectExpression } from "jscodeshift";
42

53
export const getWaiterConfigValue = (waiterConfiguration: ObjectExpression, key: string) => {
64
for (const property of waiterConfiguration.properties) {
7-
if (!OBJECT_PROPERTY_TYPE_LIST.includes(property.type)) {
5+
if (property.type !== "Property" && property.type !== "ObjectProperty") {
86
continue;
97
}
10-
const propertyKey = (property as Property | ObjectProperty).key;
11-
const propertyValue = (property as Property | ObjectProperty).value;
12-
if (propertyKey.type !== "Identifier") {
8+
if (property.key.type !== "Identifier") {
139
continue;
1410
}
15-
if (propertyKey.name === key) {
11+
if (property.key.name === key) {
12+
const propertyValue = property.value;
1613
if (propertyValue.type === "Literal" || propertyValue.type === "StringLiteral") {
1714
if (typeof propertyValue.value === "number") {
1815
return propertyValue.value.toString();

0 commit comments

Comments
 (0)