Skip to main content
Module

x/fuzzy_octo_guacamole/mod.ts>P.map

A playground for testing CI setup that deploys on Deno and NPM
Latest
function P.map
import { P } from "https://deno.land/x/fuzzy_octo_guacamole@v5.0.1/mod.ts";
const { map } = P;

P.set(subpattern) takes a sub pattern and returns a pattern that matches sets if all their elements match the sub pattern.

Read P.set documentation on GitHub

Examples

match(value) .with({ users: P.set(P.string) }, () => 'will match Set')

Returns

Chainable<MapP<input, unknown, unknown>>

Type Parameters

input
pkey extends Pattern<WithDefault<UnwrapMapKey<input>, unknown>>
pvalue extends Pattern<WithDefault<UnwrapMapValue<input>, unknown>>

Parameters

patternKey: pkey
patternValue: pvalue

Returns

Chainable<MapP<input, pkey, pvalue>>