File tree Expand file tree Collapse file tree 1 file changed +9
-12
lines changed
codegen/smithy-aws-typescript-codegen/src/main/resources/software/amazon/smithy/aws/typescript/codegen Expand file tree Collapse file tree 1 file changed +9
-12
lines changed Original file line number Diff line number Diff line change 1
1
/**
2
2
* Load an error code for the aws.rest-json-1.1 protocol.
3
3
*/
4
- const loadRestJsonErrorCode = (
5
- output : __HttpResponse ,
6
- data : any
7
- ) : string => {
4
+ const loadRestJsonErrorCode = ( output : __HttpResponse , data : any ) : string => {
8
5
const findKey = ( object : any , key : string ) =>
9
6
Object . keys ( object ) . find ( k => k . toLowerCase ( ) === key . toLowerCase ( ) ) ;
10
7
11
8
const sanitizeErrorCode = ( rawValue : string ) : string => {
12
9
let cleanValue = rawValue ;
13
- if ( cleanValue . indexOf ( ':' ) >= 0 ) {
14
- cleanValue = cleanValue . split ( ':' ) [ 0 ] ;
10
+ if ( cleanValue . indexOf ( ":" ) >= 0 ) {
11
+ cleanValue = cleanValue . split ( ":" ) [ 0 ] ;
15
12
}
16
- if ( cleanValue . indexOf ( '#' ) >= 0 ) {
17
- cleanValue = cleanValue . split ( '#' ) [ 1 ] ;
13
+ if ( cleanValue . indexOf ( "#" ) >= 0 ) {
14
+ cleanValue = cleanValue . split ( "#" ) [ 1 ] ;
18
15
}
19
16
return cleanValue ;
20
17
} ;
@@ -28,9 +25,9 @@ const loadRestJsonErrorCode = (
28
25
return sanitizeErrorCode ( data . code ) ;
29
26
}
30
27
31
- if ( data [ ' __type' ] !== undefined ) {
32
- return sanitizeErrorCode ( data [ ' __type' ] ) ;
28
+ if ( data [ " __type" ] !== undefined ) {
29
+ return sanitizeErrorCode ( data [ " __type" ] ) ;
33
30
}
34
31
35
- return '' ;
36
- }
32
+ return "" ;
33
+ } ;
You can’t perform that action at this time.
0 commit comments