wix-style-react
Version:
28 lines (22 loc) • 755 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.includesCaseInsensitive = includesCaseInsensitive;
exports.StringUtils = exports.isString = void 0;
var isString = function isString(a) {
return typeof a === 'string';
};
/**
* a includes b (with case insensitive matching)
*/
exports.isString = isString;
function includesCaseInsensitive() {
var a = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
var b = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
return [a, b].every(isString) && (!b || a.toLowerCase().indexOf(b.toLowerCase()) !== -1);
}
var StringUtils = {
includesCaseInsensitive: includesCaseInsensitive
};
exports.StringUtils = StringUtils;