( chosenAddOns: Array<AddOn>, )
| 108 | } |
| 109 | |
| 110 | export function populateAddOnOptionsDefaults( |
| 111 | chosenAddOns: Array<AddOn>, |
| 112 | ): Record<string, Record<string, any>> { |
| 113 | const addOnOptions: Record<string, Record<string, any>> = {} |
| 114 | |
| 115 | for (const addOn of chosenAddOns) { |
| 116 | if (addOn.options) { |
| 117 | const defaults: Record<string, any> = {} |
| 118 | for (const [optionKey, optionDef] of Object.entries(addOn.options)) { |
| 119 | defaults[optionKey] = optionDef.default |
| 120 | } |
| 121 | addOnOptions[addOn.id] = defaults |
| 122 | } |
| 123 | } |
| 124 | |
| 125 | return addOnOptions |
| 126 | } |
no outgoing calls
no test coverage detected