File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -2,12 +2,23 @@ import type { Operation } from '../client/interfaces/Operation';
2
2
import type { Service } from '../client/interfaces/Service' ;
3
3
import { flatMap } from './flatMap' ;
4
4
5
+ function removeServicenameAndLowercase ( text : string , searchString : string ) {
6
+ if ( text . toLowerCase ( ) . startsWith ( searchString . toLowerCase ( ) ) ) {
7
+ const modifiedText = text . slice ( searchString . length ) ;
8
+ const firstChar = modifiedText . charAt ( 0 ) . toLowerCase ( ) ;
9
+ return firstChar + modifiedText . slice ( 1 ) ;
10
+ }
11
+ return text ;
12
+ }
13
+
5
14
export const postProcessServiceOperations = ( service : Service ) : Operation [ ] => {
6
15
const names = new Map < string , number > ( ) ;
7
16
8
17
return service . operations . map ( operation => {
9
18
const clone = { ...operation } ;
10
19
20
+ clone . name = removeServicenameAndLowercase ( clone . name , service . name ) ;
21
+
11
22
// Parse the service parameters and results, very similar to how we parse
12
23
// properties of models. These methods will extend the type if needed.
13
24
clone . imports . push ( ...flatMap ( clone . parameters , parameter => parameter . imports ) ) ;
You can’t perform that action at this time.
0 commit comments