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