- select(): Chainable<AnonymousSelectP, "select" | "or" | "and">
Returns Chainable<AnonymousSelectP, "select" | "or" | "and">
- select<input, const patternOrKey>(patternOrKey): patternOrKey extends string
? Chainable<SelectP<patternOrKey, "select" | "or" | "and">>
: Chainable<SelectP<symbols.anonymousSelectKey, input, patternOrKey>, "select" | "or" | "and"> Type Parameters
- input
- const patternOrKey extends undefined | null | string | number | bigint | boolean | symbol | readonly [] | readonly [unknown, unknown] | readonly [unknown, unknown] | {
[k: string]: unknown;
} | UnknownMatcher | readonly UnknownPattern[] | readonly [UnknownPattern, UnknownPattern] | readonly [UnknownPattern, UnknownPattern] | PatternMatcher<input> | {
readonly [k in string | number | symbol]?: Pattern<Readonly<MergeUnion<Exclude<input, readonly any[] | Primitives | Map<any, any> | Set<any>>>>[k]>
}
Returns patternOrKey extends string
? Chainable<SelectP<patternOrKey, "select" | "or" | "and">>
: Chainable<SelectP<symbols.anonymousSelectKey, input, patternOrKey>, "select" | "or" | "and">
- select<input, const pattern, const k>(key, pattern): Chainable<SelectP<k, input, pattern>, "select" | "or" | "and">
Type Parameters
- input
- const pattern extends undefined | null | string | number | bigint | boolean | symbol | readonly [] | readonly [unknown, unknown] | readonly [unknown, unknown] | {
[k: string]: unknown;
} | UnknownMatcher | readonly UnknownPattern[] | readonly [UnknownPattern, UnknownPattern] | readonly [UnknownPattern, UnknownPattern] | PatternMatcher<input> | {
readonly [k in string | number | symbol]?: Pattern<Readonly<MergeUnion<Exclude<input, readonly any[] | Primitives | Map<any, any> | Set<any>>>>[k]>
} - const k extends string
Returns Chainable<SelectP<k, input, pattern>, "select" | "or" | "and">
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