MCPcopy Create free account
hub / github.com/Shitanshukumar607/Drawspace / mergeWithDefaults

Function mergeWithDefaults

context/toolPropertiesStore.ts:180–189  ·  view source on GitHub ↗
(
  tool: K,
  existing?: Partial<ToolPropertiesMap[K]>
)

Source from the content-addressed store, hash-verified

178 * Only the supported fields are returned (i.e. defaults auto-fill only valid fields).
179 */
180const mergeWithDefaults = <K extends ToolKey>(
181 tool: K,
182 existing?: Partial<ToolPropertiesMap[K]>
183): ToolPropertiesMap[K] => {
184 const defaults = getDefaultForTool(tool) as ToolPropertiesMap[K];
185 return {
186 ...defaults,
187 ...(existing ?? {}),
188 } as ToolPropertiesMap[K];
189};
190
191/**
192 * Create the store

Callers 1

Calls 1

getDefaultForToolFunction · 0.85

Tested by

no test coverage detected