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

Function clearSecretsFromChoice

src/utils/userScriptSecrets.ts:799–820  ·  view source on GitHub ↗
(
	app: App | undefined,
	choice: unknown,
)

Source from the content-addressed store, hash-verified

797}
798
799async function clearSecretsFromChoice(
800 app: App | undefined,
801 choice: unknown,
802): Promise<boolean> {
803 if (!isRecord(choice)) return true;
804
805 let cleared = true;
806
807 if (choice.type === "Macro" && isRecord(choice.macro)) {
808 cleared =
809 (await clearUserScriptSecretsFromCommands(app, choice.macro.commands)) &&
810 cleared;
811 }
812
813 if (choice.type === "Multi" && Array.isArray(choice.choices)) {
814 for (const child of choice.choices) {
815 cleared = (await clearSecretsFromChoice(app, child)) && cleared;
816 }
817 }
818
819 return cleared;
820}
821
822export async function clearUserScriptSecretsFromCommand(
823 app: App | undefined,

Callers 1

Calls 2

isRecordFunction · 0.70

Tested by

no test coverage detected