Skip to content

Commit 304482e

Browse files
authored
chore: remove redundant return from collectBodyString and isSerializableHeaderValue (#1149)
1 parent 2a4b532 commit 304482e

File tree

223 files changed

+1083
-2037
lines changed

Some content is hidden

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

223 files changed

+1083
-2037
lines changed

clients/client-accessanalyzer/protocols/Aws_restJson1_1.ts

+9-15
Original file line numberDiff line numberDiff line change
@@ -3465,21 +3465,15 @@ const collectBody = (
34653465
const collectBodyString = (
34663466
streamBody: any,
34673467
context: __SerdeContext
3468-
): Promise<string> => {
3469-
return collectBody(streamBody, context).then(body =>
3470-
context.utf8Encoder(body)
3471-
);
3472-
};
3473-
3474-
function isSerializableHeaderValue(value: any): boolean {
3475-
return (
3476-
value !== undefined &&
3477-
value !== "" &&
3478-
(!Object.getOwnPropertyNames(value).includes("length") ||
3479-
value.length != 0) &&
3480-
(!Object.getOwnPropertyNames(value).includes("size") || value.size != 0)
3481-
);
3482-
}
3468+
): Promise<string> =>
3469+
collectBody(streamBody, context).then(body => context.utf8Encoder(body));
3470+
3471+
const isSerializableHeaderValue = (value: any): boolean =>
3472+
value !== undefined &&
3473+
value !== "" &&
3474+
(!Object.getOwnPropertyNames(value).includes("length") ||
3475+
value.length != 0) &&
3476+
(!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
34833477

34843478
const parseBody = (streamBody: any, context: __SerdeContext): any =>
34853479
collectBodyString(streamBody, context).then(encoded => {

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

+2-5
Original file line numberDiff line numberDiff line change
@@ -4099,11 +4099,8 @@ const collectBody = (
40994099
const collectBodyString = (
41004100
streamBody: any,
41014101
context: __SerdeContext
4102-
): Promise<string> => {
4103-
return collectBody(streamBody, context).then(body =>
4104-
context.utf8Encoder(body)
4105-
);
4106-
};
4102+
): Promise<string> =>
4103+
collectBody(streamBody, context).then(body => context.utf8Encoder(body));
41074104

41084105
const buildHttpRpcRequest = async (
41094106
context: __SerdeContext,

clients/client-acm/protocols/Aws_json1_1.ts

+2-5
Original file line numberDiff line numberDiff line change
@@ -2776,11 +2776,8 @@ const collectBody = (
27762776
const collectBodyString = (
27772777
streamBody: any,
27782778
context: __SerdeContext
2779-
): Promise<string> => {
2780-
return collectBody(streamBody, context).then(body =>
2781-
context.utf8Encoder(body)
2782-
);
2783-
};
2779+
): Promise<string> =>
2780+
collectBody(streamBody, context).then(body => context.utf8Encoder(body));
27842781

27852782
const buildHttpRpcRequest = async (
27862783
context: __SerdeContext,

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

+2-5
Original file line numberDiff line numberDiff line change
@@ -14181,11 +14181,8 @@ const collectBody = (
1418114181
const collectBodyString = (
1418214182
streamBody: any,
1418314183
context: __SerdeContext
14184-
): Promise<string> => {
14185-
return collectBody(streamBody, context).then(body =>
14186-
context.utf8Encoder(body)
14187-
);
14188-
};
14184+
): Promise<string> =>
14185+
collectBody(streamBody, context).then(body => context.utf8Encoder(body));
1418914186

1419014187
const buildHttpRpcRequest = async (
1419114188
context: __SerdeContext,

clients/client-amplify/protocols/Aws_restJson1_1.ts

+9-15
Original file line numberDiff line numberDiff line change
@@ -6893,21 +6893,15 @@ const collectBody = (
68936893
const collectBodyString = (
68946894
streamBody: any,
68956895
context: __SerdeContext
6896-
): Promise<string> => {
6897-
return collectBody(streamBody, context).then(body =>
6898-
context.utf8Encoder(body)
6899-
);
6900-
};
6901-
6902-
function isSerializableHeaderValue(value: any): boolean {
6903-
return (
6904-
value !== undefined &&
6905-
value !== "" &&
6906-
(!Object.getOwnPropertyNames(value).includes("length") ||
6907-
value.length != 0) &&
6908-
(!Object.getOwnPropertyNames(value).includes("size") || value.size != 0)
6909-
);
6910-
}
6896+
): Promise<string> =>
6897+
collectBody(streamBody, context).then(body => context.utf8Encoder(body));
6898+
6899+
const isSerializableHeaderValue = (value: any): boolean =>
6900+
value !== undefined &&
6901+
value !== "" &&
6902+
(!Object.getOwnPropertyNames(value).includes("length") ||
6903+
value.length != 0) &&
6904+
(!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
69116905

69126906
const parseBody = (streamBody: any, context: __SerdeContext): any =>
69136907
collectBodyString(streamBody, context).then(encoded => {

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

+9-15
Original file line numberDiff line numberDiff line change
@@ -24682,21 +24682,15 @@ const collectBody = (
2468224682
const collectBodyString = (
2468324683
streamBody: any,
2468424684
context: __SerdeContext
24685-
): Promise<string> => {
24686-
return collectBody(streamBody, context).then(body =>
24687-
context.utf8Encoder(body)
24688-
);
24689-
};
24690-
24691-
function isSerializableHeaderValue(value: any): boolean {
24692-
return (
24693-
value !== undefined &&
24694-
value !== "" &&
24695-
(!Object.getOwnPropertyNames(value).includes("length") ||
24696-
value.length != 0) &&
24697-
(!Object.getOwnPropertyNames(value).includes("size") || value.size != 0)
24698-
);
24699-
}
24685+
): Promise<string> =>
24686+
collectBody(streamBody, context).then(body => context.utf8Encoder(body));
24687+
24688+
const isSerializableHeaderValue = (value: any): boolean =>
24689+
value !== undefined &&
24690+
value !== "" &&
24691+
(!Object.getOwnPropertyNames(value).includes("length") ||
24692+
value.length != 0) &&
24693+
(!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
2470024694

2470124695
const parseBody = (streamBody: any, context: __SerdeContext): any =>
2470224696
collectBodyString(streamBody, context).then(encoded => {

clients/client-apigatewaymanagementapi/protocols/Aws_restJson1_1.ts

+8-14
Original file line numberDiff line numberDiff line change
@@ -495,21 +495,15 @@ const collectBody = (
495495
const collectBodyString = (
496496
streamBody: any,
497497
context: __SerdeContext
498-
): Promise<string> => {
499-
return collectBody(streamBody, context).then(body =>
500-
context.utf8Encoder(body)
501-
);
502-
};
498+
): Promise<string> =>
499+
collectBody(streamBody, context).then(body => context.utf8Encoder(body));
503500

504-
function isSerializableHeaderValue(value: any): boolean {
505-
return (
506-
value !== undefined &&
507-
value !== "" &&
508-
(!Object.getOwnPropertyNames(value).includes("length") ||
509-
value.length != 0) &&
510-
(!Object.getOwnPropertyNames(value).includes("size") || value.size != 0)
511-
);
512-
}
501+
const isSerializableHeaderValue = (value: any): boolean =>
502+
value !== undefined &&
503+
value !== "" &&
504+
(!Object.getOwnPropertyNames(value).includes("length") ||
505+
value.length != 0) &&
506+
(!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
513507

514508
const parseBody = (streamBody: any, context: __SerdeContext): any =>
515509
collectBodyString(streamBody, context).then(encoded => {

clients/client-apigatewayv2/protocols/Aws_restJson1_1.ts

+9-15
Original file line numberDiff line numberDiff line change
@@ -11905,21 +11905,15 @@ const collectBody = (
1190511905
const collectBodyString = (
1190611906
streamBody: any,
1190711907
context: __SerdeContext
11908-
): Promise<string> => {
11909-
return collectBody(streamBody, context).then(body =>
11910-
context.utf8Encoder(body)
11911-
);
11912-
};
11913-
11914-
function isSerializableHeaderValue(value: any): boolean {
11915-
return (
11916-
value !== undefined &&
11917-
value !== "" &&
11918-
(!Object.getOwnPropertyNames(value).includes("length") ||
11919-
value.length != 0) &&
11920-
(!Object.getOwnPropertyNames(value).includes("size") || value.size != 0)
11921-
);
11922-
}
11908+
): Promise<string> =>
11909+
collectBody(streamBody, context).then(body => context.utf8Encoder(body));
11910+
11911+
const isSerializableHeaderValue = (value: any): boolean =>
11912+
value !== undefined &&
11913+
value !== "" &&
11914+
(!Object.getOwnPropertyNames(value).includes("length") ||
11915+
value.length != 0) &&
11916+
(!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
1192311917

1192411918
const parseBody = (streamBody: any, context: __SerdeContext): any =>
1192511919
collectBodyString(streamBody, context).then(encoded => {

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

+9-15
Original file line numberDiff line numberDiff line change
@@ -7544,21 +7544,15 @@ const collectBody = (
75447544
const collectBodyString = (
75457545
streamBody: any,
75467546
context: __SerdeContext
7547-
): Promise<string> => {
7548-
return collectBody(streamBody, context).then(body =>
7549-
context.utf8Encoder(body)
7550-
);
7551-
};
7552-
7553-
function isSerializableHeaderValue(value: any): boolean {
7554-
return (
7555-
value !== undefined &&
7556-
value !== "" &&
7557-
(!Object.getOwnPropertyNames(value).includes("length") ||
7558-
value.length != 0) &&
7559-
(!Object.getOwnPropertyNames(value).includes("size") || value.size != 0)
7560-
);
7561-
}
7547+
): Promise<string> =>
7548+
collectBody(streamBody, context).then(body => context.utf8Encoder(body));
7549+
7550+
const isSerializableHeaderValue = (value: any): boolean =>
7551+
value !== undefined &&
7552+
value !== "" &&
7553+
(!Object.getOwnPropertyNames(value).includes("length") ||
7554+
value.length != 0) &&
7555+
(!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
75627556

75637557
const parseBody = (streamBody: any, context: __SerdeContext): any =>
75647558
collectBodyString(streamBody, context).then(encoded => {

clients/client-appconfig/protocols/Aws_restJson1_1.ts

+8-14
Original file line numberDiff line numberDiff line change
@@ -4966,21 +4966,15 @@ const collectBody = (
49664966
const collectBodyString = (
49674967
streamBody: any,
49684968
context: __SerdeContext
4969-
): Promise<string> => {
4970-
return collectBody(streamBody, context).then(body =>
4971-
context.utf8Encoder(body)
4972-
);
4973-
};
4969+
): Promise<string> =>
4970+
collectBody(streamBody, context).then(body => context.utf8Encoder(body));
49744971

4975-
function isSerializableHeaderValue(value: any): boolean {
4976-
return (
4977-
value !== undefined &&
4978-
value !== "" &&
4979-
(!Object.getOwnPropertyNames(value).includes("length") ||
4980-
value.length != 0) &&
4981-
(!Object.getOwnPropertyNames(value).includes("size") || value.size != 0)
4982-
);
4983-
}
4972+
const isSerializableHeaderValue = (value: any): boolean =>
4973+
value !== undefined &&
4974+
value !== "" &&
4975+
(!Object.getOwnPropertyNames(value).includes("length") ||
4976+
value.length != 0) &&
4977+
(!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
49844978

49854979
const parseBody = (streamBody: any, context: __SerdeContext): any =>
49864980
collectBodyString(streamBody, context).then(encoded => {

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

+2-5
Original file line numberDiff line numberDiff line change
@@ -2696,11 +2696,8 @@ const collectBody = (
26962696
const collectBodyString = (
26972697
streamBody: any,
26982698
context: __SerdeContext
2699-
): Promise<string> => {
2700-
return collectBody(streamBody, context).then(body =>
2701-
context.utf8Encoder(body)
2702-
);
2703-
};
2699+
): Promise<string> =>
2700+
collectBody(streamBody, context).then(body => context.utf8Encoder(body));
27042701

27052702
const buildHttpRpcRequest = async (
27062703
context: __SerdeContext,

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

+2-5
Original file line numberDiff line numberDiff line change
@@ -5505,11 +5505,8 @@ const collectBody = (
55055505
const collectBodyString = (
55065506
streamBody: any,
55075507
context: __SerdeContext
5508-
): Promise<string> => {
5509-
return collectBody(streamBody, context).then(body =>
5510-
context.utf8Encoder(body)
5511-
);
5512-
};
5508+
): Promise<string> =>
5509+
collectBody(streamBody, context).then(body => context.utf8Encoder(body));
55135510

55145511
const buildHttpRpcRequest = async (
55155512
context: __SerdeContext,

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

+2-5
Original file line numberDiff line numberDiff line change
@@ -4503,11 +4503,8 @@ const collectBody = (
45034503
const collectBodyString = (
45044504
streamBody: any,
45054505
context: __SerdeContext
4506-
): Promise<string> => {
4507-
return collectBody(streamBody, context).then(body =>
4508-
context.utf8Encoder(body)
4509-
);
4510-
};
4506+
): Promise<string> =>
4507+
collectBody(streamBody, context).then(body => context.utf8Encoder(body));
45114508

45124509
const buildHttpRpcRequest = async (
45134510
context: __SerdeContext,

clients/client-appstream/protocols/Aws_json1_1.ts

+2-5
Original file line numberDiff line numberDiff line change
@@ -8643,11 +8643,8 @@ const collectBody = (
86438643
const collectBodyString = (
86448644
streamBody: any,
86458645
context: __SerdeContext
8646-
): Promise<string> => {
8647-
return collectBody(streamBody, context).then(body =>
8648-
context.utf8Encoder(body)
8649-
);
8650-
};
8646+
): Promise<string> =>
8647+
collectBody(streamBody, context).then(body => context.utf8Encoder(body));
86518648

86528649
const buildHttpRpcRequest = async (
86538650
context: __SerdeContext,

clients/client-appsync/protocols/Aws_restJson1_1.ts

+9-15
Original file line numberDiff line numberDiff line change
@@ -7895,21 +7895,15 @@ const collectBody = (
78957895
const collectBodyString = (
78967896
streamBody: any,
78977897
context: __SerdeContext
7898-
): Promise<string> => {
7899-
return collectBody(streamBody, context).then(body =>
7900-
context.utf8Encoder(body)
7901-
);
7902-
};
7903-
7904-
function isSerializableHeaderValue(value: any): boolean {
7905-
return (
7906-
value !== undefined &&
7907-
value !== "" &&
7908-
(!Object.getOwnPropertyNames(value).includes("length") ||
7909-
value.length != 0) &&
7910-
(!Object.getOwnPropertyNames(value).includes("size") || value.size != 0)
7911-
);
7912-
}
7898+
): Promise<string> =>
7899+
collectBody(streamBody, context).then(body => context.utf8Encoder(body));
7900+
7901+
const isSerializableHeaderValue = (value: any): boolean =>
7902+
value !== undefined &&
7903+
value !== "" &&
7904+
(!Object.getOwnPropertyNames(value).includes("length") ||
7905+
value.length != 0) &&
7906+
(!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
79137907

79147908
const parseBody = (streamBody: any, context: __SerdeContext): any =>
79157909
collectBodyString(streamBody, context).then(encoded => {

clients/client-athena/protocols/Aws_json1_1.ts

+2-5
Original file line numberDiff line numberDiff line change
@@ -3456,11 +3456,8 @@ const collectBody = (
34563456
const collectBodyString = (
34573457
streamBody: any,
34583458
context: __SerdeContext
3459-
): Promise<string> => {
3460-
return collectBody(streamBody, context).then(body =>
3461-
context.utf8Encoder(body)
3462-
);
3463-
};
3459+
): Promise<string> =>
3460+
collectBody(streamBody, context).then(body => context.utf8Encoder(body));
34643461

34653462
const buildHttpRpcRequest = async (
34663463
context: __SerdeContext,

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

+2-5
Original file line numberDiff line numberDiff line change
@@ -2060,11 +2060,8 @@ const collectBody = (
20602060
const collectBodyString = (
20612061
streamBody: any,
20622062
context: __SerdeContext
2063-
): Promise<string> => {
2064-
return collectBody(streamBody, context).then(body =>
2065-
context.utf8Encoder(body)
2066-
);
2067-
};
2063+
): Promise<string> =>
2064+
collectBody(streamBody, context).then(body => context.utf8Encoder(body));
20682065

20692066
const buildHttpRpcRequest = async (
20702067
context: __SerdeContext,

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

+2-5
Original file line numberDiff line numberDiff line change
@@ -10173,11 +10173,8 @@ const collectBody = (
1017310173
const collectBodyString = (
1017410174
streamBody: any,
1017510175
context: __SerdeContext
10176-
): Promise<string> => {
10177-
return collectBody(streamBody, context).then(body =>
10178-
context.utf8Encoder(body)
10179-
);
10180-
};
10176+
): Promise<string> =>
10177+
collectBody(streamBody, context).then(body => context.utf8Encoder(body));
1018110178

1018210179
const buildHttpRpcRequest = async (
1018310180
context: __SerdeContext,

0 commit comments

Comments
 (0)