( app: App | undefined, choice: unknown, )
| 797 | } |
| 798 | |
| 799 | async 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 | |
| 822 | export async function clearUserScriptSecretsFromCommand( |
| 823 | app: App | undefined, |
no test coverage detected