diff options
Diffstat (limited to 'src/gleam_stdlib.mjs')
-rw-r--r-- | src/gleam_stdlib.mjs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gleam_stdlib.mjs b/src/gleam_stdlib.mjs index bbbd06a..102158c 100644 --- a/src/gleam_stdlib.mjs +++ b/src/gleam_stdlib.mjs @@ -616,6 +616,10 @@ export function decode_tuple(data) { return Array.isArray(data) ? new Ok(data) : decoder_error("Tuple", data); } +export function list_to_tuple(data) { + return List.isList(data) ? new Ok([...data]) : decoder_error("List", data); +} + export function tuple_get(data, index) { return index >= 0 && data.length > index ? new Ok(data[index]) |