Skip to main content
Module

x/fuzzy_octo_guacamole/mod.ts>P.select

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

P.select() is a pattern which will always match, and will inject the selected piece of input in the handler function.

Read the documentation for P.select on GitHub

Examples

match<{ age: number }>(value) .with({ age: P.select() }, (age) => 'age: number' )

Returns

Chainable<AnonymousSelectP, "select" | "or" | "and">

Type Parameters

input
patternOrKey extends string | (unknown extends input ? UnknownPattern : Pattern<input>)

Returns

patternOrKey extends string ? Chainable<SelectP<patternOrKey, "select" | "or" | "and">> : Chainable<SelectP<symbols.anonymousSelectKey, input, patternOrKey>, "select" | "or" | "and">

Type Parameters

input
p extends unknown extends input ? UnknownPattern : Pattern<input>
k extends string

Parameters

key: k
pattern: p

Returns

Chainable<SelectP<k, input, p>, "select" | "or" | "and">