Skip to content

Commit 2a4b532

Browse files
authored
chore: remove redundant return statements from protocol.ts (#1145)
1 parent d1d2003 commit 2a4b532

File tree

225 files changed

+554
-820
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

225 files changed

+554
-820
lines changed

clients/client-accessanalyzer/protocols/Aws_restJson1_1.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -3481,14 +3481,13 @@ function isSerializableHeaderValue(value: any): boolean {
34813481
);
34823482
}
34833483

3484-
const parseBody = (streamBody: any, context: __SerdeContext): any => {
3485-
return collectBodyString(streamBody, context).then(encoded => {
3484+
const parseBody = (streamBody: any, context: __SerdeContext): any =>
3485+
collectBodyString(streamBody, context).then(encoded => {
34863486
if (encoded.length) {
34873487
return JSON.parse(encoded);
34883488
}
34893489
return {};
34903490
});
3491-
};
34923491

34933492
/**
34943493
* Load an error code for the aws.rest-json-1.1 protocol.

clients/client-acm-pca/protocols/Aws_json1_1.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -4130,11 +4130,10 @@ const buildHttpRpcRequest = async (
41304130
return new __HttpRequest(contents);
41314131
};
41324132

4133-
const parseBody = (streamBody: any, context: __SerdeContext): any => {
4134-
return collectBodyString(streamBody, context).then(encoded => {
4133+
const parseBody = (streamBody: any, context: __SerdeContext): any =>
4134+
collectBodyString(streamBody, context).then(encoded => {
41354135
if (encoded.length) {
41364136
return JSON.parse(encoded);
41374137
}
41384138
return {};
41394139
});
4140-
};

clients/client-acm/protocols/Aws_json1_1.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -2807,11 +2807,10 @@ const buildHttpRpcRequest = async (
28072807
return new __HttpRequest(contents);
28082808
};
28092809

2810-
const parseBody = (streamBody: any, context: __SerdeContext): any => {
2811-
return collectBodyString(streamBody, context).then(encoded => {
2810+
const parseBody = (streamBody: any, context: __SerdeContext): any =>
2811+
collectBodyString(streamBody, context).then(encoded => {
28122812
if (encoded.length) {
28132813
return JSON.parse(encoded);
28142814
}
28152815
return {};
28162816
});
2817-
};

clients/client-alexa-for-business/protocols/Aws_json1_1.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -14212,11 +14212,10 @@ const buildHttpRpcRequest = async (
1421214212
return new __HttpRequest(contents);
1421314213
};
1421414214

14215-
const parseBody = (streamBody: any, context: __SerdeContext): any => {
14216-
return collectBodyString(streamBody, context).then(encoded => {
14215+
const parseBody = (streamBody: any, context: __SerdeContext): any =>
14216+
collectBodyString(streamBody, context).then(encoded => {
1421714217
if (encoded.length) {
1421814218
return JSON.parse(encoded);
1421914219
}
1422014220
return {};
1422114221
});
14222-
};

clients/client-amplify/protocols/Aws_restJson1_1.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -6909,14 +6909,13 @@ function isSerializableHeaderValue(value: any): boolean {
69096909
);
69106910
}
69116911

6912-
const parseBody = (streamBody: any, context: __SerdeContext): any => {
6913-
return collectBodyString(streamBody, context).then(encoded => {
6912+
const parseBody = (streamBody: any, context: __SerdeContext): any =>
6913+
collectBodyString(streamBody, context).then(encoded => {
69146914
if (encoded.length) {
69156915
return JSON.parse(encoded);
69166916
}
69176917
return {};
69186918
});
6919-
};
69206919

69216920
/**
69226921
* Load an error code for the aws.rest-json-1.1 protocol.

clients/client-api-gateway/protocols/Aws_restJson1_1.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -24698,14 +24698,13 @@ function isSerializableHeaderValue(value: any): boolean {
2469824698
);
2469924699
}
2470024700

24701-
const parseBody = (streamBody: any, context: __SerdeContext): any => {
24702-
return collectBodyString(streamBody, context).then(encoded => {
24701+
const parseBody = (streamBody: any, context: __SerdeContext): any =>
24702+
collectBodyString(streamBody, context).then(encoded => {
2470324703
if (encoded.length) {
2470424704
return JSON.parse(encoded);
2470524705
}
2470624706
return {};
2470724707
});
24708-
};
2470924708

2471024709
/**
2471124710
* Load an error code for the aws.rest-json-1.1 protocol.

clients/client-apigatewaymanagementapi/protocols/Aws_restJson1_1.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -511,14 +511,13 @@ function isSerializableHeaderValue(value: any): boolean {
511511
);
512512
}
513513

514-
const parseBody = (streamBody: any, context: __SerdeContext): any => {
515-
return collectBodyString(streamBody, context).then(encoded => {
514+
const parseBody = (streamBody: any, context: __SerdeContext): any =>
515+
collectBodyString(streamBody, context).then(encoded => {
516516
if (encoded.length) {
517517
return JSON.parse(encoded);
518518
}
519519
return {};
520520
});
521-
};
522521

523522
/**
524523
* Load an error code for the aws.rest-json-1.1 protocol.

clients/client-apigatewayv2/protocols/Aws_restJson1_1.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -11921,14 +11921,13 @@ function isSerializableHeaderValue(value: any): boolean {
1192111921
);
1192211922
}
1192311923

11924-
const parseBody = (streamBody: any, context: __SerdeContext): any => {
11925-
return collectBodyString(streamBody, context).then(encoded => {
11924+
const parseBody = (streamBody: any, context: __SerdeContext): any =>
11925+
collectBodyString(streamBody, context).then(encoded => {
1192611926
if (encoded.length) {
1192711927
return JSON.parse(encoded);
1192811928
}
1192911929
return {};
1193011930
});
11931-
};
1193211931

1193311932
/**
1193411933
* Load an error code for the aws.rest-json-1.1 protocol.

clients/client-app-mesh/protocols/Aws_restJson1_1.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -7560,14 +7560,13 @@ function isSerializableHeaderValue(value: any): boolean {
75607560
);
75617561
}
75627562

7563-
const parseBody = (streamBody: any, context: __SerdeContext): any => {
7564-
return collectBodyString(streamBody, context).then(encoded => {
7563+
const parseBody = (streamBody: any, context: __SerdeContext): any =>
7564+
collectBodyString(streamBody, context).then(encoded => {
75657565
if (encoded.length) {
75667566
return JSON.parse(encoded);
75677567
}
75687568
return {};
75697569
});
7570-
};
75717570

75727571
/**
75737572
* Load an error code for the aws.rest-json-1.1 protocol.

clients/client-appconfig/protocols/Aws_restJson1_1.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -4982,14 +4982,13 @@ function isSerializableHeaderValue(value: any): boolean {
49824982
);
49834983
}
49844984

4985-
const parseBody = (streamBody: any, context: __SerdeContext): any => {
4986-
return collectBodyString(streamBody, context).then(encoded => {
4985+
const parseBody = (streamBody: any, context: __SerdeContext): any =>
4986+
collectBodyString(streamBody, context).then(encoded => {
49874987
if (encoded.length) {
49884988
return JSON.parse(encoded);
49894989
}
49904990
return {};
49914991
});
4992-
};
49934992

49944993
/**
49954994
* Load an error code for the aws.rest-json-1.1 protocol.

clients/client-application-auto-scaling/protocols/Aws_json1_1.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -2727,11 +2727,10 @@ const buildHttpRpcRequest = async (
27272727
return new __HttpRequest(contents);
27282728
};
27292729

2730-
const parseBody = (streamBody: any, context: __SerdeContext): any => {
2731-
return collectBodyString(streamBody, context).then(encoded => {
2730+
const parseBody = (streamBody: any, context: __SerdeContext): any =>
2731+
collectBodyString(streamBody, context).then(encoded => {
27322732
if (encoded.length) {
27332733
return JSON.parse(encoded);
27342734
}
27352735
return {};
27362736
});
2737-
};

clients/client-application-discovery-service/protocols/Aws_json1_1.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -5536,11 +5536,10 @@ const buildHttpRpcRequest = async (
55365536
return new __HttpRequest(contents);
55375537
};
55385538

5539-
const parseBody = (streamBody: any, context: __SerdeContext): any => {
5540-
return collectBodyString(streamBody, context).then(encoded => {
5539+
const parseBody = (streamBody: any, context: __SerdeContext): any =>
5540+
collectBodyString(streamBody, context).then(encoded => {
55415541
if (encoded.length) {
55425542
return JSON.parse(encoded);
55435543
}
55445544
return {};
55455545
});
5546-
};

clients/client-application-insights/protocols/Aws_json1_1.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -4534,11 +4534,10 @@ const buildHttpRpcRequest = async (
45344534
return new __HttpRequest(contents);
45354535
};
45364536

4537-
const parseBody = (streamBody: any, context: __SerdeContext): any => {
4538-
return collectBodyString(streamBody, context).then(encoded => {
4537+
const parseBody = (streamBody: any, context: __SerdeContext): any =>
4538+
collectBodyString(streamBody, context).then(encoded => {
45394539
if (encoded.length) {
45404540
return JSON.parse(encoded);
45414541
}
45424542
return {};
45434543
});
4544-
};

clients/client-appstream/protocols/Aws_json1_1.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -8674,11 +8674,10 @@ const buildHttpRpcRequest = async (
86748674
return new __HttpRequest(contents);
86758675
};
86768676

8677-
const parseBody = (streamBody: any, context: __SerdeContext): any => {
8678-
return collectBodyString(streamBody, context).then(encoded => {
8677+
const parseBody = (streamBody: any, context: __SerdeContext): any =>
8678+
collectBodyString(streamBody, context).then(encoded => {
86798679
if (encoded.length) {
86808680
return JSON.parse(encoded);
86818681
}
86828682
return {};
86838683
});
8684-
};

clients/client-appsync/protocols/Aws_restJson1_1.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -7911,14 +7911,13 @@ function isSerializableHeaderValue(value: any): boolean {
79117911
);
79127912
}
79137913

7914-
const parseBody = (streamBody: any, context: __SerdeContext): any => {
7915-
return collectBodyString(streamBody, context).then(encoded => {
7914+
const parseBody = (streamBody: any, context: __SerdeContext): any =>
7915+
collectBodyString(streamBody, context).then(encoded => {
79167916
if (encoded.length) {
79177917
return JSON.parse(encoded);
79187918
}
79197919
return {};
79207920
});
7921-
};
79227921

79237922
/**
79247923
* Load an error code for the aws.rest-json-1.1 protocol.

clients/client-athena/protocols/Aws_json1_1.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -3487,11 +3487,10 @@ const buildHttpRpcRequest = async (
34873487
return new __HttpRequest(contents);
34883488
};
34893489

3490-
const parseBody = (streamBody: any, context: __SerdeContext): any => {
3491-
return collectBodyString(streamBody, context).then(encoded => {
3490+
const parseBody = (streamBody: any, context: __SerdeContext): any =>
3491+
collectBodyString(streamBody, context).then(encoded => {
34923492
if (encoded.length) {
34933493
return JSON.parse(encoded);
34943494
}
34953495
return {};
34963496
});
3497-
};

clients/client-auto-scaling-plans/protocols/Aws_json1_1.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -2091,11 +2091,10 @@ const buildHttpRpcRequest = async (
20912091
return new __HttpRequest(contents);
20922092
};
20932093

2094-
const parseBody = (streamBody: any, context: __SerdeContext): any => {
2095-
return collectBodyString(streamBody, context).then(encoded => {
2094+
const parseBody = (streamBody: any, context: __SerdeContext): any =>
2095+
collectBodyString(streamBody, context).then(encoded => {
20962096
if (encoded.length) {
20972097
return JSON.parse(encoded);
20982098
}
20992099
return {};
21002100
});
2101-
};

clients/client-auto-scaling/protocols/Aws_query.ts

+6-9
Original file line numberDiff line numberDiff line change
@@ -10204,17 +10204,16 @@ const buildHttpRpcRequest = async (
1020410204
return new __HttpRequest(contents);
1020510205
};
1020610206

10207-
const decodeEscapedXML = (str: string) => {
10208-
return str
10207+
const decodeEscapedXML = (str: string) =>
10208+
str
1020910209
.replace(/&/g, "&")
1021010210
.replace(/'/g, "'")
1021110211
.replace(/"/g, '"')
1021210212
.replace(/>/g, ">")
1021310213
.replace(/&lt;/g, "<");
10214-
};
1021510214

10216-
const parseBody = (streamBody: any, context: __SerdeContext): any => {
10217-
return collectBodyString(streamBody, context).then(encoded => {
10215+
const parseBody = (streamBody: any, context: __SerdeContext): any =>
10216+
collectBodyString(streamBody, context).then(encoded => {
1021810217
if (encoded.length) {
1021910218
const parsedObj = xmlParse(encoded, {
1022010219
attributeNamePrefix: "",
@@ -10233,18 +10232,16 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => {
1023310232
}
1023410233
return {};
1023510234
});
10236-
};
1023710235

10238-
const buildFormUrlencodedString = (entries: any): string => {
10239-
return Object.keys(entries)
10236+
const buildFormUrlencodedString = (entries: any): string =>
10237+
Object.keys(entries)
1024010238
.map(
1024110239
key =>
1024210240
__extendedEncodeURIComponent(key) +
1024310241
"=" +
1024410242
__extendedEncodeURIComponent(entries[key])
1024510243
)
1024610244
.join("&");
10247-
};
1024810245

1024910246
const loadQueryErrorCode = (output: __HttpResponse, data: any): string => {
1025010247
if (data.Error.Code !== undefined) {

clients/client-backup/protocols/Aws_restJson1_1.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -8380,14 +8380,13 @@ function isSerializableHeaderValue(value: any): boolean {
83808380
);
83818381
}
83828382

8383-
const parseBody = (streamBody: any, context: __SerdeContext): any => {
8384-
return collectBodyString(streamBody, context).then(encoded => {
8383+
const parseBody = (streamBody: any, context: __SerdeContext): any =>
8384+
collectBodyString(streamBody, context).then(encoded => {
83858385
if (encoded.length) {
83868386
return JSON.parse(encoded);
83878387
}
83888388
return {};
83898389
});
8390-
};
83918390

83928391
/**
83938392
* Load an error code for the aws.rest-json-1.1 protocol.

clients/client-batch/protocols/Aws_restJson1_1.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -3979,14 +3979,13 @@ function isSerializableHeaderValue(value: any): boolean {
39793979
);
39803980
}
39813981

3982-
const parseBody = (streamBody: any, context: __SerdeContext): any => {
3983-
return collectBodyString(streamBody, context).then(encoded => {
3982+
const parseBody = (streamBody: any, context: __SerdeContext): any =>
3983+
collectBodyString(streamBody, context).then(encoded => {
39843984
if (encoded.length) {
39853985
return JSON.parse(encoded);
39863986
}
39873987
return {};
39883988
});
3989-
};
39903989

39913990
/**
39923991
* Load an error code for the aws.rest-json-1.1 protocol.

clients/client-budgets/protocols/Aws_json1_1.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -3283,11 +3283,10 @@ const buildHttpRpcRequest = async (
32833283
return new __HttpRequest(contents);
32843284
};
32853285

3286-
const parseBody = (streamBody: any, context: __SerdeContext): any => {
3287-
return collectBodyString(streamBody, context).then(encoded => {
3286+
const parseBody = (streamBody: any, context: __SerdeContext): any =>
3287+
collectBodyString(streamBody, context).then(encoded => {
32883288
if (encoded.length) {
32893289
return JSON.parse(encoded);
32903290
}
32913291
return {};
32923292
});
3293-
};

clients/client-chime/protocols/Aws_restJson1_1.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -18592,14 +18592,13 @@ function isSerializableHeaderValue(value: any): boolean {
1859218592
);
1859318593
}
1859418594

18595-
const parseBody = (streamBody: any, context: __SerdeContext): any => {
18596-
return collectBodyString(streamBody, context).then(encoded => {
18595+
const parseBody = (streamBody: any, context: __SerdeContext): any =>
18596+
collectBodyString(streamBody, context).then(encoded => {
1859718597
if (encoded.length) {
1859818598
return JSON.parse(encoded);
1859918599
}
1860018600
return {};
1860118601
});
18602-
};
1860318602

1860418603
/**
1860518604
* Load an error code for the aws.rest-json-1.1 protocol.

clients/client-cloud9/protocols/Aws_json1_1.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -2329,11 +2329,10 @@ const buildHttpRpcRequest = async (
23292329
return new __HttpRequest(contents);
23302330
};
23312331

2332-
const parseBody = (streamBody: any, context: __SerdeContext): any => {
2333-
return collectBodyString(streamBody, context).then(encoded => {
2332+
const parseBody = (streamBody: any, context: __SerdeContext): any =>
2333+
collectBodyString(streamBody, context).then(encoded => {
23342334
if (encoded.length) {
23352335
return JSON.parse(encoded);
23362336
}
23372337
return {};
23382338
});
2339-
};

0 commit comments

Comments
 (0)