UNPKG

@kelvininc/ui-components

Version:
17 lines (16 loc) 527 B
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()); };