about summary refs log tree commit diff stats
path: root/src/js/base64.nim
Commit message (Collapse)AuthorAgeFilesLines
* data: replace std/base64 with atobbptato2024-04-251-64/+4
| | | | | | | | | | std's version is known to be broken on versions we still support, and it makes no sense to use different decoders anyway. (This does introduce a bit of a dependency hell, because js/base64 depends on js/javascript which tries to bring in the entire QuickJS runtime. So we move that out into twtstr, and manually convert a Result[string, string] to DOMException in js/base64.)
* base64: rewrite btoa toobptato2024-04-211-3/+39
| | | | why not
* base64: rewrite atobbptato2024-04-211-6/+65
| | | | | | | | | Turns out std/base64's `decode' is broken: atob(" ") would panic. So we no longer use that. Basic testing indicates that the new version is closer to the standard- mandated behavior than the old one was. OTOH I assume it's somewhat slower, but that can be improved later if it proves to be a bottleneck.
* Update code stylebptato2024-04-171-1/+1
| | | | | | * separate params with ; (semicolon) instead of , (colon) * reduce screaming snake case use * wrap long lines
* quickjs: reduce diff with upstreambptato2024-03-021-1/+8
| | | | | | * the uint8array thing is probably from txiki.js, but we never used it * upstream now has JS_GetClassID, importing that instead... (so this commit won't build :/)
* Use errDOMException template everywherebptato2024-01-111-4/+4
|
* js: merge some type modules into jstypesbptato2024-01-111-1/+1
| | | | They only had type definitions, no need to put them in separate modules.
* base64: reduce pointless re-coding using JSStringbptato2023-10-211-35/+16
| | | | | We now expose some functions from QuickJS to interact with JavaScript strings without re-encoding them into UTF-8.
* move around more modulesbptato2023-09-141-1/+1
| | | | | | | | | | * ips -> io/ * loader related stuff -> loader/ * tempfile -> extern/ * buffer, forkserver -> server/ * lineedit, window -> display/ * cell -> types/ * opt -> types/
* atob, btoa: handle latin-1 correctlybptato2023-09-081-12/+36
|
* Add btoa, atobbptato2023-09-071-0/+24