diff options
author | bptato <nincsnevem662@gmail.com> | 2023-10-21 23:34:56 +0200 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2023-10-21 23:40:24 +0200 |
commit | 18008acc141a55449b28c1af487a080c4bbcb355 (patch) | |
tree | a81872bfc2e2add0b0c9b6f65f3be15f4d2790c8 /src/local/client.nim | |
parent | 69870f3b974e65d61b564b396e01d21cc023e6e9 (diff) | |
download | chawan-18008acc141a55449b28c1af487a080c4bbcb355.tar.gz |
base64: reduce pointless re-coding using JSString
We now expose some functions from QuickJS to interact with JavaScript strings without re-encoding them into UTF-8.
Diffstat (limited to 'src/local/client.nim')
-rw-r--r-- | src/local/client.nim | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/local/client.nim b/src/local/client.nim index 9cff0f2f..906c5bee 100644 --- a/src/local/client.nim +++ b/src/local/client.nim @@ -34,6 +34,7 @@ import js/fromjs import js/intl import js/javascript import js/module +import js/strings import js/timeout import js/tojs import loader/headers @@ -613,10 +614,10 @@ proc jsCollect(client: Client) {.jsfunc.} = proc sleep(client: Client, millis: int) {.jsfunc.} = sleep millis -proc atob(client: Client, data: string): DOMResult[string] {.jsfunc.} = +proc atob(client: Client, data: string): DOMResult[NarrowString] {.jsfunc.} = return atob(data) -proc btoa(client: Client, data: string): DOMResult[string] {.jsfunc.} = +proc btoa(client: Client, data: JSString): DOMResult[string] {.jsfunc.} = return btoa(data) func line(client: Client): LineEdit {.jsfget.} = |