diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2020-03-15 15:31:55 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-15 15:31:55 +0100 |
commit | dc6e0c3591709d6f8887bb672af1de54dfc8a974 (patch) | |
tree | 0239d62e419b840f1c4e5cd631a7b87689ed2a3b /cli/js/globals.ts | |
parent | ec3f44581bf4312cbbe36b71daca7f0474177cf3 (diff) |
feat: Deno.core.{encode,decode}; standalone UTF-8 encoding/decoding (#4349)
This commits add two new methods to "Deno.core" namespace: "encode" and "decode".
Those methods are bound in Rust to provide a) fast b) generally available of encoding and decoding UTF-8 strings.
Both methods are now used in "cli/js/dispatch_json.ts".
Diffstat (limited to 'cli/js/globals.ts')
-rw-r--r-- | cli/js/globals.ts | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/cli/js/globals.ts b/cli/js/globals.ts index 8d122878f..21ce7e619 100644 --- a/cli/js/globals.ts +++ b/cli/js/globals.ts @@ -97,6 +97,9 @@ declare global { evalContext(code: string): [any, EvalErrorInfo | null]; formatError: (e: Error) => string; + + decode(bytes: Uint8Array): string; + encode(text: string): Uint8Array; } // Only `var` variables show up in the `globalThis` type when doing a global |