import { RecordAsserter } from "https://deno.land/x/typeguardkit@0.33.0/mod.ts";
A RecordAsserter
is an Asserter
for the Record
type defined by its
keyAsserter
and valueAsserter
.
The provided keyAsserter
and valueAsserter
are made accessible as
properties of the created RecordAsserter
.
The record
function can be used to create a RecordAsserter
without
specifying a typeName
.
Example:
import { _string, Asserted, RecordAsserter } from "typeguardkit";
export const _RecordOfStringByString = new RecordAsserter(
"RecordOfStringByString",
[_string, _string],
);
export type RecordOfStringByString = Asserted<
typeof _RecordOfStringByString
>;
Constructors
new
RecordAsserter(typeName: string, unnamed 1: [KeyAsserter, ValueAsserter])Methods
assert(value: unknown, valueName?: string): Record<Asserted<KeyAsserter>, Asserted<ValueAsserter>>