etf_js/decode

Functions

pub fn loose_string() -> Decoder(String)

Decodes both JS strings and utf-8 BitArrays.

This is required because in Gleam’s Erlang target, strings are represented as BitArrays, but in the JavaScript target, they are regular JS strings.

Since charlists are also returned as bit arrays, this will also convert charlists to strings (if they are valid strings).

Search Document