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

x/ts_matches/src/matches.ts>arrayOf

Being able to pattern match in typescript
Go to Latest
function arrayOf
Re-export
import { arrayOf } from "https://deno.land/x/ts_matches@v5.2.0/src/matches.ts";

We would like to validate that all of the array is of the same type

Parameters

validator: Parser<unknown, A>

What is the validator for the values in the array

Returns

Parser<unknown, A[]>