import { decoder } from "https://deno.land/x/fun@v2.0.0/mod.ts";
const { combine } = decoder;
Combine two DecodeErrors into one. If both DecodeErrors are Unions then they are merged into a Union, if they are both Intersections then are merged into an Intersection, otherwise they are wrapped in a Many.
Examples
Example 1
Example 1
import * as D from "./decoder.ts";
import { pipe } from "./fn.ts";
const result = pipe(
D.leafErr(1, "string"),
D.combine(D.leafErr("hello", "number")),
); // Many[Leaf, Leaf]
Parameters
second: DecodeError
Returns
(first: DecodeError) => DecodeError