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

Function stripUserScriptSecretRefsFromCommand

src/utils/userScriptSecrets.ts:899–921  ·  view source on GitHub ↗
(
	command: unknown,
	options?: UserScriptSecretSanitizerOptions,
)

Source from the content-addressed store, hash-verified

897}
898
899export function stripUserScriptSecretRefsFromCommand(
900 command: unknown,
901 options?: UserScriptSecretSanitizerOptions,
902): void {
903 if (!isRecord(command)) return;
904
905 if (command.type === "UserScript") {
906 stripSecretRefsFromSettings(
907 command.settings,
908 getSecretOptionNamesForCommand(command, options),
909 options,
910 );
911 }
912
913 if (Array.isArray(command.thenCommands)) {
914 stripUserScriptSecretRefsFromCommands(command.thenCommands, options);
915 }
916 if (Array.isArray(command.elseCommands)) {
917 stripUserScriptSecretRefsFromCommands(command.elseCommands, options);
918 }
919
920 stripUserScriptSecretRefsFromChoice(command.choice, options);
921}
922
923export function stripUserScriptSecretRefsFromCommands(
924 commands: unknown,

Callers 3

remapCommandsFunction · 0.90

Tested by

no test coverage detected