onrails
    Preparing search index...
    • Guard pattern for match.with.

      Accepts plain boolean guards ((x) => x.length > 0) or TS type-predicate guards ((x): x is Foo => ...). For type predicates, the matched handler's input is narrowed to the predicate's target type via Narrow.

      Type Parameters

      • T
      • U

      Parameters

      • guard: (input: T) => input is U

      Returns (input: T) => input is U

    • Guard pattern for match.with.

      Accepts plain boolean guards ((x) => x.length > 0) or TS type-predicate guards ((x): x is Foo => ...). For type predicates, the matched handler's input is narrowed to the predicate's target type via Narrow.

      Type Parameters

      • T

      Parameters

      • guard: (input: T) => boolean

      Returns Pattern<T>