Skip to content

Commit

Permalink
refactor: logic for concatenation of lists
Browse files Browse the repository at this point in the history
  • Loading branch information
limwa committed Jul 5, 2024
1 parent 3f676bc commit 0a68e52
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 0 additions & 1 deletion services/databases/mongodb/deploy-mongodb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,3 @@ helm upgrade --install community-operator mongodb/community-operator \
--namespace mongodb \
--create-namespace \
--values "$(dirname "$0")/values.yaml"

3 changes: 2 additions & 1 deletion services/pulumi/utils/pulumi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,6 @@ type FlattenArrayIntoObject<T extends readonly pulumi.Inputs[]> =

export function concat<const T extends pulumi.Input<readonly pulumi.Input<pulumi.Inputs>[]>>(values: T) {
return pulumi.output(values)
.apply(values => Object.assign({}, ...values.map(val => structuredClone(val))) as FlattenArrayIntoObject<pulumi.Unwrap<T>>);
.apply(values => Object.assign({}, ...values) as FlattenArrayIntoObject<pulumi.Unwrap<T>>)
.apply(val => structuredClone(val)); // structuredClone is needed to ensure values remains readonly
}

0 comments on commit 0a68e52

Please sign in to comment.