Table of Contents
About The Project
This project is simple javascript code for deep searching i.e., when input (array or object) is nested then it search for all the elements that matches the keyword and returns filtered data.
Getting Started
Prerequisites
This is basic js code can be implemented in frontend or backend.
Installation
Install NPM packages
npm i deep-level-searching
Usage
1- import 'deep-level-searching'
import {deepSearch} from 'deep-level-searching';
2- Input
- keyword -> search string
- nested array -> array in which we have to perform searching
- excludedKeys -> array of keys on which user does not want to perform searching
let filteredData = deepSearch(keyword,nestedArray,{excluded:excludedKeys});
Example
import {deepSearch} from 'deep-level-searching';
const keyword = 'john';
const nestedArray = [{}]
const excludedKeys = []
let filteredData = deepSearch(keyword,nestedArray,{excluded:excludedKeys});