( app: App | undefined, command: unknown, )
| 820 | } |
| 821 | |
| 822 | export 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 | |
| 849 | export async function clearUserScriptSecretsFromCommands( |
| 850 | app: App | undefined, |
no test coverage detected