@@ -25,18 +25,18 @@ const transforms = {
25
25
26
26
// A recursive function that looks at the models and their properties and
27
27
// converts each property name using the provided transform function.
28
- export const convertModelNames = < T extends Model | OperationResponse > ( model : T , type : Exclude < Case , Case . NONE > ) : T => {
28
+ export const convertModelCase = < T extends Model | OperationResponse > ( model : T , type : Exclude < Case , Case . NONE > ) : T => {
29
29
return {
30
30
...model ,
31
31
name : transforms [ type ] ( model . name ) ,
32
- link : model . link ? convertModelNames ( model . link , type ) : null ,
33
- enum : model . enum . map ( modelEnum => convertEnumName ( modelEnum , type ) ) ,
34
- enums : model . enums . map ( property => convertModelNames ( property , type ) ) ,
35
- properties : model . properties . map ( property => convertModelNames ( property , type ) ) ,
32
+ link : model . link ? convertModelCase ( model . link , type ) : null ,
33
+ enum : model . enum . map ( modelEnum => convertEnumCase ( modelEnum , type ) ) ,
34
+ enums : model . enums . map ( property => convertModelCase ( property , type ) ) ,
35
+ properties : model . properties . map ( property => convertModelCase ( property , type ) ) ,
36
36
} ;
37
37
} ;
38
38
39
- const convertEnumName = ( modelEnum : Enum , type : Exclude < Case , Case . NONE > ) : Enum => {
39
+ const convertEnumCase = ( modelEnum : Enum , type : Exclude < Case , Case . NONE > ) : Enum => {
40
40
return {
41
41
...modelEnum ,
42
42
name : transforms [ type ] ( modelEnum . name ) ,
@@ -48,7 +48,7 @@ export const convertServiceCase = (service: Service, type: Exclude<Case, Case.NO
48
48
...service ,
49
49
operations : service . operations . map ( op => ( {
50
50
...op ,
51
- results : op . results . map ( results => convertModelNames ( results , type ) ) ,
51
+ results : op . results . map ( results => convertModelCase ( results , type ) ) ,
52
52
} ) ) ,
53
53
} ;
54
54
} ;
0 commit comments