• A bus factory that allows a bus to be wrapped in a Vector.

    Example

    import * as io from "@prelude-io/core";

    const optionalNumber = io.Vector(io.number);

    console.log(await optionalNumber.deserialize([1, 2, 3])); // => IORight containing `Vector(1, 2, 3)`
    console.log(await optionalNumber.deserialize(["one", "two", "three"])); // => IOLeft containing errors
    console.log(await optionalNumber.deserialize([])); // => IORight containing `Vector()`

    Type Parameters

    • I

      Inner bus' input.

    • O

      Inner bus' output. This is transformed to Vector<O> in the newly created bus.

    Parameters

    • innerBus: Bus<I, O>
    • name: string = ...

    Returns Bus<I[], Vector<O>>

Generated using TypeDoc