wise-introvert/deepsearchjs
Search across keys of a JSON object regardless of it's depth and complexity!
TypeScriptMIT
Issues
- 0
Search across values.
#22 opened by wise-introvert - 0
Implement hashtables.
#21 opened by wise-introvert - 2
- 2
- 1
feat: Add a third parameter to the function to customise the search configurations ( leaf-node results only, etc... )
#3 opened by wise-introvert - 0
feat: Search across values??
#4 opened by wise-introvert - 0
build: decrease package build size
#5 opened by wise-introvert - 1
docs: improve documentation
#6 opened by wise-introvert - 0
refactor: feedback from reddit user
#9 opened by wise-introvert - 0
Need examples showing more complex query cases. A single example with a query of "p" tells me virtually nothing about how I might expect to use this module.
#10 opened by wise-introvert - 0
Consider allowing query to be a RegEx or string. Gives callers more control over which keys are searched. (Useful for finding results in groups of keys. E.g. /address_.*/
#11 opened by wise-introvert - 0
Maybe also consider allowing query to be a function that takes (keyPath, value) as arguments and returns true | false to indicate whether the entry should be included in the results. (Generally speaking regex-based query systems tend to prove problematic beyond a certain level of complexity, at which point users will want to provide their own filtering logic.)
#12 opened by wise-introvert - 0
Rather than walking the entire object to get all keys up front, consider implementing the search logic using a generator function, where each `yield` returns a [key, value] entry (similar to Object.entries()). This will allow callers to control how many results they get and at what velocity. (E.g. if caller only needs the first result, there's no reason to crawl the whole object. E.g. if caller wants to paginate results or pause scanning while waiting for user input or whatever). 'Will be a much more useful and performant.
#14 opened by wise-introvert - 0
Also, a word of advice: Don't export utility functions that are not central to the purpose of your module. Specifically, isArray and isObject should be kept private. Users already have plenty of other options for that sort of thing, and when (not if!) they depend on your implementations you lose the flexibility of changing them should the need arise.
#15 opened by wise-introvert - 0
Prefix tree
#17 opened by wise-introvert - 0
Move the line that creates regex outside of the keys.filter() method. That way you only create regex once rather than N times (N = # of keys).
#13 opened by wise-introvert