Skip to main content
Module

x/typeguardkit/mod.ts>record

A TypeScript module to help construct type assertion functions and type guards.
Latest
function record
import { record } from "https://deno.land/x/typeguardkit@0.32.1/mod.ts";

record can be used to create a RecordAsserter without specifying a typeName.

Example:

import { _string, Asserted, record } from "typeguardkit";

export const _RecordOfStringByString = record(_string, _string);

export type RecordOfStringByString = Asserted<
  typeof _RecordOfStringByString
>;

Type Parameters

KeyAsserter extends Asserter<string>
ValueAsserter extends Asserter<unknown>

Parameters

keyAsserter: KeyAsserter
valueAsserter: ValueAsserter