@codewell/super-search
v2.0.0
Published
Search in javascript objects with strings
Downloads
317
Readme
@codewell/super-search
Search in javascript objects with strings
Installation
npm install @codewell/super-search
Basic usage
import { superSearch } from '@codewell/super-search';
const options = {
// Characters that should be ignored in the search object
// Defaults to []
ignore: [" "],
// If the search should be case sensitive
// defaults to false
caseSensitive: false,
};
superSearch()('foo 123', { name: 'foo', age: 123 });
// => { numberOfMatches: 2, fullMatch: false }
superSearch({ignore: [" "]})('foo', { key: 'f o o' });
// => { numberOfMatches: 1, fullMatch: true }
superSearch({caseSensitive: true})('Foo', { key: 'foo' });
// => { numberOfMatches: 0, fullMatch: false }