function find(arr, filter) {
...
function filter(arr, filter) {
DRY. I can't say I'm pleased with this pair of functions. They are literally the same thing, byte for byte. Pick one and go with it. Don't pollute the IDE autocomplete menu with multiple spellings for same concept. Don't clutter the documentation of your public API.
Maybe find is culturally appropriate,
since we're calling into Array's find which callers are already familiar with.
Maybe filter is better, as it suggests zero or more results.
You are the API designer. Choose a winner and run with it.
(Imagine there was some backward compatibility reason why the V2 filter needs to be just like the V1 find. That's unfortunate, but still no reason for copy-n-paste code. Choose one to be canonical, and have the other call it.)
Apparently it would be
Bad
to have a data value that includes the = equal sign.
(Similarly for keys, but I'm willing to believe that comes up less often.)
We really need to have a comment or other documentation
which explains that.
More generally, there seems to be some business concept of a Label thatwhich would benefit from documentation that introduces the notion. Maybe there's a specification for what valid labels look like.
In example.js we find some demo calls,
which is helpful documentation, it shows what's expected.
But it's a far cry from using Jest or similar unit test framework. Automated tests should be self-evaluating, they should "know" the right answer, so they can report Green / Red bar results. The console logging we see here assumes that the human eyeballing the results will know the right answer, and will usefully respond when the wrong answer is displayed.
Overall?
This module seems to have a "find vs filter?" issue that still needs to be resolved. With one of them deleted (or at least deprecated), it should be ready to ship.
We still need to decide whether we're commited to automated testing of this codebase. As it stands, I would be reluctant to delegate or accept maintenance tasks for it.