treehousedev / treehouse

https://treehouse.sh
MIT License
154 stars 11 forks source link

lib: support spaces in field key search #298

Closed ArcaTech closed 1 year ago

ArcaTech commented 1 year ago

Closes #277

Honestly, I don't fully understand this issue. The way the code was written, it should already support both field keys and values containing spaces. But during testing, I noticed something weird. The example Smart Node I made for testing used the following search:

"travel by":car

According to a console log, fieldQuery contained the object: {"travel by": "car"}

During the for (const f in fieldQuery) loop, f is a string that contained escaped quotes. (example: "\"travel by\""). The keys in fields didn't. I'm not sure why that's happening, but this change fixes it.

I'll put this out for review, but I'll continue investigating to better understand what's going on.