wix-style-react
Version:
wix-style-react
23 lines (19 loc) • 681 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.includesCaseInsensitive = includesCaseInsensitive;
var isString = exports.isString = function isString(a) {
return typeof a === 'string';
};
/**
* a includes b (with case insensitive matching)
*/
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 = exports.StringUtils = {
includesCaseInsensitive: includesCaseInsensitive
};