YuriGor / deepdash

eachDeep, filterDeep, findDeep, someDeep, omitDeep, pickDeep, keysDeep etc.. Tree traversal library written in Underscore/Lodash fashion
https://deepdash.io/
MIT License
275 stars 12 forks source link

Need test cases for string field names containing "'`[]. #2

Closed YuriGor closed 5 years ago

YuriGor commented 5 years ago

I feel the possibility of incorrect path generation.

YuriGor commented 5 years ago

Escaping of " symbol with \" added. This still will not work with Lodash get/set/has, but correct javascript code will be generated at least. Also added eachDeep option pathFormat. It's a 'string' by default, and also can be 'array'. Also, function pathToString added to convert from an array to string.

YuriGor commented 5 years ago

pathFormatoption added to filterDeep too.

YuriGor commented 5 years ago

Actually escaped paths work in Lodash too! Here is the test