std
    Preparing search index...

    Function endsWithOneOf

    • Returns the matched suffix for the string (if it exists). Great for matching string union types.

      Type Parameters

      • T extends string

      Parameters

      • str: string
      • strings: readonly T[]

      Returns undefined | T

      endsWithOneOf('cb', 'a', 'b'); // 'b'
      endsWithOneOf('cc', 'a', 'b'); // undefined