import { record } from "https://deno.land/x/fun@v2.0.0/decoder.ts";
A decoder against a record with string keys and values that match the items decoder.
Examples
Example 1
Example 1
import * as D from "./decoder.ts";
const strings = D.record(D.string);
const result1 = strings(null); // Left(DecodeError)
const result2 = strings({}); // Right({})
const result3 = strings([]); // Right({})
const result4 = strings({"one": 1}); // Left(DecodeError)
const result5 = strings({ one: "one" }); // Right({ one: "one" })
Returns
Decoder<unknown, ReadonlyRecord<A>>