A bus that passes an object or an iterable of key/value pairs through Object.entries or Object.fromEntries respectively.
import * as io from "@prelude-io/core";// => IORight containing `[["foo", 2], ["bar", 6]]`console.log(io.objectEntries.deserialize({ foo: 2, bar: 6 }));// => IORight containing `{ foo: 2, bar: 6 }`console.log( io.objectEntries.serialize([ ["foo", 2], ["bar", 6], ])); Copy
import * as io from "@prelude-io/core";// => IORight containing `[["foo", 2], ["bar", 6]]`console.log(io.objectEntries.deserialize({ foo: 2, bar: 6 }));// => IORight containing `{ foo: 2, bar: 6 }`console.log( io.objectEntries.serialize([ ["foo", 2], ["bar", 6], ]));
When chaining this with io.HashMap, you will likely need to provide a type hint for the object's value type:
(io.objectEntries as io.ObjectEntriesBus<number>).chain( io.HashMap(io.string, io.number)); Copy
(io.objectEntries as io.ObjectEntriesBus<number>).chain( io.HashMap(io.string, io.number));
Generated using TypeDoc
A bus that passes an object or an iterable of key/value pairs through Object.entries or Object.fromEntries respectively.
Example
When chaining this with io.HashMap, you will likely need to provide a type hint for the object's value type: