import { decoder } from "https://deno.land/x/fun@v2.0.0/mod.ts";
const { array } = decoder;
A decoder against an array with only values that adhere to the passed in items decoder.
Examples
Example 1
Example 1
import * as D from "./decoder.ts";
const strings = D.array(D.string);
const result1 = strings(null); // Left(DecodeError)
const result2 = strings({}); // Left(DecodeError)
const result3 = strings([]); // Right([])
const result4 = strings([1, 2, 3]); // Left(DecodeError)
const result5 = strings(["one", "two"]); // Right(["one", "two"])