FuncType - v0.8.85
    Preparing search index...

    Variable MatchableUtilsConst

    MatchableUtils: {
        default: <A, R>(handler: (value: A) => R) => (value: A) => R;
        when: <A, R>(
            predicate: (value: A) => boolean,
            handler: (value: A) => R,
        ) => (value: A) => undefined | R;
    } = ...

    Utility functions for working with Matchable data structures

    Type declaration

    • default: <A, R>(handler: (value: A) => R) => (value: A) => R

      Helper function to create a default case for pattern matching

    • when: <A, R>(
          predicate: (value: A) => boolean,
          handler: (value: A) => R,
      ) => (value: A) => undefined | R

      Helper function to create a match pattern that guards based on a predicate