diff options
Diffstat (limited to 'test/gleam_stdlib_test_ffi.mjs')
-rwxr-xr-x | test/gleam_stdlib_test_ffi.mjs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/gleam_stdlib_test_ffi.mjs b/test/gleam_stdlib_test_ffi.mjs index c859093..986258d 100755 --- a/test/gleam_stdlib_test_ffi.mjs +++ b/test/gleam_stdlib_test_ffi.mjs @@ -10,3 +10,18 @@ export function uint8array(list) { export function get_null() { return null; } + +export function object(items) { + const object = {}; + for (const [k, v] of items) { + object[k] = v; + } + return object; +} +export function map(items) { + const object = new Map(); + for (const [k, v] of items) { + object.set(k, v); + } + return object; +} |