mirror of
https://github.com/krisk/Fuse.git
synced 2026-01-25 16:43:11 +00:00
Update fuse.js
Fix to allow null or undefined options. The previous version had a check when setting this.options but left the variable untouched, so when trying to access eg `options.location` it through a type error.
This commit is contained in:
parent
7d1a7893e6
commit
887c37b669
@ -36,7 +36,8 @@
|
||||
* you may not use this file except in compliance with the License.
|
||||
*/
|
||||
var BitapSearcher = function(pattern, options) {
|
||||
this.options = options || {};
|
||||
options = options || {};
|
||||
this.options = options;
|
||||
this.options.location = options.location || BitapSearcher.defaultOptions.location;
|
||||
this.options.distance = 'distance' in options ? options.distance : BitapSearcher.defaultOptions.distance;
|
||||
this.options.threshold = 'threshold' in options ? options.threshold : BitapSearcher.defaultOptions.threshold;
|
||||
@ -417,4 +418,4 @@
|
||||
global.Fuse = Fuse;
|
||||
}
|
||||
|
||||
})(this);
|
||||
})(this);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user