json-viewer icon indicating copy to clipboard operation
json-viewer copied to clipboard

make filter less rigid

Open dave-ics opened this issue 2 years ago • 1 comments

Is your feature request related to a problem? Please describe. my array of json has address_1, address_2, address_3 it's a pain to pass a filter string to get all 3

Describe the solution you'd like ideally I could filter('addr') and any key/value pair with those 4 consecutive letters would remain while everything else gets hidden.

Describe alternatives you've considered right now i just do **.entire_field_name

Additional context Might need to put this functionality behind an option like filterMode(...) which allows users to keep the exact (default), or fuzzy (generous filter matching both keys and values with partial strings)

dave-ics avatar Jul 14 '23 23:07 dave-ics

Hi @dave-ics, if you haven't tried it yet, you could pass a RegExp to the filter, that would give you much more flexibility.

Take a look at this example https://codepen.io/alenaksu/pen/vYvNvWj

alenaksu avatar Aug 26 '23 09:08 alenaksu