diff options
Diffstat (limited to 'src/gleam_stdlib.js')
-rw-r--r-- | src/gleam_stdlib.js | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/gleam_stdlib.js b/src/gleam_stdlib.js index 4a3026c..4c52daf 100644 --- a/src/gleam_stdlib.js +++ b/src/gleam_stdlib.js @@ -1,12 +1,13 @@ import { - Ok, + BitString, Error, List, - BitString, + Ok, + Result, UtfCodepoint, - toBitString, - stringBits, inspect, + stringBits, + toBitString, } from "./gleam.js"; import { CompileError as RegexCompileError, @@ -532,6 +533,10 @@ export function decode_list(data) { return List.isList(data) ? new Ok(data) : decoder_error("List", data); } +export function decode_result(data) { + return Result.isResult(data) ? new Ok(data) : decoder_error("Result", data); +} + export function decode_map(data) { return data instanceof Map ? new Ok(data) : decoder_error("Map", data); } |