Skip to content

Commit

Permalink
chore(reducers): reduce object copying in iterators
Browse files Browse the repository at this point in the history
  • Loading branch information
kuhe committed Nov 15, 2022
1 parent 90b380a commit d562a4c
Show file tree
Hide file tree
Showing 228 changed files with 2,581 additions and 5,097 deletions.
31 changes: 11 additions & 20 deletions clients/client-accessanalyzer/src/models/models_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3429,10 +3429,9 @@ export const RdsDbClusterSnapshotConfigurationFilterSensitiveLog = (obj: RdsDbCl
...obj,
...(obj.attributes && {
attributes: Object.entries(obj.attributes).reduce(
(acc: any, [key, value]: [string, RdsDbClusterSnapshotAttributeValue]) => ({
...acc,
[key]: RdsDbClusterSnapshotAttributeValueFilterSensitiveLog(value),
}),
(acc: any, [key, value]: [string, RdsDbClusterSnapshotAttributeValue]) => (
(acc[key] = RdsDbClusterSnapshotAttributeValueFilterSensitiveLog(value)), acc
),
{}
),
}),
Expand All @@ -3453,10 +3452,9 @@ export const RdsDbSnapshotConfigurationFilterSensitiveLog = (obj: RdsDbSnapshotC
...obj,
...(obj.attributes && {
attributes: Object.entries(obj.attributes).reduce(
(acc: any, [key, value]: [string, RdsDbSnapshotAttributeValue]) => ({
...acc,
[key]: RdsDbSnapshotAttributeValueFilterSensitiveLog(value),
}),
(acc: any, [key, value]: [string, RdsDbSnapshotAttributeValue]) => (
(acc[key] = RdsDbSnapshotAttributeValueFilterSensitiveLog(value)), acc
),
{}
),
}),
Expand Down Expand Up @@ -3529,10 +3527,9 @@ export const S3BucketConfigurationFilterSensitiveLog = (obj: S3BucketConfigurati
}),
...(obj.accessPoints && {
accessPoints: Object.entries(obj.accessPoints).reduce(
(acc: any, [key, value]: [string, S3AccessPointConfiguration]) => ({
...acc,
[key]: S3AccessPointConfigurationFilterSensitiveLog(value),
}),
(acc: any, [key, value]: [string, S3AccessPointConfiguration]) => (
(acc[key] = S3AccessPointConfigurationFilterSensitiveLog(value)), acc
),
{}
),
}),
Expand Down Expand Up @@ -3590,10 +3587,7 @@ export const CreateAccessPreviewRequestFilterSensitiveLog = (obj: CreateAccessPr
...obj,
...(obj.configurations && {
configurations: Object.entries(obj.configurations).reduce(
(acc: any, [key, value]: [string, Configuration]) => ({
...acc,
[key]: ConfigurationFilterSensitiveLog(value),
}),
(acc: any, [key, value]: [string, Configuration]) => ((acc[key] = ConfigurationFilterSensitiveLog(value)), acc),
{}
),
}),
Expand Down Expand Up @@ -3627,10 +3621,7 @@ export const AccessPreviewFilterSensitiveLog = (obj: AccessPreview): any => ({
...obj,
...(obj.configurations && {
configurations: Object.entries(obj.configurations).reduce(
(acc: any, [key, value]: [string, Configuration]) => ({
...acc,
[key]: ConfigurationFilterSensitiveLog(value),
}),
(acc: any, [key, value]: [string, Configuration]) => ((acc[key] = ConfigurationFilterSensitiveLog(value)), acc),
{}
),
}),
Expand Down
108 changes: 36 additions & 72 deletions clients/client-accessanalyzer/src/protocols/Aws_restJson1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2614,10 +2614,8 @@ const serializeAws_restJson1ConfigurationsMap = (
if (value === null) {
return acc;
}
return {
...acc,
[key]: serializeAws_restJson1Configuration(value, context),
};
acc[key] = serializeAws_restJson1Configuration(value, context);
return acc;
}, {});
};

Expand Down Expand Up @@ -2680,10 +2678,8 @@ const serializeAws_restJson1FilterCriteriaMap = (input: Record<string, Criterion
if (value === null) {
return acc;
}
return {
...acc,
[key]: serializeAws_restJson1Criterion(value, context),
};
acc[key] = serializeAws_restJson1Criterion(value, context);
return acc;
}, {});
};

