Skip to content

Commit 2d81813

Browse files
committed
chore: remove type assertion in getWaiterConfig
1 parent 52fc6ee commit 2d81813

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed
Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +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 getWaiterConfig = (originalConfig: ObjectExpression): ObjectExpression | undefined => {
64
for (const property of originalConfig.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" || propertyValue.type !== "ObjectExpression") {
8+
if (property.key.type !== "Identifier" || property.value.type !== "ObjectExpression") {
139
continue;
1410
}
15-
if (propertyKey.name === "$waiter") {
16-
return propertyValue;
11+
if (property.key.name === "$waiter") {
12+
return property.value;
1713
}
1814
}
1915
};

0 commit comments

Comments
 (0)