Closed saviola777 closed 1 month ago
Hmm... no this is an unintended consequence of isPlainOject(). I made it to filter our Number, String and Boolean objects. But I should probably then strictly check for those instead. I would like to support custom classes, it just never came up in my use-cases so far. So, the approach is probably to change isPlainObject() into isNotNumberStringOrBoolean() ... needs a better name :) I'd love to see your take on this.
Hello,
great little library. Currently it seems that properties of custom (i.e. not "plain") objects cannot be filtered using
where({ someProp: "someValue" })
(I guess because of jaqt.mjs#L135). I'm assuming this is because we would lose the ability to match custom objects as a whole?To make the example / use case clearer, I have an array of objects of a custom class. I can
select()
properties of these objects without problems, but filtering them withwhere({ someProp: "someValue" })
does not seem to work (I suppose it would work with a matcher function).If this is intentional and supporting this use case is not planned (or too complicated) that's fine, I just thought maybe there is a simple way to support this (or add an option to support it).
I'm willing to try my hand at a PR if you think it would be useful and feasible to support this use case.