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
_.findKey(users, function(o) { return o.age < 40; });
// => 'barney' (iteration order is not guaranteed)
// The `_.matches` iteratee shorthand.
_.findKey(users, { 'age': 1, 'active': true });
// => 'pebbles'
// The `_.matchesProperty` iteratee shorthand.
_.findKey(users, ['active', false]);
// => 'fred'
// The `_.property` iteratee shorthand.
_.findKey(users, 'active');
// => 'barney'
Looking at the example in the lodash document, you can get the key by entering ['active', false] or 'active' as the second argument to findKey, but this makes the complexity of implementation very difficult.
What about supporting only functions in our original es-toolkit library, and supporting matches and matchesProperty, etc. in our compatibility library?
You can refer to how we approached this problem in dropWhile or other similar functions.
Hi, @raon0211 !
Can I work findKey of #91 ??
#441
In the above issue, someone said they were implementing it, but it seems like it hasn't been implemented because it's been about 2 months.
And I have a question about the findKey interface.
https://lodash.com/docs/4.17.15#findKey
Looking at the example in the lodash document, you can get the key by entering ['active', false] or 'active' as the second argument to findKey, but this makes the complexity of implementation very difficult.
https://github.com/toss/es-toolkit/blob/main/.github/CONTRIBUTING.md
However, if you look at es-toolkit's design priniciples, it emphasizes simplicity.
So I think that implementing only the first and second interfaces in the above example fits es-toolkit's priniciples.
However, if that happens, the interface will be different from lodash, so I think there might be a problem during the switching process in lodash.
Of these two conflicting issues principles vs compatibility with lodash, which issue has higher priority?
The text was updated successfully, but these errors were encountered: