diff options
author | tynanbe <contact@tynan.be> | 2022-06-27 15:49:50 -0500 |
---|---|---|
committer | Louis Pilfold <louis@lpil.uk> | 2022-06-27 22:19:30 +0100 |
commit | 4cdbf54237feb9b7fb855599173528deb0313c16 (patch) | |
tree | 65d7cc7e54d5b2959d31371fe1fd4af894119db3 /src/gleam_stdlib.mjs | |
parent | 402040ddad97b046e6d215d1efc49b6920315a87 (diff) | |
download | gleam_stdlib-4cdbf54237feb9b7fb855599173528deb0313c16.tar.gz gleam_stdlib-4cdbf54237feb9b7fb855599173528deb0313c16.zip |
Let `decode_list` succeed with arrays
Diffstat (limited to 'src/gleam_stdlib.mjs')
-rw-r--r-- | src/gleam_stdlib.mjs | 3 |
1 files changed, 3 insertions, 0 deletions
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); } |