Skip to main content
Deno 2 is finally here 🎉️
Learn more
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.33.0/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