Skip to content

chore: change Object.keys to Object.entries #1180

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 42 additions & 24 deletions clients/client-accessanalyzer/protocols/Aws_restJson1_1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2865,10 +2865,13 @@ const serializeAws_restJson1_1FilterCriteriaMap = (
input: { [key: string]: Criterion },
context: __SerdeContext
): any => {
return Object.keys(input).reduce((acc: any, key: string) => {
acc[key] = serializeAws_restJson1_1Criterion(input[key], context);
return acc;
}, {});
return Object.entries(input).reduce(
(acc: { [key: string]: Criterion }, [key, value]: [string, any]) => ({
...acc,
[key]: serializeAws_restJson1_1Criterion(value, context)
}),
{}
);
};

const serializeAws_restJson1_1FindingIdList = (
Expand Down Expand Up @@ -2915,10 +2918,13 @@ const serializeAws_restJson1_1TagsMap = (
input: { [key: string]: string },
context: __SerdeContext
): any => {
return Object.keys(input).reduce((acc: any, key: string) => {
acc[key] = input[key];
return acc;
}, {});
return Object.entries(input).reduce(
(acc: { [key: string]: string }, [key, value]: [string, any]) => ({
...acc,
[key]: value
}),
{}
);
};

const serializeAws_restJson1_1ValueList = (
Expand Down Expand Up @@ -3094,10 +3100,13 @@ const deserializeAws_restJson1_1ConditionKeyMap = (
output: any,
context: __SerdeContext
): { [key: string]: string } => {
return Object.keys(output).reduce((acc: any, key: string) => {
acc[key] = output[key];
return acc;
}, {});
return Object.entries(output).reduce(
(acc: { [key: string]: string }, [key, value]: [string, any]) => ({
...acc,
[key]: value
}),
{}
);
};

const deserializeAws_restJson1_1Criterion = (
Expand Down Expand Up @@ -3129,10 +3138,13 @@ const deserializeAws_restJson1_1FilterCriteriaMap = (
output: any,
context: __SerdeContext
): { [key: string]: Criterion } => {
return Object.keys(output).reduce((acc: any, key: string) => {
acc[key] = deserializeAws_restJson1_1Criterion(output[key], context);
return acc;
}, {});
return Object.entries(output).reduce(
(acc: { [key: string]: Criterion }, [key, value]: [string, any]) => ({
...acc,
[key]: deserializeAws_restJson1_1Criterion(value, context)
}),
{}
);
};

const deserializeAws_restJson1_1Finding = (
Expand Down Expand Up @@ -3256,10 +3268,13 @@ const deserializeAws_restJson1_1PrincipalMap = (
output: any,
context: __SerdeContext
): { [key: string]: string } => {
return Object.keys(output).reduce((acc: any, key: string) => {
acc[key] = output[key];
return acc;
}, {});
return Object.entries(output).reduce(
(acc: { [key: string]: string }, [key, value]: [string, any]) => ({
...acc,
[key]: value
}),
{}
);
};

const deserializeAws_restJson1_1SharedViaList = (
Expand All @@ -3273,10 +3288,13 @@ const deserializeAws_restJson1_1TagsMap = (
output: any,
context: __SerdeContext
): { [key: string]: string } => {
return Object.keys(output).reduce((acc: any, key: string) => {
acc[key] = output[key];
return acc;
}, {});
return Object.entries(output).reduce(
(acc: { [key: string]: string }, [key, value]: [string, any]) => ({
...acc,
[key]: value
}),
{}
);
};

const deserializeAws_restJson1_1ValidationExceptionField = (
Expand Down
22 changes: 14 additions & 8 deletions clients/client-alexa-for-business/protocols/Aws_json1_1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8884,10 +8884,13 @@ const serializeAws_json1_1AuthorizationResult = (
input: { [key: string]: string },
context: __SerdeContext
): any => {
return Object.keys(input).reduce((acc: any, key: string) => {
acc[key] = input[key];
return acc;
}, {});
return Object.entries(input).reduce(
(acc: { [key: string]: string }, [key, value]: [string, any]) => ({
...acc,
[key]: value
}),
{}
);
};

const serializeAws_json1_1BusinessReportContentRange = (
Expand Down Expand Up @@ -12528,10 +12531,13 @@ const deserializeAws_json1_1Reviews = (
output: any,
context: __SerdeContext
): { [key: string]: string } => {
return Object.keys(output).reduce((acc: any, key: string) => {
acc[key] = output[key];
return acc;
}, {});
return Object.entries(output).reduce(
(acc: { [key: string]: string }, [key, value]: [string, any]) => ({
...acc,
[key]: value
}),
{}
);
};

const deserializeAws_json1_1RevokeInvitationResponse = (
Expand Down
77 changes: 49 additions & 28 deletions clients/client-amplify/protocols/Aws_restJson1_1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5848,20 +5848,26 @@ const serializeAws_restJson1_1EnvironmentVariables = (
input: { [key: string]: string },
context: __SerdeContext
): any => {
return Object.keys(input).reduce((acc: any, key: string) => {
acc[key] = input[key];
return acc;
}, {});
return Object.entries(input).reduce(
(acc: { [key: string]: string }, [key, value]: [string, any]) => ({
...acc,
[key]: value
}),
{}
);
};

const serializeAws_restJson1_1FileMap = (
input: { [key: string]: string },
context: __SerdeContext
): any => {
return Object.keys(input).reduce((acc: any, key: string) => {
acc[key] = input[key];
return acc;
}, {});
return Object.entries(input).reduce(
(acc: { [key: string]: string }, [key, value]: [string, any]) => ({
...acc,
[key]: value
}),
{}
);
};

const serializeAws_restJson1_1SubDomainSetting = (
Expand All @@ -5887,10 +5893,13 @@ const serializeAws_restJson1_1TagMap = (
input: { [key: string]: string },
context: __SerdeContext
): any => {
return Object.keys(input).reduce((acc: any, key: string) => {
acc[key] = input[key];
return acc;
}, {});
return Object.entries(input).reduce(
(acc: { [key: string]: string }, [key, value]: [string, any]) => ({
...acc,
[key]: value
}),
{}
);
};

const deserializeAws_restJson1_1App = (
Expand Down Expand Up @@ -6379,20 +6388,26 @@ const deserializeAws_restJson1_1EnvironmentVariables = (
output: any,
context: __SerdeContext
): { [key: string]: string } => {
return Object.keys(output).reduce((acc: any, key: string) => {
acc[key] = output[key];
return acc;
}, {});
return Object.entries(output).reduce(
(acc: { [key: string]: string }, [key, value]: [string, any]) => ({
...acc,
[key]: value
}),
{}
);
};

const deserializeAws_restJson1_1FileUploadUrls = (
output: any,
context: __SerdeContext
): { [key: string]: string } => {
return Object.keys(output).reduce((acc: any, key: string) => {
acc[key] = output[key];
return acc;
}, {});
return Object.entries(output).reduce(
(acc: { [key: string]: string }, [key, value]: [string, any]) => ({
...acc,
[key]: value
}),
{}
);
};

const deserializeAws_restJson1_1Job = (
Expand Down Expand Up @@ -6495,10 +6510,13 @@ const deserializeAws_restJson1_1Screenshots = (
output: any,
context: __SerdeContext
): { [key: string]: string } => {
return Object.keys(output).reduce((acc: any, key: string) => {
acc[key] = output[key];
return acc;
}, {});
return Object.entries(output).reduce(
(acc: { [key: string]: string }, [key, value]: [string, any]) => ({
...acc,
[key]: value
}),
{}
);
};

const deserializeAws_restJson1_1Step = (
Expand Down Expand Up @@ -6617,10 +6635,13 @@ const deserializeAws_restJson1_1TagMap = (
output: any,
context: __SerdeContext
): { [key: string]: string } => {
return Object.keys(output).reduce((acc: any, key: string) => {
acc[key] = output[key];
return acc;
}, {});
return Object.entries(output).reduce(
(acc: { [key: string]: string }, [key, value]: [string, any]) => ({
...acc,
[key]: value
}),
{}
);
};

const deserializeAws_restJson1_1Webhook = (
Expand Down
Loading