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

Function clearUserScriptSecretsFromCommand

src/utils/userScriptSecrets.ts:822–847  ·  view source on GitHub ↗
(
	app: App | undefined,
	command: unknown,
)

Source from the content-addressed store, hash-verified

820}
821
822export async function clearUserScriptSecretsFromCommand(
823 app: App | undefined,
824 command: unknown,
825): Promise<boolean> {
826 if (!isRecord(command)) return true;
827
828 let cleared = true;
829
830 if (command.type === "UserScript") {
831 cleared = (await clearRefsFromSettings(app, command.settings)) && cleared;
832 }
833
834 if (Array.isArray(command.thenCommands)) {
835 cleared =
836 (await clearUserScriptSecretsFromCommands(app, command.thenCommands)) &&
837 cleared;
838 }
839 if (Array.isArray(command.elseCommands)) {
840 cleared =
841 (await clearUserScriptSecretsFromCommands(app, command.elseCommands)) &&
842 cleared;
843 }
844
845 cleared = (await clearSecretsFromChoice(app, command.choice)) && cleared;
846 return cleared;
847}
848
849export async function clearUserScriptSecretsFromCommands(
850 app: App | undefined,

Calls 4

clearRefsFromSettingsFunction · 0.85
clearSecretsFromChoiceFunction · 0.85
isRecordFunction · 0.70

Tested by

no test coverage detected