Expand Down Expand Up @@ -2725,10 +2721,8 @@ const serializeAws_restJson1KmsConstraintsMap = (input: Record<string, string>,
if (value === null) {
return acc;
}
return {
...acc,
[key]: value,
};
acc[key] = value;
return acc;
}, {});
};

Expand Down Expand Up @@ -2793,10 +2787,8 @@ const serializeAws_restJson1KmsKeyPoliciesMap = (input: Record<string, string>,
if (value === null) {
return acc;
}
return {
...acc,
[key]: value,
};
acc[key] = value;
return acc;
}, {});
};

Expand Down Expand Up @@ -2838,10 +2830,8 @@ const serializeAws_restJson1RdsDbClusterSnapshotAttributesMap = (
if (value === null) {
return acc;
}
return {
...acc,
[key]: serializeAws_restJson1RdsDbClusterSnapshotAttributeValue(value, context),
};
acc[key] = serializeAws_restJson1RdsDbClusterSnapshotAttributeValue(value, context);
return acc;
}, {});
};

Expand Down Expand Up @@ -2883,10 +2873,8 @@ const serializeAws_restJson1RdsDbSnapshotAttributesMap = (
if (value === null) {
return acc;
}
return {
...acc,
[key]: serializeAws_restJson1RdsDbSnapshotAttributeValue(value, context),
};
acc[key] = serializeAws_restJson1RdsDbSnapshotAttributeValue(value, context);
return acc;
}, {});
};

Expand Down Expand Up @@ -2943,10 +2931,8 @@ const serializeAws_restJson1S3AccessPointConfigurationsMap = (
if (value === null) {
return acc;
}
return {
...acc,
[key]: serializeAws_restJson1S3AccessPointConfiguration(value, context),
};
acc[key] = serializeAws_restJson1S3AccessPointConfiguration(value, context);
return acc;
}, {});
};

Expand Down Expand Up @@ -3033,10 +3019,8 @@ const serializeAws_restJson1TagsMap = (input: Record<string, string>, context: _
if (value === null) {
return acc;
}
return {
...acc,
[key]: value,
};
acc[key] = value;
return acc;
}, {});
};

Expand Down Expand Up @@ -3288,10 +3272,8 @@ const deserializeAws_restJson1ConditionKeyMap = (output: any, context: __SerdeCo
if (value === null) {
return acc;
}
return {
...acc,
[key]: __expectString(value) as any,
};
acc[key] = __expectString(value) as any;
return acc;
}, {});
};

Expand Down Expand Up @@ -3368,10 +3350,8 @@ const deserializeAws_restJson1ConfigurationsMap = (
if (value === null) {
return acc;
}
return {
...acc,
[key]: deserializeAws_restJson1Configuration(__expectUnion(value), context),
};
acc[key] = deserializeAws_restJson1Configuration(__expectUnion(value), context);
return acc;
}, {});
};

Expand Down Expand Up @@ -3442,10 +3422,8 @@ const deserializeAws_restJson1FilterCriteriaMap = (output: any, context: __Serde
if (value === null) {
return acc;
}
return {
...acc,
[key]: deserializeAws_restJson1Criterion(value, context),
};
acc[key] = deserializeAws_restJson1Criterion(value, context);
return acc;
}, {});
};

Expand Down Expand Up @@ -3603,10 +3581,8 @@ const deserializeAws_restJson1KmsConstraintsMap = (output: any, context: __Serde
if (value === null) {
return acc;
}
return {
...acc,
[key]: __expectString(value) as any,
};
acc[key] = __expectString(value) as any;
return acc;
}, {});
};

