MCPcopy Create free account
hub / github.com/chhoumann/quickadd / initSharedVariables

Method initSharedVariables

src/engine/MacroChoiceEngine.ts:222–240  ·  view source on GitHub ↗
(
		choiceExecutor: IChoiceExecutor,
		providedVariables?: Map<string, unknown>
	)

Source from the content-addressed store, hash-verified

220 }
221
222 private initSharedVariables(
223 choiceExecutor: IChoiceExecutor,
224 providedVariables?: Map<string, unknown>
225 ): Map<string, unknown> {
226 const existingVariables = choiceExecutor.variables;
227
228 if (providedVariables) {
229 if (existingVariables && providedVariables !== existingVariables) {
230 existingVariables.forEach((value, key) => {
231 if (!providedVariables.has(key)) {
232 providedVariables.set(key, value);
233 }
234 });
235 }
236 return providedVariables;
237 }
238
239 return existingVariables ?? new Map<string, unknown>();
240 }
241
242 constructor(
243 app: App,

Callers 1

constructorMethod · 0.95

Calls 1

setMethod · 0.45

Tested by

no test coverage detected