rjrodger / patrun

A fast pattern matcher on JavaScript object properties.
MIT License
143 stars 19 forks source link

Deep object pattern matching #15

Open mt-sebastien-robert opened 5 years ago

mt-sebastien-robert commented 5 years ago

The documentation is clear about deep object matching not being supported:

Register a pattern, and the object that will be returned if an input matches.
Both keys and values are considered to be strings. Other types are converted to strings.

However, is this planed to be implemented in a future version ?

mt-sebastien-robert commented 5 years ago

May be a duplicate with #10 by the way, but that issues didn't really give info about what's going on.

rjrodger commented 4 years ago

Seems like https://hapi.dev/family/hoek/api/?v=9.0.2#reachobj-chain-options might make this feasible—however this is just one "value extraction" method - we will need an abstract representation of some sort...