{"version":3,"file":"isValueEqualOrExist.cjs","sources":["../../src/shared/isValueEqualOrExist.ts"],"sourcesContent":["import { isEqual } from 'ohash'\nimport { isNullish } from './nullish'\n\n/**\n * The function `isValueEqualOrExist` checks if a value is equal to or exists in another value or\n * array.\n * @param {T | T[] | undefined} base - It represents the base value that you want to compare with the `current` value.\n * @param {T | T[] | undefined} current - The `current` parameter represents the current value that you want to compare with the `base` value or values.\n * @returns The `isValueEqualOrExist` function returns a boolean value. It checks if the `base` value\n * is equal to the `current` value or if the `current` value exists within the `base` value. The\n * function handles cases where `base` can be a single value, an array of values, or undefined.\n */\nexport function isValueEqualOrExist(base: T | T[] | undefined, current: T | T[] | undefined) {\n if (isNullish(base))\n return false\n if (Array.isArray(base)) {\n return base.some(val => isEqual(val, current))\n }\n else {\n return isEqual(base, current)\n }\n}\n"],"names":["isNullish","isEqual"],"mappings":";;;;;AAYgB,SAAA,mBAAA,CAAuB,MAA2B,OAA8B,EAAA;AAC9F,EAAA,IAAIA,yBAAU,IAAI,CAAA;AAChB,IAAO,OAAA,KAAA;AACT,EAAI,IAAA,KAAA,CAAM,OAAQ,CAAA,IAAI,CAAG,EAAA;AACvB,IAAA,OAAO,KAAK,IAAK,CAAA,CAAA,GAAA,KAAOC,aAAQ,CAAA,GAAA,EAAK,OAAO,CAAC,CAAA;AAAA,GAE1C,MAAA;AACH,IAAO,OAAAA,aAAA,CAAQ,MAAM,OAAO,CAAA;AAAA;AAEhC;;;;"}