Function endsWithAnyIgnoreCase

  • Returns whether the given string ends with any of the suffixes, case-insensitive

    Parameters

    • Optionaltext: null | string

      the source string to check

    • Optionalsuffixes: (undefined | null | string)[]

      the target strings to compare

    Returns boolean

    whether the given string ends with any of the suffixes, case-insensitive

    endsWithAnyIgnoreCase('foobar', ['FOO', 'BAR']);    // true
    endsWithAnyIgnoreCase('hello', ['FOO', 'BAR']); // false