fuzzaldrin-plus
Advanced tools
Comparing version 0.2.0 to 0.3.0
(function() { | ||
var PathSeparator, filter, legacy_scorer, matcher, scorer; | ||
var PathSeparator, filter, legacy_scorer, matcher, prepQueryCache, scorer; | ||
@@ -14,2 +14,4 @@ scorer = require('./scorer'); | ||
prepQueryCache = null; | ||
module.exports = { | ||
@@ -32,3 +34,3 @@ filter: function(candidates, query, options) { | ||
if (prepQuery == null) { | ||
prepQuery = scorer.prepQuery(query); | ||
prepQuery = prepQueryCache && prepQueryCache.query === query ? prepQueryCache : (prepQueryCache = scorer.prepQuery(query)); | ||
} | ||
@@ -64,3 +66,3 @@ if (!legacy) { | ||
if (prepQuery == null) { | ||
prepQuery = scorer.prepQuery(query); | ||
prepQuery = prepQueryCache && prepQueryCache.query === query ? prepQueryCache : (prepQueryCache = scorer.prepQuery(query)); | ||
} | ||
@@ -67,0 +69,0 @@ if (!(allowErrors || scorer.isMatch(string, prepQuery.core_lw, prepQuery.core_up))) { |
(function() { | ||
var AcronymResult, PathSeparator, Query, basenameScore, coreChars, countDir, doScore, emptyAcronymResult, file_coeff, isMatch, isSeparator, isWordEnd, isWordStart, miss_coeff, opt_char_re, pos_bonus, scoreAcronyms, scoreCharacter, scoreConsecutives, scoreExact, scoreExactMatch, scorePattern, scorePosition, scoreSize, tau_depth, tau_size, wm; | ||
var AcronymResult, PathSeparator, Query, basenameScore, coreChars, countDir, doScore, emptyAcronymResult, file_coeff, isMatch, isSeparator, isWordEnd, isWordStart, miss_coeff, opt_char_re, pos_bonus, scoreAcronyms, scoreCharacter, scoreConsecutives, scoreExact, scoreExactMatch, scorePattern, scorePosition, scoreSize, tau_depth, tau_size, truncatedUpperCase, wm; | ||
@@ -49,3 +49,3 @@ PathSeparator = require('path').sep; | ||
this.core_lw = this.core.toLowerCase(); | ||
this.core_up = this.core.toUpperCase(); | ||
this.core_up = truncatedUpperCase(this.core); | ||
this.depth = countDir(query, query.length); | ||
@@ -378,2 +378,12 @@ } | ||
truncatedUpperCase = function(str) { | ||
var char, upper, _i, _len; | ||
upper = ""; | ||
for (_i = 0, _len = str.length; _i < _len; _i++) { | ||
char = str[_i]; | ||
upper += char.toUpperCase()[0]; | ||
} | ||
return upper; | ||
}; | ||
}).call(this); |
{ | ||
"name": "fuzzaldrin-plus", | ||
"version": "0.2.0", | ||
"version": "0.3.0", | ||
"description": "Fuzzy filtering and string scoring - compatible with fuzzaldrin", | ||
@@ -5,0 +5,0 @@ "licenses": [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
118058
20
757