File tree Expand file tree Collapse file tree 1 file changed +5
-9
lines changed
src/transforms/v2-to-v3/apis Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Original file line number Diff line number Diff line change 1
- import type { ObjectExpression , ObjectProperty , Property } from "jscodeshift" ;
2
-
3
- import { OBJECT_PROPERTY_TYPE_LIST } from "../config" ;
1
+ import type { ObjectExpression } from "jscodeshift" ;
4
2
5
3
export const getWaiterConfig = ( originalConfig : ObjectExpression ) : ObjectExpression | undefined => {
6
4
for ( const property of originalConfig . properties ) {
7
- if ( ! OBJECT_PROPERTY_TYPE_LIST . includes ( property . type ) ) {
5
+ if ( property . type !== "Property" && property . type !== "ObjectProperty" ) {
8
6
continue ;
9
7
}
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" ) {
13
9
continue ;
14
10
}
15
- if ( propertyKey . name === "$waiter" ) {
16
- return propertyValue ;
11
+ if ( property . key . name === "$waiter" ) {
12
+ return property . value ;
17
13
}
18
14
}
19
15
} ;
You can’t perform that action at this time.
0 commit comments