• Returns whether the given string ends with any of the suffixes

    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

    endsWithAny('foobar', ['foo', 'bar']);    // true
    endsWithAny('hello', ['foo', 'bar']); // false