mirror of
https://github.com/status-im/consul.git
synced 2025-01-17 17:22:17 +00:00
99f102705d
Moves search things around to match an interface that can be switched in and out of fuzzy searching using fuse.js. We add both fuzzy searching and regex based searching to the codebase here, but it is not yet compiled in.
13 lines
259 B
JavaScript
13 lines
259 B
JavaScript
import PredicateSearch from './predicate';
|
|
|
|
export default class ExactSearch extends PredicateSearch {
|
|
predicate(s) {
|
|
s = s.toLowerCase();
|
|
return (item = '') =>
|
|
item
|
|
.toString()
|
|
.toLowerCase()
|
|
.indexOf(s) !== -1;
|
|
}
|
|
}
|