import { getValueByKeys } from "../../utils/index.js";
import { isNumber, isString } from "@pisell/utils";
//#region src/components/table/Table/fields/search/filterUtil/index.ts
function filterUtil_default({ value, key, item }) {
	if (!isString(value)) return true;
	const lowerCaseValue = value.toLowerCase();
	if (key === "keywords") return JSON.stringify(item).toLowerCase().includes(lowerCaseValue);
	const dataValue = getValueByKeys(item, key);
	if (isString(dataValue) || isNumber(dataValue)) return `${dataValue}`.toLowerCase().includes(lowerCaseValue);
}
//#endregion
export { filterUtil_default as default };
