From 4cdbf54237feb9b7fb855599173528deb0313c16 Mon Sep 17 00:00:00 2001 From: tynanbe Date: Mon, 27 Jun 2022 15:49:50 -0500 Subject: Let `decode_list` succeed with arrays --- src/gleam_stdlib.mjs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/gleam_stdlib.mjs') diff --git a/src/gleam_stdlib.mjs b/src/gleam_stdlib.mjs index dac8d58..a612367 100644 --- a/src/gleam_stdlib.mjs +++ b/src/gleam_stdlib.mjs @@ -576,6 +576,9 @@ export function tuple_get(data, index) { } export function decode_list(data) { + if (Array.isArray(data)) { + return new Ok(List.fromArray(data)); + } return List.isList(data) ? new Ok(data) : decoder_error("List", data); } -- cgit v1.2.3