MCPcopy Create free account
hub / github.com/TanStack/cli / populateAddOnOptionsDefaults

Function populateAddOnOptionsDefaults

packages/create/src/add-ons.ts:110–126  ·  view source on GitHub ↗
(
  chosenAddOns: Array<AddOn>,
)

Source from the content-addressed store, hash-verified

108}
109
110export 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}

Callers 5

promptForCreateOptionsFunction · 0.90
normalizeOptionsFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected