ramda-extension
Version:
Helpful functions built on top of the mighty Ramda
23 lines (22 loc) • 688 B
JavaScript
import { useWith, toUpper, endsWith } from 'ramda';
/**
* Testing string if ends with some suffix ignoring case.
*
* @func
* @category String
*
* @param {string} suffix
* @param {string} x
* @return {boolean} True if `x` ends with `suffix` ignore case
*
* @example
*
* R_.endsWithSuffixIgnoreCase('o', 'HELLO') // true
* R_.endsWithSuffixIgnoreCase('ELLO', 'hello') // true
* R_.endsWithSuffixIgnoreCase('hello', 'hello') // true
* R_.endsWithSuffixIgnoreCase('o', 'good bye') // false
*
* @sig a -> b -> Boolean
*/
var endsWithSuffixIgnoreCase = /*#__PURE__*/useWith(endsWith, [toUpper, toUpper]);
export default endsWithSuffixIgnoreCase;