Improve fulltext search API and interface

This commit is contained in:
Toby Zerner
2015-07-07 20:35:18 +09:30
parent 38c2ff0306
commit 42f1fa1272
12 changed files with 62 additions and 81 deletions

View File

@ -5,7 +5,7 @@ export default function(string, phrase, length) {
return string;
}
const regexp = regexp instanceof RegExp ? phrase : new RegExp(phrase, 'gi');
const regexp = phrase instanceof RegExp ? phrase : new RegExp(phrase, 'gi');
let highlightedString = string;
let start = 0;