]> git.ardis.lu - static-encrypt/commitdiff
Add help to globalThis during definition
authorArdis Lu <ardisglu@gmail.com>
Fri, 30 Jun 2023 04:25:30 +0000 (21:25 -0700)
committerArdis Lu <ardisglu@gmail.com>
Fri, 30 Jun 2023 04:25:30 +0000 (21:25 -0700)
index.html

index a999a2d2bd4500088f3cb2920a4d4ad2f94c7093..88908ed15a400a30f586df52a23894f1310d9f9b 100644 (file)
     const template = await fetch('/template.html').then(r => r.text());
 
     // For debugging and bulk usage in the DevTools console
-    function help() {
+    globalThis.help = function () {
       console.table({
         'help(): void': 'Print this message.',
         'encrypt(plaintext: string, password: string): Promise<string>': 'Encrypt a string.',
         'decrypt(content: string, password: string): Promise<string>': 'Decrypt an encrypted string.'
       });
     }
-    globalThis.help = help;
     globalThis.encrypt = encrypt;
     globalThis.decrypt = decrypt;
     help();
This page took 0.033144 seconds and 4 git commands to generate.