File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,6 @@ export function getOperation(
25
25
const operationNameFallback = `${ method } ${ serviceName } ` ;
26
26
const operationName = getOperationName ( op . operationId || operationNameFallback ) ;
27
27
const operationPath = getOperationPath ( url ) ;
28
-
29
28
// Create a new operation object for this method.
30
29
const operation : Operation = {
31
30
service : serviceName ,
Original file line number Diff line number Diff line change @@ -6,9 +6,22 @@ import camelCase from 'camelcase';
6
6
* the most popular Javascript and Typescript writing style.
7
7
*/
8
8
export function getOperationName ( value : string ) : string {
9
- const clean = value
9
+ let clean = value
10
10
. replace ( / ^ [ ^ a - z A - Z ] + / g, '' )
11
11
. replace ( / [ ^ \w \- ] + / g, '-' )
12
12
. trim ( ) ;
13
+
14
+ if ( clean . startsWith ( 'List' ) ) {
15
+ clean = 'List' ;
16
+ } else if ( clean . startsWith ( 'Fetch' ) ) {
17
+ clean = 'Fetch' ;
18
+ } else if ( clean . startsWith ( 'Create' ) ) {
19
+ clean = 'Create' ;
20
+ } else if ( clean . startsWith ( 'Update' ) ) {
21
+ clean = 'Update' ;
22
+ } else if ( clean . startsWith ( 'Remove' ) ) {
23
+ clean = 'Remove' ;
24
+ }
25
+
13
26
return camelCase ( clean ) ;
14
27
}
You can’t perform that action at this time.
0 commit comments