Expand Down Expand Up @@ -3681,10 +3657,8 @@ const deserializeAws_restJson1KmsKeyPoliciesMap = (output: any, context: __Serde
if (value === null) {
return acc;
}
return {
...acc,
[key]: __expectString(value) as any,
};
acc[key] = __expectString(value) as any;
return acc;
}, {});
};

Expand Down Expand Up @@ -3789,10 +3763,8 @@ const deserializeAws_restJson1PrincipalMap = (output: any, context: __SerdeConte
if (value === null) {
return acc;
}
return {
...acc,
[key]: __expectString(value) as any,
};
acc[key] = __expectString(value) as any;
return acc;
}, {});
};

Expand All @@ -3817,10 +3789,8 @@ const deserializeAws_restJson1RdsDbClusterSnapshotAttributesMap = (
if (value === null) {
return acc;
}
return {
...acc,
[key]: deserializeAws_restJson1RdsDbClusterSnapshotAttributeValue(__expectUnion(value), context),
};
acc[key] = deserializeAws_restJson1RdsDbClusterSnapshotAttributeValue(__expectUnion(value), context);
return acc;
},
{}
);
Expand Down Expand Up @@ -3872,10 +3842,8 @@ const deserializeAws_restJson1RdsDbSnapshotAttributesMap = (
if (value === null) {
return acc;
}
return {
...acc,
[key]: deserializeAws_restJson1RdsDbSnapshotAttributeValue(__expectUnion(value), context),
};
acc[key] = deserializeAws_restJson1RdsDbSnapshotAttributeValue(__expectUnion(value), context);
return acc;
},
{}
);
Expand Down Expand Up @@ -3944,10 +3912,8 @@ const deserializeAws_restJson1S3AccessPointConfigurationsMap = (
if (value === null) {
return acc;
}
return {
...acc,
[key]: deserializeAws_restJson1S3AccessPointConfiguration(value, context),
};
acc[key] = deserializeAws_restJson1S3AccessPointConfiguration(value, context);
return acc;
},
{}
);
Expand Down Expand Up @@ -4066,10 +4032,8 @@ const deserializeAws_restJson1TagsMap = (output: any, context: __SerdeContext):
if (value === null) {
return acc;
}
return {
...acc,
[key]: __expectString(value) as any,
};
acc[key] = __expectString(value) as any;
return acc;
}, {});
};

Expand Down
12 changes: 4 additions & 8 deletions clients/client-alexa-for-business/src/protocols/Aws_json1_1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5906,10 +5906,8 @@ const serializeAws_json1_1AuthorizationResult = (input: Record<string, string>,
if (value === null) {
return acc;
}
return {
...acc,
[key]: value,
};
acc[key] = value;
return acc;
}, {});
};

Expand Down Expand Up @@ -8331,10 +8329,8 @@ const deserializeAws_json1_1Reviews = (output: any, context: __SerdeContext): Re
if (value === null) {
return acc;
}
return {
...acc,
[key]: __expectString(value) as any,
};
acc[key] = __expectString(value) as any;
return acc;
}, {});
};

Expand Down
12 changes: 4 additions & 8 deletions clients/client-amp/src/protocols/Aws_restJson1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1976,10 +1976,8 @@ const serializeAws_restJson1TagMap = (input: Record<string, string>, context: __
if (value === null) {
return acc;
}
return {
...acc,
[key]: value,
};
acc[key] = value;
return acc;
}, {});
};

Expand Down Expand Up @@ -2099,10 +2097,8 @@ const deserializeAws_restJson1TagMap = (output: any, context: __SerdeContext): R
if (value === null) {
return acc;
}
return {
...acc,
[key]: __expectString(value) as any,
};
acc[key] = __expectString(value) as any;
return acc;
}, {});
};

Expand Down
Loading

0 comments on commit d562a4c

Please sign in to comment.