From 32ac4ec2523e7226cecbf73a1708cd36ea3b3eb1 Mon Sep 17 00:00:00 2001 From: Louis Pilfold Date: Fri, 10 Sep 2021 18:54:41 +0100 Subject: JS list decoding --- src/gleam_stdlib.js | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/gleam_stdlib.js') diff --git a/src/gleam_stdlib.js b/src/gleam_stdlib.js index 47801ce..500066d 100644 --- a/src/gleam_stdlib.js +++ b/src/gleam_stdlib.js @@ -527,3 +527,7 @@ export function tuple_get(data, index) { ? new Ok(data[index]) : new Error(Nil); } + +export function decode_list(data) { + return List.isList(data) ? new Ok(data) : decoder_error("List", data); +} -- cgit v1.2.3