Deep Searching Filter
Searching by `{ ... filters... }` deep in a nested array or nested object.
Table of Contents
-
About The Project
-
Getting Started
- Usage
- Example
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-backlog-filters
Usage
1- import 'deep-level-backlog-filters'
import deepSearching from 'deep-level-backlog-filters';
2- Input
Attribute | Description |
---|
data | array in which we have to perform searching |
filterData | search string example {workItem: 'US-', searchingKeyword: '', unScored: true, epicId:10, teamId: 20, status: 'to-do'} |
Replacements | |
| { |
| workItem: 'externalKey', |
| owner: 'userId', |
| status: 'progress', |
| } |
let filteredData = deepSearching({workItem: 'US-'}, nestedArray, replacements);
Example
import deepSearching from 'deep-level-backlog-filters';
filteredData = deepSearching( {
workItem: 'US-',
searchingKeyword: '',
unScored: true,
epicId:10,
teamId: 20,
status: 'to-do'
}, data, {
workItem: 'externalKey',
owner: 'userId',
status: 'progress'
});