UNPKG

@kelvininc/ui-components

Version:
32 lines (27 loc) 886 B
'use strict'; var isEmpty = require('./isEmpty-CqcsgK-A.js'); const isValidLabel = (label) => { return !isEmpty.isEmpty(label === null || label === void 0 ? void 0 : label.trim()); }; const getUTF8StringLength = (label) => { return label ? [...label].length : 0; }; const isSubString = (term, string, caseSensitive = false) => { if (term.length === 0) { return true; } if (caseSensitive) { return string.includes(term); } return string.toLocaleLowerCase().includes(term.toLocaleLowerCase()); }; var string_helper = /*#__PURE__*/Object.freeze({ __proto__: null, getUTF8StringLength: getUTF8StringLength, isSubString: isSubString, isValidLabel: isValidLabel }); exports.getUTF8StringLength = getUTF8StringLength; exports.isSubString = isSubString; exports.isValidLabel = isValidLabel; exports.string_helper = string_helper;