DENO 2 related issue. Update helper.ts #48
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
update base64_to_binary function .
In browser JavaScript, atob() is used to decode a base64-encoded string. It's part of the Web APIs, which aren't natively available in Deno's runtime environment.
After enabling DENO_FUTURE=1 we now get thsi error :
error: Uncaught (in promise) ReferenceError: window is not defined
let binaryString = window.atob(b);
^
at base64_to_binary (https://deno.land/x/[email protected]/src/helper.ts:60:22)
at rsa_import_pem_public (https://deno.land/x/[email protected]/src/rsa/import_key.ts:132:16)
at rsa_import_pem (https://deno.land/x/[email protected]/src/rsa/import_key.ts:160:50)
at rsa_import_key (https://deno.land/x/[email protected]/src/rsa/import_key.ts:179:37)
at Function.importKey (https://deno.land/x/[email protected]/src/rsa/mod.ts:102:23)
at Function.parseKey (https://deno.land/x/[email protected]/src/rsa/mod.ts:89:17)
atob() is a global function in browser environments, typically accessed via window.atob(). In Deno, especially with DENO_FUTURE=1, this global function isn't available by default.