@pleisto/active-support
    Preparing search index...

    Function select

    • 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

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

      match<{ age: number }>(value)
      .with({ age: P.select() }, (age) => 'age: number'
      )
    • 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

      Type Parameters

      • input
      • const patternOrKey extends
            | undefined
            | null
            | string
            | number
            | bigint
            | boolean
            | symbol
            | readonly []
            | readonly [unknown, unknown]
            | readonly [unknown, unknown]
            | UnknownProperties
            | UnknownMatcher
            | readonly UnknownPattern[]
            | readonly [UnknownPattern, UnknownPattern]
            | readonly [UnknownPattern, UnknownPattern]
            | PatternMatcher<input>
            | {
                readonly [k in string | number | symbol]?: Pattern.Pattern<
                    Readonly<
                        MergeUnion<
                            Exclude<
                                input,
                                readonly any[]
                                | Primitives
                                | Map<any, any>
                                | Set<any>,
                            >,
                        >,
                    >[k],
                >
            }

      Parameters

      Returns patternOrKey extends string
          ? Chainable<
              SelectP<patternOrKey<patternOrKey>, "and" | "or" | "select">,
          >
          : Chainable<
              SelectP<"@ts-pattern/anonymous-select-key", input, patternOrKey>,
              "and" | "or" | "select",
          >

      match<{ age: number }>(value)
      .with({ age: P.select() }, (age) => 'age: number'
      )
    • 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

      Type Parameters

      • input
      • const pattern extends
            | undefined
            | null
            | string
            | number
            | bigint
            | boolean
            | symbol
            | readonly []
            | readonly [unknown, unknown]
            | readonly [unknown, unknown]
            | UnknownProperties
            | UnknownMatcher
            | readonly UnknownPattern[]
            | readonly [UnknownPattern, UnknownPattern]
            | readonly [UnknownPattern, UnknownPattern]
            | PatternMatcher<input>
            | {
                readonly [k in string | number | symbol]?: Pattern.Pattern<
                    Readonly<
                        MergeUnion<
                            Exclude<
                                input,
                                readonly any[]
                                | Primitives
                                | Map<any, any>
                                | Set<any>,
                            >,
                        >,
                    >[k],
                >
            }
      • const k extends string

      Parameters

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

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