Skip to content

Commit c20e037

Browse files
authored
chore(clients): replace triple-equals undefined+null check with double-equals (#3793)
1 parent f311cab commit c20e037

File tree

296 files changed

+77229
-114860
lines changed

Some content is hidden

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

296 files changed

+77229
-114860
lines changed

clients/client-accessanalyzer/src/protocols/Aws_restJson1.ts

Lines changed: 178 additions & 365 deletions
Large diffs are not rendered by default.

clients/client-account/src/protocols/Aws_restJson1.ts

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,8 @@ export const serializeAws_restJson1DeleteAlternateContactCommand = async (
4646
`${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/deleteAlternateContact";
4747
let body: any;
4848
body = JSON.stringify({
49-
...(input.AccountId !== undefined && input.AccountId !== null && { AccountId: input.AccountId }),
50-
...(input.AlternateContactType !== undefined &&
51-
input.AlternateContactType !== null && { AlternateContactType: input.AlternateContactType }),
49+
...(input.AccountId != null && { AccountId: input.AccountId }),
50+
...(input.AlternateContactType != null && { AlternateContactType: input.AlternateContactType }),
5251
});
5352
return new __HttpRequest({
5453
protocol,
@@ -72,9 +71,8 @@ export const serializeAws_restJson1GetAlternateContactCommand = async (
7271
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/getAlternateContact";
7372
let body: any;
7473
body = JSON.stringify({
75-
...(input.AccountId !== undefined && input.AccountId !== null && { AccountId: input.AccountId }),
76-
...(input.AlternateContactType !== undefined &&
77-
input.AlternateContactType !== null && { AlternateContactType: input.AlternateContactType }),
74+
...(input.AccountId != null && { AccountId: input.AccountId }),
75+
...(input.AlternateContactType != null && { AlternateContactType: input.AlternateContactType }),
7876
});
7977
return new __HttpRequest({
8078
protocol,
@@ -98,13 +96,12 @@ export const serializeAws_restJson1PutAlternateContactCommand = async (
9896
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/putAlternateContact";
9997
let body: any;
10098
body = JSON.stringify({
101-
...(input.AccountId !== undefined && input.AccountId !== null && { AccountId: input.AccountId }),
102-
...(input.AlternateContactType !== undefined &&
103-
input.AlternateContactType !== null && { AlternateContactType: input.AlternateContactType }),
104-
...(input.EmailAddress !== undefined && input.EmailAddress !== null && { EmailAddress: input.EmailAddress }),
105-
...(input.Name !== undefined && input.Name !== null && { Name: input.Name }),
106-
...(input.PhoneNumber !== undefined && input.PhoneNumber !== null && { PhoneNumber: input.PhoneNumber }),
107-
...(input.Title !== undefined && input.Title !== null && { Title: input.Title }),
99+
...(input.AccountId != null && { AccountId: input.AccountId }),
100+
...(input.AlternateContactType != null && { AlternateContactType: input.AlternateContactType }),
101+
...(input.EmailAddress != null && { EmailAddress: input.EmailAddress }),
102+
...(input.Name != null && { Name: input.Name }),
103+
...(input.PhoneNumber != null && { PhoneNumber: input.PhoneNumber }),
104+
...(input.Title != null && { Title: input.Title }),
108105
});
109106
return new __HttpRequest({
110107
protocol,

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

Lines changed: 205 additions & 314 deletions
Large diffs are not rendered by default.

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

Lines changed: 77 additions & 142 deletions
Large diffs are not rendered by default.

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

Lines changed: 450 additions & 641 deletions
Large diffs are not rendered by default.

clients/client-amp/src/protocols/Aws_restJson1.ts

Lines changed: 29 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ export const serializeAws_restJson1CreateAlertManagerDefinitionCommand = async (
110110
let body: any;
111111
body = JSON.stringify({
112112
clientToken: input.clientToken ?? generateIdempotencyToken(),
113-
...(input.data !== undefined && input.data !== null && { data: context.base64Encoder(input.data) }),
113+
...(input.data != null && { data: context.base64Encoder(input.data) }),
114114
});
115115
return new __HttpRequest({
116116
protocol,
@@ -146,9 +146,9 @@ export const serializeAws_restJson1CreateRuleGroupsNamespaceCommand = async (
146146
let body: any;
147147
body = JSON.stringify({
148148
clientToken: input.clientToken ?? generateIdempotencyToken(),
149-
...(input.data !== undefined && input.data !== null && { data: context.base64Encoder(input.data) }),
150-
...(input.name !== undefined && input.name !== null && { name: input.name }),
151-
...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1TagMap(input.tags, context) }),
149+
...(input.data != null && { data: context.base64Encoder(input.data) }),
150+
...(input.name != null && { name: input.name }),
151+
...(input.tags != null && { tags: serializeAws_restJson1TagMap(input.tags, context) }),
152152
});
153153
return new __HttpRequest({
154154
protocol,
@@ -172,9 +172,9 @@ export const serializeAws_restJson1CreateWorkspaceCommand = async (
172172
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/workspaces";
173173
let body: any;
174174
body = JSON.stringify({
175-
...(input.alias !== undefined && input.alias !== null && { alias: input.alias }),
175+
...(input.alias != null && { alias: input.alias }),
176176
clientToken: input.clientToken ?? generateIdempotencyToken(),
177-
...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1TagMap(input.tags, context) }),
177+
...(input.tags != null && { tags: serializeAws_restJson1TagMap(input.tags, context) }),
178178
});
179179
return new __HttpRequest({
180180
protocol,
@@ -507,7 +507,7 @@ export const serializeAws_restJson1PutAlertManagerDefinitionCommand = async (
507507
let body: any;
508508
body = JSON.stringify({
509509
clientToken: input.clientToken ?? generateIdempotencyToken(),
510-
...(input.data !== undefined && input.data !== null && { data: context.base64Encoder(input.data) }),
510+
...(input.data != null && { data: context.base64Encoder(input.data) }),
511511
});
512512
return new __HttpRequest({
513513
protocol,
@@ -552,7 +552,7 @@ export const serializeAws_restJson1PutRuleGroupsNamespaceCommand = async (
552552
let body: any;
553553
body = JSON.stringify({
554554
clientToken: input.clientToken ?? generateIdempotencyToken(),
555-
...(input.data !== undefined && input.data !== null && { data: context.base64Encoder(input.data) }),
555+
...(input.data != null && { data: context.base64Encoder(input.data) }),
556556
});
557557
return new __HttpRequest({
558558
protocol,
@@ -585,7 +585,7 @@ export const serializeAws_restJson1TagResourceCommand = async (
585585
}
586586
let body: any;
587587
body = JSON.stringify({
588-
...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1TagMap(input.tags, context) }),
588+
...(input.tags != null && { tags: serializeAws_restJson1TagMap(input.tags, context) }),
589589
});
590590
return new __HttpRequest({
591591
protocol,
@@ -651,7 +651,7 @@ export const serializeAws_restJson1UpdateWorkspaceAliasCommand = async (
651651
}
652652
let body: any;
653653
body = JSON.stringify({
654-
...(input.alias !== undefined && input.alias !== null && { alias: input.alias }),
654+
...(input.alias != null && { alias: input.alias }),
655655
clientToken: input.clientToken ?? generateIdempotencyToken(),
656656
});
657657
return new __HttpRequest({
@@ -1874,18 +1874,12 @@ const deserializeAws_restJson1AlertManagerDefinitionDescription = (
18741874
): AlertManagerDefinitionDescription => {
18751875
return {
18761876
createdAt:
1877-
output.createdAt !== undefined && output.createdAt !== null
1878-
? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.createdAt)))
1879-
: undefined,
1880-
data: output.data !== undefined && output.data !== null ? context.base64Decoder(output.data) : undefined,
1877+
output.createdAt != null ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.createdAt))) : undefined,
1878+
data: output.data != null ? context.base64Decoder(output.data) : undefined,
18811879
modifiedAt:
1882-
output.modifiedAt !== undefined && output.modifiedAt !== null
1883-
? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.modifiedAt)))
1884-
: undefined,
1880+
output.modifiedAt != null ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.modifiedAt))) : undefined,
18851881
status:
1886-
output.status !== undefined && output.status !== null
1887-
? deserializeAws_restJson1AlertManagerDefinitionStatus(output.status, context)
1888-
: undefined,
1882+
output.status != null ? deserializeAws_restJson1AlertManagerDefinitionStatus(output.status, context) : undefined,
18891883
} as any;
18901884
};
18911885

@@ -1906,23 +1900,14 @@ const deserializeAws_restJson1RuleGroupsNamespaceDescription = (
19061900
return {
19071901
arn: __expectString(output.arn),
19081902
createdAt:
1909-
output.createdAt !== undefined && output.createdAt !== null
1910-
? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.createdAt)))
1911-
: undefined,
1912-
data: output.data !== undefined && output.data !== null ? context.base64Decoder(output.data) : undefined,
1903+
output.createdAt != null ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.createdAt))) : undefined,
1904+
data: output.data != null ? context.base64Decoder(output.data) : undefined,
19131905
modifiedAt:
1914-
output.modifiedAt !== undefined && output.modifiedAt !== null
1915-
? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.modifiedAt)))
1916-
: undefined,
1906+
output.modifiedAt != null ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.modifiedAt))) : undefined,
19171907
name: __expectString(output.name),
19181908
status:
1919-
output.status !== undefined && output.status !== null
1920-
? deserializeAws_restJson1RuleGroupsNamespaceStatus(output.status, context)
1921-
: undefined,
1922-
tags:
1923-
output.tags !== undefined && output.tags !== null
1924-
? deserializeAws_restJson1TagMap(output.tags, context)
1925-
: undefined,
1909+
output.status != null ? deserializeAws_restJson1RuleGroupsNamespaceStatus(output.status, context) : undefined,
1910+
tags: output.tags != null ? deserializeAws_restJson1TagMap(output.tags, context) : undefined,
19261911
} as any;
19271912
};
19281913

@@ -1943,22 +1928,13 @@ const deserializeAws_restJson1RuleGroupsNamespaceSummary = (
19431928
return {
19441929
arn: __expectString(output.arn),
19451930
createdAt:
1946-
output.createdAt !== undefined && output.createdAt !== null
1947-
? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.createdAt)))
1948-
: undefined,
1931+
output.createdAt != null ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.createdAt))) : undefined,
19491932
modifiedAt:
1950-
output.modifiedAt !== undefined && output.modifiedAt !== null
1951-
? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.modifiedAt)))
1952-
: undefined,
1933+
output.modifiedAt != null ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.modifiedAt))) : undefined,
19531934
name: __expectString(output.name),
19541935
status:
1955-
output.status !== undefined && output.status !== null
1956-
? deserializeAws_restJson1RuleGroupsNamespaceStatus(output.status, context)
1957-
: undefined,
1958-
tags:
1959-
output.tags !== undefined && output.tags !== null
1960-
? deserializeAws_restJson1TagMap(output.tags, context)
1961-
: undefined,
1936+
output.status != null ? deserializeAws_restJson1RuleGroupsNamespaceStatus(output.status, context) : undefined,
1937+
tags: output.tags != null ? deserializeAws_restJson1TagMap(output.tags, context) : undefined,
19621938
} as any;
19631939
};
19641940

@@ -2019,18 +1995,10 @@ const deserializeAws_restJson1WorkspaceDescription = (output: any, context: __Se
20191995
alias: __expectString(output.alias),
20201996
arn: __expectString(output.arn),
20211997
createdAt:
2022-
output.createdAt !== undefined && output.createdAt !== null
2023-
? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.createdAt)))
2024-
: undefined,
1998+
output.createdAt != null ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.createdAt))) : undefined,
20251999
prometheusEndpoint: __expectString(output.prometheusEndpoint),
2026-
status:
2027-
output.status !== undefined && output.status !== null
2028-
? deserializeAws_restJson1WorkspaceStatus(output.status, context)
2029-
: undefined,
2030-
tags:
2031-
output.tags !== undefined && output.tags !== null
2032-
? deserializeAws_restJson1TagMap(output.tags, context)
2033-
: undefined,
2000+
status: output.status != null ? deserializeAws_restJson1WorkspaceStatus(output.status, context) : undefined,
2001+
tags: output.tags != null ? deserializeAws_restJson1TagMap(output.tags, context) : undefined,
20342002
workspaceId: __expectString(output.workspaceId),
20352003
} as any;
20362004
};
@@ -2046,17 +2014,9 @@ const deserializeAws_restJson1WorkspaceSummary = (output: any, context: __SerdeC
20462014
alias: __expectString(output.alias),
20472015
arn: __expectString(output.arn),
20482016
createdAt:
2049-
output.createdAt !== undefined && output.createdAt !== null
2050-
? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.createdAt)))
2051-
: undefined,
2052-
status:
2053-
output.status !== undefined && output.status !== null
2054-
? deserializeAws_restJson1WorkspaceStatus(output.status, context)
2055-
: undefined,
2056-
tags:
2057-
output.tags !== undefined && output.tags !== null
2058-
? deserializeAws_restJson1TagMap(output.tags, context)
2059-
: undefined,
2017+
output.createdAt != null ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.createdAt))) : undefined,
2018+
status: output.status != null ? deserializeAws_restJson1WorkspaceStatus(output.status, context) : undefined,
2019+
tags: output.tags != null ? deserializeAws_restJson1TagMap(output.tags, context) : undefined,
20602020
workspaceId: __expectString(output.workspaceId),
20612021
} as any;
20622022
};

0 commit comments

Comments
 (0)