Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/typeguardkit/mod.ts>array

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

array can be used to create an ArrayAsserter without specifying a typeName or ArrayAsserterOptions.

Example:

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

export const _ArrayOfString = array(_string);

export type ArrayOfString = Asserted<typeof _ArrayOfString>;

Type Parameters

ElementAsserter extends Asserter<unknown>

Parameters

elementAsserter: ElementAsserter