Skip to content

Commit

Permalink
Merge 98ea11f into 59990c4
Browse files Browse the repository at this point in the history
  • Loading branch information
Turbotailz committed Oct 17, 2019
2 parents 59990c4 + 98ea11f commit a24db0c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@
"sifter": "./bin/sifter.js"
},
"dependencies": {
"optimist": "^0.6.1",
"cardinal": "^1.0.0",
"async": "^2.6.0",
"cardinal": "^1.0.0",
"csv-parse": "^4.6.3",
"humanize": "^0.0.9",
"csv-parse": "^2.0.0"
"optimist": "^0.6.1"
},
"devDependencies": {
"coveralls": "^3.0.0",
Expand Down
5 changes: 3 additions & 2 deletions sifter.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
* @param {string} query
* @returns {array}
*/
Sifter.prototype.tokenize = function(query) {
Sifter.prototype.tokenize = function(query, respect_word_boundaries) {
query = trim(String(query || '').toLowerCase());
if (!query || !query.length) return [];

Expand All @@ -62,6 +62,7 @@
}
}
}
if (respect_word_boundaries) regex = "\\b"+regex
tokens.push({
string : words[i],
regex : new RegExp(regex, 'i')
Expand Down Expand Up @@ -318,7 +319,7 @@
return {
options : options,
query : String(query || '').toLowerCase(),
tokens : this.tokenize(query),
tokens : this.tokenize(query, options.respect_word_boundaries),
total : 0,
items : []
};
Expand Down
2 changes: 1 addition & 1 deletion sifter.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a24db0c

Please sign in to comment.