Skip to content

[code quality] Using repeated push() instead of map() #1252

@ilyash-b

Description

@ilyash-b

for (const managedSessionPolicy of managedSessionPoliciesInput) {
managedSessionPolicies.push({ arn: managedSessionPolicy });
}

Should be something like (untested):

const managedSessionPolicies: { arn: string }[] = managedSessionPoliciesInput.map((arn) => ({ arn }));

( and remove const managedSessionPolicies... earlier in the original code)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions