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