Endo
    Preparing search index...

    Function matches

    • Type-narrowing matches: narrows specimen in if-blocks.

      This declaration overlays the runtime matches from patternMatchers.js with a type-predicate signature. The base runtime signature (specimen: unknown, patt: Pattern) => boolean is verified as a supertype in types-index.js.

      Type Parameters

      Parameters

      • specimen: any

        The value to test.

      • patt: P

        The pattern to match against.

      Returns specimen is TypeFromPattern<P>

      if (matches(value, M.string())) {
      value; // narrowed to string
      }