Skip to content

Commit 99ec3d1

Browse files
authored
chore: change Object.keys to Object.entries (#1180)
1 parent 54ec57b commit 99ec3d1

File tree

137 files changed

+7082
-5275
lines changed

Some content is hidden

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

137 files changed

+7082
-5275
lines changed

clients/client-accessanalyzer/protocols/Aws_restJson1_1.ts

+42-24
Original file line numberDiff line numberDiff line change
@@ -2865,10 +2865,13 @@ const serializeAws_restJson1_1FilterCriteriaMap = (
28652865
input: { [key: string]: Criterion },
28662866
context: __SerdeContext
28672867
): any => {
2868-
return Object.keys(input).reduce((acc: any, key: string) => {
2869-
acc[key] = serializeAws_restJson1_1Criterion(input[key], context);
2870-
return acc;
2871-
}, {});
2868+
return Object.entries(input).reduce(
2869+
(acc: { [key: string]: Criterion }, [key, value]: [string, any]) => ({
2870+
...acc,
2871+
[key]: serializeAws_restJson1_1Criterion(value, context)
2872+
}),
2873+
{}
2874+
);
28722875
};
28732876

28742877
const serializeAws_restJson1_1FindingIdList = (
@@ -2915,10 +2918,13 @@ const serializeAws_restJson1_1TagsMap = (
29152918
input: { [key: string]: string },
29162919
context: __SerdeContext
29172920
): any => {
2918-
return Object.keys(input).reduce((acc: any, key: string) => {
2919-
acc[key] = input[key];
2920-
return acc;
2921-
}, {});
2921+
return Object.entries(input).reduce(
2922+
(acc: { [key: string]: string }, [key, value]: [string, any]) => ({
2923+
...acc,
2924+
[key]: value
2925+
}),
2926+
{}
2927+
);
29222928
};
29232929

29242930
const serializeAws_restJson1_1ValueList = (
@@ -3094,10 +3100,13 @@ const deserializeAws_restJson1_1ConditionKeyMap = (
30943100
output: any,
30953101
context: __SerdeContext
30963102
): { [key: string]: string } => {
3097-
return Object.keys(output).reduce((acc: any, key: string) => {
3098-
acc[key] = output[key];
3099-
return acc;
3100-
}, {});
3103+
return Object.entries(output).reduce(
3104+
(acc: { [key: string]: string }, [key, value]: [string, any]) => ({
3105+
...acc,
3106+
[key]: value
3107+
}),
3108+
{}
3109+
);
31013110
};
31023111

31033112
const deserializeAws_restJson1_1Criterion = (
@@ -3129,10 +3138,13 @@ const deserializeAws_restJson1_1FilterCriteriaMap = (
31293138
output: any,
31303139
context: __SerdeContext
31313140
): { [key: string]: Criterion } => {
3132-
return Object.keys(output).reduce((acc: any, key: string) => {
3133-
acc[key] = deserializeAws_restJson1_1Criterion(output[key], context);
3134-
return acc;
3135-
}, {});
3141+
return Object.entries(output).reduce(
3142+
(acc: { [key: string]: Criterion }, [key, value]: [string, any]) => ({
3143+
...acc,
3144+
[key]: deserializeAws_restJson1_1Criterion(value, context)
3145+
}),
3146+
{}
3147+
);
31363148
};
31373149

31383150
const deserializeAws_restJson1_1Finding = (
@@ -3256,10 +3268,13 @@ const deserializeAws_restJson1_1PrincipalMap = (
32563268
output: any,
32573269
context: __SerdeContext
32583270
): { [key: string]: string } => {
3259-
return Object.keys(output).reduce((acc: any, key: string) => {
3260-
acc[key] = output[key];
3261-
return acc;
3262-
}, {});
3271+
return Object.entries(output).reduce(
3272+
(acc: { [key: string]: string }, [key, value]: [string, any]) => ({
3273+
...acc,
3274+
[key]: value
3275+
}),
3276+
{}
3277+
);
32633278
};
32643279

32653280
const deserializeAws_restJson1_1SharedViaList = (
@@ -3273,10 +3288,13 @@ const deserializeAws_restJson1_1TagsMap = (
32733288
output: any,
32743289
context: __SerdeContext
32753290
): { [key: string]: string } => {
3276-
return Object.keys(output).reduce((acc: any, key: string) => {
3277-
acc[key] = output[key];
3278-
return acc;
3279-
}, {});
3291+
return Object.entries(output).reduce(
3292+
(acc: { [key: string]: string }, [key, value]: [string, any]) => ({
3293+
...acc,
3294+
[key]: value
3295+
}),
3296+
{}
3297+
);
32803298
};
32813299

32823300
const deserializeAws_restJson1_1ValidationExceptionField = (

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

+14-8
Original file line numberDiff line numberDiff line change
@@ -8884,10 +8884,13 @@ const serializeAws_json1_1AuthorizationResult = (
88848884
input: { [key: string]: string },
88858885
context: __SerdeContext
88868886
): any => {
8887-
return Object.keys(input).reduce((acc: any, key: string) => {
8888-
acc[key] = input[key];
8889-
return acc;
8890-
}, {});
8887+
return Object.entries(input).reduce(
8888+
(acc: { [key: string]: string }, [key, value]: [string, any]) => ({
8889+
...acc,
8890+
[key]: value
8891+
}),
8892+
{}
8893+
);
88918894
};
88928895

88938896
const serializeAws_json1_1BusinessReportContentRange = (
@@ -12528,10 +12531,13 @@ const deserializeAws_json1_1Reviews = (
1252812531
output: any,
1252912532
context: __SerdeContext
1253012533
): { [key: string]: string } => {
12531-
return Object.keys(output).reduce((acc: any, key: string) => {
12532-
acc[key] = output[key];
12533-
return acc;
12534-
}, {});
12534+
return Object.entries(output).reduce(
12535+
(acc: { [key: string]: string }, [key, value]: [string, any]) => ({
12536+
...acc,
12537+
[key]: value
12538+
}),
12539+
{}
12540+
);
1253512541
};
1253612542

1253712543
const deserializeAws_json1_1RevokeInvitationResponse = (

clients/client-amplify/protocols/Aws_restJson1_1.ts

+49-28
Original file line numberDiff line numberDiff line change
@@ -5848,20 +5848,26 @@ const serializeAws_restJson1_1EnvironmentVariables = (
58485848
input: { [key: string]: string },
58495849
context: __SerdeContext
58505850
): any => {
5851-
return Object.keys(input).reduce((acc: any, key: string) => {
5852-
acc[key] = input[key];
5853-
return acc;
5854-
}, {});
5851+
return Object.entries(input).reduce(
5852+
(acc: { [key: string]: string }, [key, value]: [string, any]) => ({
5853+
...acc,
5854+
[key]: value
5855+
}),
5856+
{}
5857+
);
58555858
};
58565859

58575860
const serializeAws_restJson1_1FileMap = (
58585861
input: { [key: string]: string },
58595862
context: __SerdeContext
58605863
): any => {
5861-
return Object.keys(input).reduce((acc: any, key: string) => {
5862-
acc[key] = input[key];
5863-
return acc;
5864-
}, {});
5864+
return Object.entries(input).reduce(
5865+
(acc: { [key: string]: string }, [key, value]: [string, any]) => ({
5866+
...acc,
5867+
[key]: value
5868+
}),
5869+
{}
5870+
);
58655871
};
58665872

58675873
const serializeAws_restJson1_1SubDomainSetting = (
@@ -5887,10 +5893,13 @@ const serializeAws_restJson1_1TagMap = (
58875893
input: { [key: string]: string },
58885894
context: __SerdeContext
58895895
): any => {
5890-
return Object.keys(input).reduce((acc: any, key: string) => {
5891-
acc[key] = input[key];
5892-
return acc;
5893-
}, {});
5896+
return Object.entries(input).reduce(
5897+
(acc: { [key: string]: string }, [key, value]: [string, any]) => ({
5898+
...acc,
5899+
[key]: value
5900+
}),
5901+
{}
5902+
);
58945903
};
58955904

58965905
const deserializeAws_restJson1_1App = (
@@ -6379,20 +6388,26 @@ const deserializeAws_restJson1_1EnvironmentVariables = (
63796388
output: any,
63806389
context: __SerdeContext
63816390
): { [key: string]: string } => {
6382-
return Object.keys(output).reduce((acc: any, key: string) => {
6383-
acc[key] = output[key];
6384-
return acc;
6385-
}, {});
6391+
return Object.entries(output).reduce(
6392+
(acc: { [key: string]: string }, [key, value]: [string, any]) => ({
6393+
...acc,
6394+
[key]: value
6395+
}),
6396+
{}
6397+
);
63866398
};
63876399

63886400
const deserializeAws_restJson1_1FileUploadUrls = (
63896401
output: any,
63906402
context: __SerdeContext
63916403
): { [key: string]: string } => {
6392-
return Object.keys(output).reduce((acc: any, key: string) => {
6393-
acc[key] = output[key];
6394-
return acc;
6395-
}, {});
6404+
return Object.entries(output).reduce(
6405+
(acc: { [key: string]: string }, [key, value]: [string, any]) => ({
6406+
...acc,
6407+
[key]: value
6408+
}),
6409+
{}
6410+
);
63966411
};
63976412

63986413
const deserializeAws_restJson1_1Job = (
@@ -6495,10 +6510,13 @@ const deserializeAws_restJson1_1Screenshots = (
64956510
output: any,
64966511
context: __SerdeContext
64976512
): { [key: string]: string } => {
6498-
return Object.keys(output).reduce((acc: any, key: string) => {
6499-
acc[key] = output[key];
6500-
return acc;
6501-
}, {});
6513+
return Object.entries(output).reduce(
6514+
(acc: { [key: string]: string }, [key, value]: [string, any]) => ({
6515+
...acc,
6516+
[key]: value
6517+
}),
6518+
{}
6519+
);
65026520
};
65036521

65046522
const deserializeAws_restJson1_1Step = (
@@ -6617,10 +6635,13 @@ const deserializeAws_restJson1_1TagMap = (
66176635
output: any,
66186636
context: __SerdeContext
66196637
): { [key: string]: string } => {
6620-
return Object.keys(output).reduce((acc: any, key: string) => {
6621-
acc[key] = output[key];
6622-
return acc;
6623-
}, {});
6638+
return Object.entries(output).reduce(
6639+
(acc: { [key: string]: string }, [key, value]: [string, any]) => ({
6640+
...acc,
6641+
[key]: value
6642+
}),
6643+
{}
6644+
);
66246645
};
66256646

66266647
const deserializeAws_restJson1_1Webhook = (

0 commit comments

Comments
 (0)