@kelvininc/ui-components
Version:
Kelvin UI Components
17 lines (16 loc) • 527 B
JavaScript
import { isEmpty } from "lodash-es";
export const isValidLabel = (label) => {
return !isEmpty(label === null || label === void 0 ? void 0 : label.trim());
};
export const getUTF8StringLength = (label) => {
return label ? [...label].length : 0;
};
export const isSubString = (term, string, caseSensitive = false) => {
if (term.length === 0) {
return true;
}
if (caseSensitive) {
return string.includes(term);
}
return string.toLocaleLowerCase().includes(term.toLocaleLowerCase());
};