You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
isMatch from es-toolkit/compat does not behave like lodash-es/isMatch #1399
Hello,
While trying to migrate away from lodash to es-toolkit/compat (btw, thanks a lot for this amazing work!) we noticed a few React components not behaving as expected.
I managed to narrow the issue to the isMatch function (found while using find).
If you run this code below, you'll notice that the same predicate doesn't output the same value whether we use Lodash or Es-Toolkit findor isMatch.
importlodashEsfrom"https://esm.sh/lodash-es";importesToolkitfrom"https://esm.sh/es-toolkit/compat";constlist=[{label: "Foo",value: "foo"},{label: "Bar",value: "bar"}];constcondition={anyKeyOrMissingKey: undefined// Comment me, it doesn't change a thing};constfoundLodash=lodashEs.find(list,{value: condition});constfoundEtk=esToolkit.find(list,{value: condition});constisAMatchLodash=lodashEs.isMatch({value: 'bar'},{value: condition})constisAMatchEtk=esToolkit.isMatch({value: 'bar'},{value: condition})console.clear()// Lodash and ESToolkit/compat should output the same "undefined" valueconsole.log("found lodash",foundLodash);console.log("found estoolkit",foundEtk);// Root problem is isMatch fnconsole.log('isAMatchLodash',isAMatchLodash)console.log('isAMatchEtk',isAMatchEtk)
Activity
raon0211 commentedon Dec 12, 2025
This bug is fixed in this commit: 6b0b670
This is released in the latest version of es-toolkit.