Socket
Socket
Sign inDemoInstall

fuse.js

Package Overview
Dependencies
0
Maintainers
1
Versions
113
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 5.0.10-beta to 5.1.0

45

dist/fuse.common.js
/**
* Fuse.js v5.0.10-beta - Lightweight fuzzy-search (http://fusejs.io)
* Fuse.js v5.1.0 - Lightweight fuzzy-search (http://fusejs.io)
*

@@ -1064,3 +1064,3 @@ * Copyright (c) 2020 Kiro Risk (http://kiro.me)

if (weight <= 0 || weight >= 1) {
throw new Error('"weight" property in key must bein the range of (0, 1)');
throw new Error('"weight" property in key must be in the range of (0, 1)');
}

@@ -1144,17 +1144,8 @@

var FuseOptions = {
var BasicOptions = {
// When true, the algorithm continues searching to the end of the input even if a perfect
// match is found before the end of the same input.
isCaseSensitive: false,
// Determines how close the match must be to the fuzzy location (specified above).
// An exact letter match which is 'distance' characters away from the fuzzy location
// would score as a complete mismatch. A distance of '0' requires the match be at
// the exact location specified, a threshold of '1000' would require a perfect match
// to be within 800 characters of the fuzzy location to be found using a 0.8 threshold.
distance: 100,
// Minimum number of characters that must be matched before a result is considered a match
findAllMatches: false,
// The get function to use when fetching an object's properties.
// The default will search nested paths *ie foo.bar.baz*
getFn: get,
includeMatches: false,

@@ -1164,4 +1155,2 @@ includeScore: false,

keys: [],
// Approximately where in the text is the pattern expected to be found?
location: 0,
// Minimum number of characters that must be matched before a result is considered a match

@@ -1174,13 +1163,30 @@ minMatchCharLength: 1,

return a.score - b.score;
},
}
};
var FuzzyOptions = {
// Approximately where in the text is the pattern expected to be found?
location: 0,
// At what point does the match algorithm give up. A threshold of '0.0' requires a perfect match
// (of both letters and location), a threshold of '1.0' would match anything.
threshold: 0.6,
// Determines how close the match must be to the fuzzy location (specified above).
// An exact letter match which is 'distance' characters away from the fuzzy location
// would score as a complete mismatch. A distance of '0' requires the match be at
// the exact location specified, a threshold of '1000' would require a perfect match
// to be within 800 characters of the fuzzy location to be found using a 0.8 threshold.
distance: 100
};
var AdvancedOptions = {
// Enabled extended-searching
useExtendedSearch: false
useExtendedSearch: false,
// The get function to use when fetching an object's properties.
// The default will search nested paths *ie foo.bar.baz*
getFn: get
};
var defaultOptions = _objectSpread2({}, BasicOptions, {}, FuzzyOptions, {}, AdvancedOptions);
var Fuse = /*#__PURE__*/function () {
function Fuse(list) {
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : FuseOptions;
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultOptions;
var index = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;

@@ -1190,3 +1196,3 @@

this.options = _objectSpread2({}, FuseOptions, {}, options); // `caseSensitive` is deprecated, use `isCaseSensitive` instead
this.options = _objectSpread2({}, defaultOptions, {}, options); // `caseSensitive` is deprecated, use `isCaseSensitive` instead

@@ -1463,5 +1469,6 @@ this.options.isCaseSensitive = options.caseSensitive;

Fuse.version = '5.0.10-beta';
Fuse.version = '5.1.0';
Fuse.createIndex = createIndex;
Fuse.defaultOptions = defaultOptions;
module.exports = Fuse;

@@ -1,2 +0,2 @@

// Type definitions for Fuse.js v5.0.10-beta
// Type definitions for Fuse.js v5.1.0
// TypeScript v3.8.3

@@ -11,3 +11,3 @@

options?: O,
index?: ReadonlyArray<Fuse.FuseIndexRecord>,
index?: ReadonlyArray<Fuse.FuseIndexRecord>
)

@@ -34,3 +34,3 @@ /**

pattern: string,
options?: Fuse.FuseSearchOptions,
options?: Fuse.FuseSearchOptions
): Fuse.FuseResult<R>[]

@@ -40,3 +40,3 @@

list: ReadonlyArray<T>,
index?: ReadonlyArray<Fuse.FuseIndexRecord>,
index?: ReadonlyArray<Fuse.FuseIndexRecord>
): void

@@ -80,3 +80,3 @@

list: ReadonlyArray<U>,
options?: Fuse.FuseIndexOptions<U>,
options?: Fuse.FuseIndexOptions<U>
): ReadonlyArray<Fuse.FuseIndexRecord>

@@ -88,3 +88,3 @@ }

obj: T,
path: string,
path: string
) => ReadonlyArray<string> | string

@@ -147,3 +147,3 @@

a: FuseSortFunctionArg,
b: FuseSortFunctionArg,
b: FuseSortFunctionArg
) => number

@@ -150,0 +150,0 @@

/**
* Fuse.js v5.0.10-beta - Lightweight fuzzy-search (http://fusejs.io)
* Fuse.js v5.1.0 - Lightweight fuzzy-search (http://fusejs.io)
*

@@ -10,3 +10,6 @@ * Copyright (c) 2020 Kiro Risk (http://kiro.me)

function bitapScore(pattern, { errors = 0, currentLocation = 0, expectedLocation = 0, distance = 100 }) {
function bitapScore(
pattern,
{ errors = 0, currentLocation = 0, expectedLocation = 0, distance = 100 }
) {
const accuracy = errors / pattern.length;

@@ -20,3 +23,3 @@ const proximity = Math.abs(expectedLocation - currentLocation);

return accuracy + (proximity / distance)
return accuracy + proximity / distance
}

@@ -36,3 +39,3 @@

end = i - 1;
if ((end - start) + 1 >= minMatchCharLength) {
if (end - start + 1 >= minMatchCharLength) {
matchedIndices.push([start, end]);

@@ -45,3 +48,3 @@ }

// (i-1 - start) + 1 => i - start
if (matchmask[i - 1] && (i - start) >= minMatchCharLength) {
if (matchmask[i - 1] && i - start >= minMatchCharLength) {
matchedIndices.push([start, i - 1]);

@@ -53,3 +56,15 @@ }

function bitapSearch(text, pattern, patternAlphabet, { location = 0, distance = 100, threshold = 0.6, findAllMatches = false, minMatchCharLength = 1, includeMatches = false }) {
function bitapSearch(
text,
pattern,
patternAlphabet,
{
location = 0,
distance = 100,
threshold = 0.6,
findAllMatches = false,
minMatchCharLength = 1,
includeMatches = false
}
) {
const patternLen = pattern.length;

@@ -131,3 +146,5 @@ // Set starting location at beginning text and initialize the alphabet.

let start = Math.max(1, expectedLocation - binMid + 1);
let finish = findAllMatches ? textLen : Math.min(expectedLocation + binMid, textLen) + patternLen;
let finish = findAllMatches
? textLen
: Math.min(expectedLocation + binMid, textLen) + patternLen;

@@ -152,3 +169,4 @@ // Initialize the bit array

if (i !== 0) {
bitArr[j] |= (((lastBitArr[j + 1] | lastBitArr[j]) << 1) | 1) | lastBitArr[j + 1];
bitArr[j] |=
((lastBitArr[j + 1] | lastBitArr[j]) << 1) | 1 | lastBitArr[j + 1];
}

@@ -229,24 +247,27 @@

class BitapSearch {
constructor(pattern, {
// Approximately where in the text is the pattern expected to be found?
location = 0,
// Determines how close the match must be to the fuzzy location (specified above).
// An exact letter match which is 'distance' characters away from the fuzzy location
// would score as a complete mismatch. A distance of '0' requires the match be at
// the exact location specified, a threshold of '1000' would require a perfect match
// to be within 800 characters of the fuzzy location to be found using a 0.8 threshold.
distance = 100,
// At what point does the match algorithm give up. A threshold of '0.0' requires a perfect match
// (of both letters and location), a threshold of '1.0' would match anything.
threshold = 0.6,
// Indicates whether comparisons should be case sensitive.
isCaseSensitive = false,
// When true, the algorithm continues searching to the end of the input even if a perfect
// match is found before the end of the same input.
findAllMatches = false,
// Minimum number of characters that must be matched before a result is considered a match
minMatchCharLength = 1,
constructor(
pattern,
{
// Approximately where in the text is the pattern expected to be found?
location = 0,
// Determines how close the match must be to the fuzzy location (specified above).
// An exact letter match which is 'distance' characters away from the fuzzy location
// would score as a complete mismatch. A distance of '0' requires the match be at
// the exact location specified, a threshold of '1000' would require a perfect match
// to be within 800 characters of the fuzzy location to be found using a 0.8 threshold.
distance = 100,
// At what point does the match algorithm give up. A threshold of '0.0' requires a perfect match
// (of both letters and location), a threshold of '1.0' would match anything.
threshold = 0.6,
// Indicates whether comparisons should be case sensitive.
isCaseSensitive = false,
// When true, the algorithm continues searching to the end of the input even if a perfect
// match is found before the end of the same input.
findAllMatches = false,
// Minimum number of characters that must be matched before a result is considered a match
minMatchCharLength = 1,
includeMatches = false
}) {
includeMatches = false
}
) {
this.options = {

@@ -263,3 +284,3 @@ location,

if (pattern.length > MAX_BITS) {
throw new Error(`Pattern length exceeds max of ${MAX_BITS}.`);
throw new Error(`Pattern length exceeds max of ${MAX_BITS}.`)
}

@@ -298,3 +319,9 @@

// Otherwise, use Bitap algorithm
const { location, distance, threshold, findAllMatches, minMatchCharLength } = this.options;
const {
location,
distance,
threshold,
findAllMatches,
minMatchCharLength
} = this.options;
return bitapSearch(text, this.pattern, this.patternAlphabet, {

@@ -315,5 +342,5 @@ location,

const isForPattern = pattern => pattern.charAt(0) == "'";
const isForPattern = (pattern) => pattern.charAt(0) == "'";
const sanitize = pattern => pattern.substr(1);
const sanitize = (pattern) => pattern.substr(1);

@@ -341,5 +368,5 @@ const match = (pattern, text) => {

const isForPattern$1 = pattern => pattern.charAt(0) == '!';
const isForPattern$1 = (pattern) => pattern.charAt(0) == '!';
const sanitize$1 = pattern => pattern.substr(1);
const sanitize$1 = (pattern) => pattern.substr(1);

@@ -366,5 +393,5 @@ const match$1 = (pattern, text) => {

const isForPattern$2 = pattern => pattern.charAt(0) == '^';
const isForPattern$2 = (pattern) => pattern.charAt(0) == '^';
const sanitize$2 = pattern => pattern.substr(1);
const sanitize$2 = (pattern) => pattern.substr(1);

@@ -391,5 +418,6 @@ const match$2 = (pattern, text) => {

const isForPattern$3 = pattern => pattern.charAt(0) == '!' && pattern.charAt(1) == '^';
const isForPattern$3 = (pattern) =>
pattern.charAt(0) == '!' && pattern.charAt(1) == '^';
const sanitize$3 = pattern => pattern.substr(2);
const sanitize$3 = (pattern) => pattern.substr(2);

@@ -416,5 +444,5 @@ const match$3 = (pattern, text) => {

const isForPattern$4 = pattern => pattern.charAt(pattern.length - 1) == '$';
const isForPattern$4 = (pattern) => pattern.charAt(pattern.length - 1) == '$';
const sanitize$4 = pattern => pattern.substr(0, pattern.length - 1);
const sanitize$4 = (pattern) => pattern.substr(0, pattern.length - 1);

@@ -441,5 +469,6 @@ const match$4 = (pattern, text) => {

const isForPattern$5 = pattern => pattern.charAt(0) == '!' && pattern.charAt(pattern.length - 1) == '$';
const isForPattern$5 = (pattern) =>
pattern.charAt(0) == '!' && pattern.charAt(pattern.length - 1) == '$';
const sanitize$5 = pattern => pattern.substring(1, pattern.length - 1);
const sanitize$5 = (pattern) => pattern.substring(1, pattern.length - 1);

@@ -464,24 +493,25 @@ const match$5 = (pattern, text) => {

const isArray = value => !Array.isArray
? Object.prototype.toString.call(value) === '[object Array]'
: Array.isArray(value);
const isArray = (value) =>
!Array.isArray
? Object.prototype.toString.call(value) === '[object Array]'
: Array.isArray(value);
// Adapted from:
// https://github.com/lodash/lodash/blob/f4ca396a796435422bd4fd41fadbd225edddf175/.internal/baseToString.js
const baseToString = value => {
const baseToString = (value) => {
// Exit early for strings to avoid a performance hit in some environments.
if (typeof value == 'string') {
return value;
return value
}
let result = (value + '');
return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
let result = value + '';
return result == '0' && 1 / value == -INFINITY ? '-0' : result
};
const toString = value => value == null ? '' : baseToString(value);
const toString = (value) => (value == null ? '' : baseToString(value));
const isString = value => typeof value === 'string';
const isString = (value) => typeof value === 'string';
const isNumber = value => typeof value === 'number';
const isNumber = (value) => typeof value === 'number';
const isDefined = value => value !== undefined && value !== null;
const isDefined = (value) => value !== undefined && value !== null;

@@ -491,3 +521,4 @@ // Return a 2D array representation of the query, for simpler parsing.

// "^core go$ | rb$ | py$ xy$" => [["^core", "go$"], ["rb$"], ["py$", "xy$"]]
const queryfy = (pattern) => pattern.split('|').map(item => item.trim().split(/ +/g));
const queryfy = (pattern) =>
pattern.split('|').map((item) => item.trim().split(/ +/g));

@@ -552,3 +583,2 @@ /**

for (let i = 0, qLen = query.length; i < qLen; i += 1) {
const parts = query[i];

@@ -607,3 +637,6 @@ let result = null;

function ngram(text, { n = NGRAM_LEN, pad = true, sort = false }) {
function ngram(
text,
{ n = NGRAM_LEN, pad = true, sort = false }
) {
let nGrams = [];

@@ -630,3 +663,3 @@

if (sort) {
nGrams.sort((a, b) => a == b ? 0 : a < b ? -1 : 1);
nGrams.sort((a, b) => (a == b ? 0 : a < b ? -1 : 1));
}

@@ -670,3 +703,3 @@

return result;
return result
}

@@ -698,3 +731,3 @@

return result;
return result
}

@@ -780,3 +813,7 @@

function createIndex(keys, list, { getFn = get, ngrams = false } = {}) {
function createIndex(
keys,
list,
{ getFn = get, ngrams = false } = {}
) {
let indexedList = [];

@@ -807,3 +844,2 @@

}
} else {

@@ -839,3 +875,2 @@ // List is Array<Object>

if (isString(value)) {
// if (!isCaseSensitive) {

@@ -852,3 +887,2 @@ // v = v.toLowerCase()

subRecords.push(subRecord);
} else if (isArray(value)) {

@@ -921,3 +955,5 @@ for (let k = 0, arrLen = value.length; k < arrLen; k += 1) {

if (weight <= 0 || weight >= 1) {
throw new Error('"weight" property in key must bein the range of (0, 1)')
throw new Error(
'"weight" property in key must be in the range of (0, 1)'
)
}

@@ -990,17 +1026,8 @@

const FuseOptions = {
const BasicOptions = {
// When true, the algorithm continues searching to the end of the input even if a perfect
// match is found before the end of the same input.
isCaseSensitive: false,
// Determines how close the match must be to the fuzzy location (specified above).
// An exact letter match which is 'distance' characters away from the fuzzy location
// would score as a complete mismatch. A distance of '0' requires the match be at
// the exact location specified, a threshold of '1000' would require a perfect match
// to be within 800 characters of the fuzzy location to be found using a 0.8 threshold.
distance: 100,
// Minimum number of characters that must be matched before a result is considered a match
findAllMatches: false,
// The get function to use when fetching an object's properties.
// The default will search nested paths *ie foo.bar.baz*
getFn: get,
includeMatches: false,

@@ -1010,4 +1037,2 @@ includeScore: false,

keys: [],
// Approximately where in the text is the pattern expected to be found?
location: 0,
// Minimum number of characters that must be matched before a result is considered a match

@@ -1018,13 +1043,36 @@ minMatchCharLength: 1,

// Default sort function
sortFn: (a, b) => (a.score - b.score),
sortFn: (a, b) => a.score - b.score
};
const FuzzyOptions = {
// Approximately where in the text is the pattern expected to be found?
location: 0,
// At what point does the match algorithm give up. A threshold of '0.0' requires a perfect match
// (of both letters and location), a threshold of '1.0' would match anything.
threshold: 0.6,
// Determines how close the match must be to the fuzzy location (specified above).
// An exact letter match which is 'distance' characters away from the fuzzy location
// would score as a complete mismatch. A distance of '0' requires the match be at
// the exact location specified, a threshold of '1000' would require a perfect match
// to be within 800 characters of the fuzzy location to be found using a 0.8 threshold.
distance: 100
};
const AdvancedOptions = {
// Enabled extended-searching
useExtendedSearch: false
useExtendedSearch: false,
// The get function to use when fetching an object's properties.
// The default will search nested paths *ie foo.bar.baz*
getFn: get
};
const defaultOptions = {
...BasicOptions,
...FuzzyOptions,
...AdvancedOptions
};
class Fuse {
constructor(list, options = FuseOptions, index = null) {
this.options = { ...FuseOptions, ...options };
constructor(list, options = defaultOptions, index = null) {
this.options = { ...defaultOptions, ...options };
// `caseSensitive` is deprecated, use `isCaseSensitive` instead

@@ -1127,3 +1175,2 @@ this.options.isCaseSensitive = options.caseSensitive;

}
} else {

@@ -1224,5 +1271,4 @@ // List is Array<Object>

const weight = keyWeight > -1 ? keyWeight : 1;
const score = item.score === 0 && keyWeight > -1
? Number.EPSILON
: item.score;
const score =
item.score === 0 && keyWeight > -1 ? Number.EPSILON : item.score;

@@ -1272,5 +1318,6 @@ totalWeightedScore *= Math.pow(score, weight);

Fuse.version = '5.0.10-beta';
Fuse.version = '5.1.0';
Fuse.createIndex = createIndex;
Fuse.defaultOptions = defaultOptions;
export default Fuse;
/**
* Fuse.js v5.0.10-beta - Lightweight fuzzy-search (http://fusejs.io)
* Fuse.js v5.1.0 - Lightweight fuzzy-search (http://fusejs.io)
*

@@ -1068,3 +1068,3 @@ * Copyright (c) 2020 Kiro Risk (http://kiro.me)

if (weight <= 0 || weight >= 1) {
throw new Error('"weight" property in key must bein the range of (0, 1)');
throw new Error('"weight" property in key must be in the range of (0, 1)');
}

@@ -1148,17 +1148,8 @@

var FuseOptions = {
var BasicOptions = {
// When true, the algorithm continues searching to the end of the input even if a perfect
// match is found before the end of the same input.
isCaseSensitive: false,
// Determines how close the match must be to the fuzzy location (specified above).
// An exact letter match which is 'distance' characters away from the fuzzy location
// would score as a complete mismatch. A distance of '0' requires the match be at
// the exact location specified, a threshold of '1000' would require a perfect match
// to be within 800 characters of the fuzzy location to be found using a 0.8 threshold.
distance: 100,
// Minimum number of characters that must be matched before a result is considered a match
findAllMatches: false,
// The get function to use when fetching an object's properties.
// The default will search nested paths *ie foo.bar.baz*
getFn: get,
includeMatches: false,

@@ -1168,4 +1159,2 @@ includeScore: false,

keys: [],
// Approximately where in the text is the pattern expected to be found?
location: 0,
// Minimum number of characters that must be matched before a result is considered a match

@@ -1178,13 +1167,30 @@ minMatchCharLength: 1,

return a.score - b.score;
},
}
};
var FuzzyOptions = {
// Approximately where in the text is the pattern expected to be found?
location: 0,
// At what point does the match algorithm give up. A threshold of '0.0' requires a perfect match
// (of both letters and location), a threshold of '1.0' would match anything.
threshold: 0.6,
// Determines how close the match must be to the fuzzy location (specified above).
// An exact letter match which is 'distance' characters away from the fuzzy location
// would score as a complete mismatch. A distance of '0' requires the match be at
// the exact location specified, a threshold of '1000' would require a perfect match
// to be within 800 characters of the fuzzy location to be found using a 0.8 threshold.
distance: 100
};
var AdvancedOptions = {
// Enabled extended-searching
useExtendedSearch: false
useExtendedSearch: false,
// The get function to use when fetching an object's properties.
// The default will search nested paths *ie foo.bar.baz*
getFn: get
};
var defaultOptions = _objectSpread2({}, BasicOptions, {}, FuzzyOptions, {}, AdvancedOptions);
var Fuse = /*#__PURE__*/function () {
function Fuse(list) {
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : FuseOptions;
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultOptions;
var index = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;

@@ -1194,3 +1200,3 @@

this.options = _objectSpread2({}, FuseOptions, {}, options); // `caseSensitive` is deprecated, use `isCaseSensitive` instead
this.options = _objectSpread2({}, defaultOptions, {}, options); // `caseSensitive` is deprecated, use `isCaseSensitive` instead

@@ -1467,4 +1473,5 @@ this.options.isCaseSensitive = options.caseSensitive;

Fuse.version = '5.0.10-beta';
Fuse.version = '5.1.0';
Fuse.createIndex = createIndex;
Fuse.defaultOptions = defaultOptions;

@@ -1471,0 +1478,0 @@ return Fuse;

/**
* Fuse.js v5.0.10-beta - Lightweight fuzzy-search (http://fusejs.io)
* Fuse.js v5.1.0 - Lightweight fuzzy-search (http://fusejs.io)
*

@@ -9,2 +9,2 @@ * Copyright (c) 2020 Kiro Risk (http://kiro.me)

*/
var t,e;t=this,e=function(){"use strict";function t(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function e(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function r(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}function n(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function i(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function s(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?i(Object(r),!0).forEach((function(e){n(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function o(t,e){var r=e.errors,n=void 0===r?0:r,i=e.currentLocation,s=void 0===i?0:i,o=e.expectedLocation,a=void 0===o?0:o,h=e.distance,c=void 0===h?100:h,u=n/t.length,f=Math.abs(a-s);return c?u+f/c:f?1:u}var a=function(){function e(r,n){var i=n.location,s=void 0===i?0:i,o=n.distance,a=void 0===o?100:o,h=n.threshold,c=void 0===h?.6:h,u=n.isCaseSensitive,f=void 0!==u&&u,l=n.findAllMatches,v=void 0!==l&&l,d=n.minMatchCharLength,p=void 0===d?1:d,g=n.includeMatches,y=void 0!==g&&g;if(t(this,e),this.options={location:s,distance:a,threshold:c,isCaseSensitive:f,findAllMatches:v,includeMatches:y,minMatchCharLength:p},r.length>32)throw new Error("Pattern length exceeds max of ".concat(32,"."));this.pattern=f?r:r.toLowerCase(),this.patternAlphabet=function(t){for(var e={},r=t.length,n=0;n<r;n+=1)e[t.charAt(n)]=0;for(var i=0;i<r;i+=1)e[t.charAt(i)]|=1<<r-i-1;return e}(this.pattern)}return r(e,[{key:"searchIn",value:function(t){var e=t.$;return this.searchInString(e)}},{key:"searchInString",value:function(t){var e=this.options,r=e.isCaseSensitive,n=e.includeMatches;if(r||(t=t.toLowerCase()),this.pattern===t){var i={isMatch:!0,score:0};return n&&(i.matchedIndices=[[0,t.length-1]]),i}var s=this.options,a=s.location,h=s.distance,c=s.threshold,u=s.findAllMatches,f=s.minMatchCharLength;return function(t,e,r,n){for(var i=n.location,s=void 0===i?0:i,a=n.distance,h=void 0===a?100:a,c=n.threshold,u=void 0===c?.6:c,f=n.findAllMatches,l=void 0!==f&&f,v=n.minMatchCharLength,d=void 0===v?1:v,p=n.includeMatches,g=void 0!==p&&p,y=e.length,m=t.length,k=Math.max(0,Math.min(s,m)),b=u,M=t.indexOf(e,k),x=[],_=0;_<m;_+=1)x[_]=0;if(-1!==M){var w=o(e,{errors:0,currentLocation:M,expectedLocation:k,distance:h});if(b=Math.min(w,b),-1!==(M=t.lastIndexOf(e,k+y))){var S=o(e,{errors:0,currentLocation:M,expectedLocation:k,distance:h});b=Math.min(S,b)}}M=-1;for(var O=[],I=1,A=y+m,L=1<<(y<=31?y-1:30),C=0;C<y;C+=1){for(var j=0,$=A;j<$;)o(e,{errors:C,currentLocation:k+$,expectedLocation:k,distance:h})<=b?j=$:A=$,$=Math.floor((A-j)/2+j);A=$;var P=Math.max(1,k-$+1),N=l?m:Math.min(k+$,m)+y,E=Array(N+2);E[N+1]=(1<<C)-1;for(var F=N;F>=P;F-=1){var z=F-1,q=r[t.charAt(z)];if(q&&(x[z]=1),E[F]=(E[F+1]<<1|1)&q,0!==C&&(E[F]|=(O[F+1]|O[F])<<1|1|O[F+1]),E[F]&L&&(I=o(e,{errors:C,currentLocation:z,expectedLocation:k,distance:h}))<=b){if(b=I,(M=z)<=k)break;P=Math.max(1,2*k-M)}}if(o(e,{errors:C+1,currentLocation:k,expectedLocation:k,distance:h})>b)break;O=E}var D={isMatch:M>=0,score:I||.001};return g&&(D.matchedIndices=function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=[],n=-1,i=-1,s=0,o=t.length;s<o;s+=1){var a=t[s];a&&-1===n?n=s:a||-1===n||((i=s-1)-n+1>=e&&r.push([n,i]),n=-1)}return t[s-1]&&s-n>=e&&r.push([n,s-1]),r}(x,d)),D}(t,this.pattern,this.patternAlphabet,{location:a,distance:h,threshold:c,findAllMatches:u,minMatchCharLength:f,includeMatches:n})}}]),e}(),h=function(t){return t.substr(1)},c=function(t){return"'"==t.charAt(0)},u=function(t,e){var r=h(t);return{isMatch:e.indexOf(r)>-1,score:0}},f=function(t){return t.substr(1)},l=function(t){return"!"==t.charAt(0)},v=function(t,e){var r=f(t);return{isMatch:-1===e.indexOf(r),score:0}},d=function(t){return t.substr(1)},p=function(t){return"^"==t.charAt(0)},g=function(t,e){var r=d(t);return{isMatch:e.startsWith(r),score:0}},y=function(t){return t.substr(2)},m=function(t){return"!"==t.charAt(0)&&"^"==t.charAt(1)},k=function(t,e){var r=y(t);return{isMatch:!e.startsWith(r),score:0}},b=function(t){return t.substr(0,t.length-1)},M=function(t){return"$"==t.charAt(t.length-1)},x=function(t,e){var r=b(t);return{isMatch:e.endsWith(r),score:0}},_=function(t){return t.substring(1,t.length-1)},w=function(t){return"!"==t.charAt(0)&&"$"==t.charAt(t.length-1)},S=function(t,e){var r=_(t);return{isMatch:!e.endsWith(r),score:0}},O=function(t){return Array.isArray?Array.isArray(t):"[object Array]"===Object.prototype.toString.call(t)},I=function(t){return"string"==typeof t},A=function(t){return"number"==typeof t},L=function(t){return null!=t},C=function(){function e(r,n){t(this,e);var i=n.isCaseSensitive;this.query=null,this.options=n,this._fuzzyCache={},I(r)&&r.trim().length>0&&(this.pattern=i?r:r.toLowerCase(),this.query=function(t){return t.split("|").map((function(t){return t.trim().split(/ +/g)}))}(this.pattern))}return r(e,[{key:"searchIn",value:function(t){var e=this.query;if(!this.query)return{isMatch:!1,score:1};var r=t.$;r=this.options.isCaseSensitive?r:r.toLowerCase();for(var n=!1,i=0,s=e.length;i<s;i+=1){var o=e[i],a=null;n=!0;for(var h=0,c=o.length;h<c;h+=1){var u=o[h];if(!(a=this._search(u,r)).isMatch){n=!1;break}}if(n)return a}return{isMatch:!1,score:1}}},{key:"_search",value:function(t,e){if(c(t))return u(t,e);if(p(t))return g(t,e);if(m(t))return k(t,e);if(w(t))return S(t,e);if(M(t))return x(t,e);if(l(t))return v(t,e);var r=this._fuzzyCache[t];return r||(r=new a(t,this.options),this._fuzzyCache[t]=r),r.searchInString(e)}}]),e}();function j(t,e){var r=e.n,n=void 0===r?3:r,i=e.pad,s=void 0===i||i,o=e.sort,a=void 0!==o&&o,h=[];if(null==t)return h;t=t.toLowerCase(),s&&(t=" ".concat(t," "));var c=t.length-n+1;if(c<1)return h;for(;c--;)h[c]=t.substr(c,n);return a&&h.sort((function(t,e){return t==e?0:t<e?-1:1})),h}var $=function(){function e(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{threshold:.6};t(this,e),this.options=n,this.patternNgram=j(r,{sort:!0})}return r(e,[{key:"searchIn",value:function(t){var e=t.ng;e||(e=j(t.$,{sort:!0}),t.ng=e);var r,n,i,s=(r=this.patternNgram,i=function(t,e){for(var r=[],n=0,i=0;n<t.length&&i<e.length;){var s=t[n],o=e[i];s<o?(r.push(s),n+=1):o<s?(r.push(o),i+=1):(r.push(o),n+=1,i+=1)}for(;n<t.length;)r.push(t[n]),n+=1;for(;i<e.length;)r.push(e[i]),i+=1;return r}(r,n=e),1-function(t,e){for(var r=[],n=0,i=0;n<t.length&&i<e.length;){var s=t[n],o=e[i];s==o?(r.push(s),n+=1,i+=1):s<o?n+=1:(s>o||(n+=1),i+=1)}return r}(r,n).length/i.length),o=s<this.options.threshold;return{score:o?s:1,isMatch:o}}}]),e}();function P(t,e){var r=[],n=!1;return function t(e,i){if(i){var s=i.indexOf("."),o=i,a=null;-1!==s&&(o=i.slice(0,s),a=i.slice(s+1));var h=e[o];if(L(h))if(a||!I(h)&&!A(h))if(O(h)){n=!0;for(var c=0,u=h.length;c<u;c+=1)t(h[c],a)}else a&&t(h,a);else r.push(function(t){return null==t?"":function(t){if("string"==typeof t)return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}(t)}(h))}else r.push(e)}(t,e),n?r:r[0]}function N(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=r.getFn,i=void 0===n?P:n,s=r.ngrams,o=void 0!==s&&s,a=[];if(I(e[0]))for(var h=0,c=e.length;h<c;h+=1){var u=e[h];if(L(u)){var f={$:u,idx:h};o&&(f.ng=j(u,{sort:!0})),a.push(f)}}else for(var l=t.length,v=0,d=e.length;v<d;v+=1){for(var p=e[v],g={idx:v,$:{}},y=0;y<l;y+=1){var m=t[y],k=i(p,m);if(L(k))if(O(k)){for(var b=[],M=[{arrayIndex:-1,value:k}];M.length;){var x=M.pop(),_=x.arrayIndex,w=x.value;if(L(w))if(I(w)){var S={$:w,idx:_};o&&(S.ng=j(w,{sort:!0})),b.push(S)}else if(O(w))for(var A=0,C=w.length;A<C;A+=1)M.push({arrayIndex:A,value:w[A]})}g.$[m]=b}else{var $={$:k};o&&($.ng=j(k,{sort:!0})),g.$[m]=$}}a.push(g)}return a}var E=function(){function e(r){if(t(this,e),this._keys={},this._keyNames=[],this._length=r.length,r.length&&I(r[0]))for(var n=0;n<this._length;n+=1){var i=r[n];this._keys[i]={weight:1},this._keyNames.push(i)}else{for(var s=0,o=0;o<this._length;o+=1){var a=r[o];if(!Object.prototype.hasOwnProperty.call(a,"name"))throw new Error('Missing "name" property in key object');var h=a.name;if(this._keyNames.push(h),!Object.prototype.hasOwnProperty.call(a,"weight"))throw new Error('Missing "weight" property in key object');var c=a.weight;if(c<=0||c>=1)throw new Error('"weight" property in key must bein the range of (0, 1)');this._keys[h]={weight:c},s+=c}for(var u=0;u<this._length;u+=1){var f=this._keyNames[u],l=this._keys[f].weight;this._keys[f].weight=l/s}}}return r(e,[{key:"get",value:function(t,e){return this._keys[t]?this._keys[t][e]:-1}},{key:"keys",value:function(){return this._keyNames}},{key:"count",value:function(){return this._length}},{key:"toJSON",value:function(){return JSON.stringify(this._keys)}}]),e}();function F(t,e){var r=t.matches;if(e.matches=[],L(r))for(var n=0,i=r.length;n<i;n+=1){var s=r[n];if(L(s.indices)&&0!==s.indices.length){var o={indices:s.indices,value:s.value};s.key&&(o.key=s.key),s.idx>-1&&(o.refIndex=s.idx),e.matches.push(o)}}}function z(t,e){e.score=t.score}var q={isCaseSensitive:!1,distance:100,findAllMatches:!1,getFn:P,includeMatches:!1,includeScore:!1,keys:[],location:0,minMatchCharLength:1,shouldSort:!0,sortFn:function(t,e){return t.score-e.score},threshold:.6,useExtendedSearch:!1},D=function(){function e(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:q,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;t(this,e),this.options=s({},q,{},n),this.options.isCaseSensitive=n.caseSensitive,delete this.options.caseSensitive,this._processKeys(this.options.keys),this.setCollection(r,i)}return r(e,[{key:"setCollection",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this.list=t,this.listIsStringArray=I(t[0]),e?this.setIndex(e):this.setIndex(this._createIndex())}},{key:"setIndex",value:function(t){this._indexedList=t}},{key:"_processKeys",value:function(t){this._keyStore=new E(t)}},{key:"_createIndex",value:function(){return N(this._keyStore.keys(),this.list,{getFn:this.options.getFn})}},{key:"search",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{limit:!1},r=this.options,n=r.useExtendedSearch,i=r.shouldSort,s=null;s=n?new C(t,this.options):t.length>32?new $(t,this.options):new a(t,this.options);var o=this._searchUsing(s);return this._computeScore(o),i&&this._sort(o),e.limit&&A(e.limit)&&(o=o.slice(0,e.limit)),this._format(o)}},{key:"_searchUsing",value:function(t){var e=this._indexedList,r=[],n=this.options.includeMatches;if(this.listIsStringArray)for(var i=0,s=e.length;i<s;i+=1){var o=e[i],a=o.$,h=o.idx;if(L(a)){var c=t.searchIn(o),u=c.isMatch,f=c.score;if(u){var l={score:f,value:a};n&&(l.indices=c.matchedIndices),r.push({item:a,idx:h,matches:[l]})}}}else for(var v=this._keyStore.keys(),d=this._keyStore.count(),p=0,g=e.length;p<g;p+=1){var y=e[p],m=y.$,k=y.idx;if(L(m)){for(var b=[],M=0;M<d;M+=1){var x=v[M],_=m[x];if(L(_))if(O(_))for(var w=0,S=_.length;w<S;w+=1){var I=_[w],A=I.$,C=I.idx;if(L(A)){var j=t.searchIn(I),$=j.isMatch,P=j.score;if($){var N={score:P,key:x,value:A,idx:C};n&&(N.indices=j.matchedIndices),b.push(N)}}}else{var E=_.$,F=t.searchIn(_),z=F.isMatch,q=F.score;if(!z)continue;var D={score:q,key:x,value:E};n&&(D.indices=F.matchedIndices),b.push(D)}}b.length&&r.push({idx:k,item:m,matches:b})}}return r}},{key:"_computeScore",value:function(t){for(var e=0,r=t.length;e<r;e+=1){for(var n=t[e],i=n.matches,s=i.length,o=1,a=0;a<s;a+=1){var h=i[a],c=h.key,u=this._keyStore.get(c,"weight"),f=u>-1?u:1,l=0===h.score&&u>-1?Number.EPSILON:h.score;o*=Math.pow(l,f)}n.score=o}}},{key:"_sort",value:function(t){t.sort(this.options.sortFn)}},{key:"_format",value:function(t){var e=[],r=this.options,n=r.includeMatches,i=r.includeScore,s=[];n&&s.push(F),i&&s.push(z);for(var o=0,a=t.length;o<a;o+=1){var h=t[o],c=h.idx,u={item:this.list[c],refIndex:c};if(s.length)for(var f=0,l=s.length;f<l;f+=1)s[f](h,u);e.push(u)}return e}}]),e}();return D.version="5.0.10-beta",D.createIndex=N,D},"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).Fuse=e();
var t,e;t=this,e=function(){"use strict";function t(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function e(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function r(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}function n(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function i(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function s(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?i(Object(r),!0).forEach((function(e){n(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function o(t,e){var r=e.errors,n=void 0===r?0:r,i=e.currentLocation,s=void 0===i?0:i,o=e.expectedLocation,a=void 0===o?0:o,h=e.distance,c=void 0===h?100:h,u=n/t.length,f=Math.abs(a-s);return c?u+f/c:f?1:u}var a=function(){function e(r,n){var i=n.location,s=void 0===i?0:i,o=n.distance,a=void 0===o?100:o,h=n.threshold,c=void 0===h?.6:h,u=n.isCaseSensitive,f=void 0!==u&&u,l=n.findAllMatches,v=void 0!==l&&l,d=n.minMatchCharLength,p=void 0===d?1:d,g=n.includeMatches,y=void 0!==g&&g;if(t(this,e),this.options={location:s,distance:a,threshold:c,isCaseSensitive:f,findAllMatches:v,includeMatches:y,minMatchCharLength:p},r.length>32)throw new Error("Pattern length exceeds max of ".concat(32,"."));this.pattern=f?r:r.toLowerCase(),this.patternAlphabet=function(t){for(var e={},r=t.length,n=0;n<r;n+=1)e[t.charAt(n)]=0;for(var i=0;i<r;i+=1)e[t.charAt(i)]|=1<<r-i-1;return e}(this.pattern)}return r(e,[{key:"searchIn",value:function(t){var e=t.$;return this.searchInString(e)}},{key:"searchInString",value:function(t){var e=this.options,r=e.isCaseSensitive,n=e.includeMatches;if(r||(t=t.toLowerCase()),this.pattern===t){var i={isMatch:!0,score:0};return n&&(i.matchedIndices=[[0,t.length-1]]),i}var s=this.options,a=s.location,h=s.distance,c=s.threshold,u=s.findAllMatches,f=s.minMatchCharLength;return function(t,e,r,n){for(var i=n.location,s=void 0===i?0:i,a=n.distance,h=void 0===a?100:a,c=n.threshold,u=void 0===c?.6:c,f=n.findAllMatches,l=void 0!==f&&f,v=n.minMatchCharLength,d=void 0===v?1:v,p=n.includeMatches,g=void 0!==p&&p,y=e.length,m=t.length,k=Math.max(0,Math.min(s,m)),M=u,b=t.indexOf(e,k),x=[],_=0;_<m;_+=1)x[_]=0;if(-1!==b){var w=o(e,{errors:0,currentLocation:b,expectedLocation:k,distance:h});if(M=Math.min(w,M),-1!==(b=t.lastIndexOf(e,k+y))){var O=o(e,{errors:0,currentLocation:b,expectedLocation:k,distance:h});M=Math.min(O,M)}}b=-1;for(var S=[],I=1,A=y+m,L=1<<(y<=31?y-1:30),C=0;C<y;C+=1){for(var j=0,$=A;j<$;)o(e,{errors:C,currentLocation:k+$,expectedLocation:k,distance:h})<=M?j=$:A=$,$=Math.floor((A-j)/2+j);A=$;var P=Math.max(1,k-$+1),N=l?m:Math.min(k+$,m)+y,E=Array(N+2);E[N+1]=(1<<C)-1;for(var F=N;F>=P;F-=1){var z=F-1,q=r[t.charAt(z)];if(q&&(x[z]=1),E[F]=(E[F+1]<<1|1)&q,0!==C&&(E[F]|=(S[F+1]|S[F])<<1|1|S[F+1]),E[F]&L&&(I=o(e,{errors:C,currentLocation:z,expectedLocation:k,distance:h}))<=M){if(M=I,(b=z)<=k)break;P=Math.max(1,2*k-b)}}if(o(e,{errors:C+1,currentLocation:k,expectedLocation:k,distance:h})>M)break;S=E}var D={isMatch:b>=0,score:I||.001};return g&&(D.matchedIndices=function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=[],n=-1,i=-1,s=0,o=t.length;s<o;s+=1){var a=t[s];a&&-1===n?n=s:a||-1===n||((i=s-1)-n+1>=e&&r.push([n,i]),n=-1)}return t[s-1]&&s-n>=e&&r.push([n,s-1]),r}(x,d)),D}(t,this.pattern,this.patternAlphabet,{location:a,distance:h,threshold:c,findAllMatches:u,minMatchCharLength:f,includeMatches:n})}}]),e}(),h=function(t){return t.substr(1)},c=function(t){return"'"==t.charAt(0)},u=function(t,e){var r=h(t);return{isMatch:e.indexOf(r)>-1,score:0}},f=function(t){return t.substr(1)},l=function(t){return"!"==t.charAt(0)},v=function(t,e){var r=f(t);return{isMatch:-1===e.indexOf(r),score:0}},d=function(t){return t.substr(1)},p=function(t){return"^"==t.charAt(0)},g=function(t,e){var r=d(t);return{isMatch:e.startsWith(r),score:0}},y=function(t){return t.substr(2)},m=function(t){return"!"==t.charAt(0)&&"^"==t.charAt(1)},k=function(t,e){var r=y(t);return{isMatch:!e.startsWith(r),score:0}},M=function(t){return t.substr(0,t.length-1)},b=function(t){return"$"==t.charAt(t.length-1)},x=function(t,e){var r=M(t);return{isMatch:e.endsWith(r),score:0}},_=function(t){return t.substring(1,t.length-1)},w=function(t){return"!"==t.charAt(0)&&"$"==t.charAt(t.length-1)},O=function(t,e){var r=_(t);return{isMatch:!e.endsWith(r),score:0}},S=function(t){return Array.isArray?Array.isArray(t):"[object Array]"===Object.prototype.toString.call(t)},I=function(t){return"string"==typeof t},A=function(t){return"number"==typeof t},L=function(t){return null!=t},C=function(){function e(r,n){t(this,e);var i=n.isCaseSensitive;this.query=null,this.options=n,this._fuzzyCache={},I(r)&&r.trim().length>0&&(this.pattern=i?r:r.toLowerCase(),this.query=function(t){return t.split("|").map((function(t){return t.trim().split(/ +/g)}))}(this.pattern))}return r(e,[{key:"searchIn",value:function(t){var e=this.query;if(!this.query)return{isMatch:!1,score:1};var r=t.$;r=this.options.isCaseSensitive?r:r.toLowerCase();for(var n=!1,i=0,s=e.length;i<s;i+=1){var o=e[i],a=null;n=!0;for(var h=0,c=o.length;h<c;h+=1){var u=o[h];if(!(a=this._search(u,r)).isMatch){n=!1;break}}if(n)return a}return{isMatch:!1,score:1}}},{key:"_search",value:function(t,e){if(c(t))return u(t,e);if(p(t))return g(t,e);if(m(t))return k(t,e);if(w(t))return O(t,e);if(b(t))return x(t,e);if(l(t))return v(t,e);var r=this._fuzzyCache[t];return r||(r=new a(t,this.options),this._fuzzyCache[t]=r),r.searchInString(e)}}]),e}();function j(t,e){var r=e.n,n=void 0===r?3:r,i=e.pad,s=void 0===i||i,o=e.sort,a=void 0!==o&&o,h=[];if(null==t)return h;t=t.toLowerCase(),s&&(t=" ".concat(t," "));var c=t.length-n+1;if(c<1)return h;for(;c--;)h[c]=t.substr(c,n);return a&&h.sort((function(t,e){return t==e?0:t<e?-1:1})),h}var $=function(){function e(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{threshold:.6};t(this,e),this.options=n,this.patternNgram=j(r,{sort:!0})}return r(e,[{key:"searchIn",value:function(t){var e=t.ng;e||(e=j(t.$,{sort:!0}),t.ng=e);var r,n,i,s=(r=this.patternNgram,i=function(t,e){for(var r=[],n=0,i=0;n<t.length&&i<e.length;){var s=t[n],o=e[i];s<o?(r.push(s),n+=1):o<s?(r.push(o),i+=1):(r.push(o),n+=1,i+=1)}for(;n<t.length;)r.push(t[n]),n+=1;for(;i<e.length;)r.push(e[i]),i+=1;return r}(r,n=e),1-function(t,e){for(var r=[],n=0,i=0;n<t.length&&i<e.length;){var s=t[n],o=e[i];s==o?(r.push(s),n+=1,i+=1):s<o?n+=1:(s>o||(n+=1),i+=1)}return r}(r,n).length/i.length),o=s<this.options.threshold;return{score:o?s:1,isMatch:o}}}]),e}();function P(t,e){var r=[],n=!1;return function t(e,i){if(i){var s=i.indexOf("."),o=i,a=null;-1!==s&&(o=i.slice(0,s),a=i.slice(s+1));var h=e[o];if(L(h))if(a||!I(h)&&!A(h))if(S(h)){n=!0;for(var c=0,u=h.length;c<u;c+=1)t(h[c],a)}else a&&t(h,a);else r.push(function(t){return null==t?"":function(t){if("string"==typeof t)return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}(t)}(h))}else r.push(e)}(t,e),n?r:r[0]}function N(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=r.getFn,i=void 0===n?P:n,s=r.ngrams,o=void 0!==s&&s,a=[];if(I(e[0]))for(var h=0,c=e.length;h<c;h+=1){var u=e[h];if(L(u)){var f={$:u,idx:h};o&&(f.ng=j(u,{sort:!0})),a.push(f)}}else for(var l=t.length,v=0,d=e.length;v<d;v+=1){for(var p=e[v],g={idx:v,$:{}},y=0;y<l;y+=1){var m=t[y],k=i(p,m);if(L(k))if(S(k)){for(var M=[],b=[{arrayIndex:-1,value:k}];b.length;){var x=b.pop(),_=x.arrayIndex,w=x.value;if(L(w))if(I(w)){var O={$:w,idx:_};o&&(O.ng=j(w,{sort:!0})),M.push(O)}else if(S(w))for(var A=0,C=w.length;A<C;A+=1)b.push({arrayIndex:A,value:w[A]})}g.$[m]=M}else{var $={$:k};o&&($.ng=j(k,{sort:!0})),g.$[m]=$}}a.push(g)}return a}var E=function(){function e(r){if(t(this,e),this._keys={},this._keyNames=[],this._length=r.length,r.length&&I(r[0]))for(var n=0;n<this._length;n+=1){var i=r[n];this._keys[i]={weight:1},this._keyNames.push(i)}else{for(var s=0,o=0;o<this._length;o+=1){var a=r[o];if(!Object.prototype.hasOwnProperty.call(a,"name"))throw new Error('Missing "name" property in key object');var h=a.name;if(this._keyNames.push(h),!Object.prototype.hasOwnProperty.call(a,"weight"))throw new Error('Missing "weight" property in key object');var c=a.weight;if(c<=0||c>=1)throw new Error('"weight" property in key must be in the range of (0, 1)');this._keys[h]={weight:c},s+=c}for(var u=0;u<this._length;u+=1){var f=this._keyNames[u],l=this._keys[f].weight;this._keys[f].weight=l/s}}}return r(e,[{key:"get",value:function(t,e){return this._keys[t]?this._keys[t][e]:-1}},{key:"keys",value:function(){return this._keyNames}},{key:"count",value:function(){return this._length}},{key:"toJSON",value:function(){return JSON.stringify(this._keys)}}]),e}();function F(t,e){var r=t.matches;if(e.matches=[],L(r))for(var n=0,i=r.length;n<i;n+=1){var s=r[n];if(L(s.indices)&&0!==s.indices.length){var o={indices:s.indices,value:s.value};s.key&&(o.key=s.key),s.idx>-1&&(o.refIndex=s.idx),e.matches.push(o)}}}function z(t,e){e.score=t.score}var q=s({},{isCaseSensitive:!1,findAllMatches:!1,includeMatches:!1,includeScore:!1,keys:[],minMatchCharLength:1,shouldSort:!0,sortFn:function(t,e){return t.score-e.score}},{},{location:0,threshold:.6,distance:100},{},{useExtendedSearch:!1,getFn:P}),D=function(){function e(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:q,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;t(this,e),this.options=s({},q,{},n),this.options.isCaseSensitive=n.caseSensitive,delete this.options.caseSensitive,this._processKeys(this.options.keys),this.setCollection(r,i)}return r(e,[{key:"setCollection",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this.list=t,this.listIsStringArray=I(t[0]),e?this.setIndex(e):this.setIndex(this._createIndex())}},{key:"setIndex",value:function(t){this._indexedList=t}},{key:"_processKeys",value:function(t){this._keyStore=new E(t)}},{key:"_createIndex",value:function(){return N(this._keyStore.keys(),this.list,{getFn:this.options.getFn})}},{key:"search",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{limit:!1},r=this.options,n=r.useExtendedSearch,i=r.shouldSort,s=null;s=n?new C(t,this.options):t.length>32?new $(t,this.options):new a(t,this.options);var o=this._searchUsing(s);return this._computeScore(o),i&&this._sort(o),e.limit&&A(e.limit)&&(o=o.slice(0,e.limit)),this._format(o)}},{key:"_searchUsing",value:function(t){var e=this._indexedList,r=[],n=this.options.includeMatches;if(this.listIsStringArray)for(var i=0,s=e.length;i<s;i+=1){var o=e[i],a=o.$,h=o.idx;if(L(a)){var c=t.searchIn(o),u=c.isMatch,f=c.score;if(u){var l={score:f,value:a};n&&(l.indices=c.matchedIndices),r.push({item:a,idx:h,matches:[l]})}}}else for(var v=this._keyStore.keys(),d=this._keyStore.count(),p=0,g=e.length;p<g;p+=1){var y=e[p],m=y.$,k=y.idx;if(L(m)){for(var M=[],b=0;b<d;b+=1){var x=v[b],_=m[x];if(L(_))if(S(_))for(var w=0,O=_.length;w<O;w+=1){var I=_[w],A=I.$,C=I.idx;if(L(A)){var j=t.searchIn(I),$=j.isMatch,P=j.score;if($){var N={score:P,key:x,value:A,idx:C};n&&(N.indices=j.matchedIndices),M.push(N)}}}else{var E=_.$,F=t.searchIn(_),z=F.isMatch,q=F.score;if(!z)continue;var D={score:q,key:x,value:E};n&&(D.indices=F.matchedIndices),M.push(D)}}M.length&&r.push({idx:k,item:m,matches:M})}}return r}},{key:"_computeScore",value:function(t){for(var e=0,r=t.length;e<r;e+=1){for(var n=t[e],i=n.matches,s=i.length,o=1,a=0;a<s;a+=1){var h=i[a],c=h.key,u=this._keyStore.get(c,"weight"),f=u>-1?u:1,l=0===h.score&&u>-1?Number.EPSILON:h.score;o*=Math.pow(l,f)}n.score=o}}},{key:"_sort",value:function(t){t.sort(this.options.sortFn)}},{key:"_format",value:function(t){var e=[],r=this.options,n=r.includeMatches,i=r.includeScore,s=[];n&&s.push(F),i&&s.push(z);for(var o=0,a=t.length;o<a;o+=1){var h=t[o],c=h.idx,u={item:this.list[c],refIndex:c};if(s.length)for(var f=0,l=s.length;f<l;f+=1)s[f](h,u);e.push(u)}return e}}]),e}();return D.version="5.1.0",D.createIndex=N,D.defaultOptions=q,D},"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).Fuse=e();

@@ -16,3 +16,3 @@ {

],
"version": "5.0.10-beta",
"version": "5.1.0",
"description": "Lightweight fuzzy-search",

@@ -51,7 +51,12 @@ "license": "Apache-2.0",

"@types/jest": "25.1.4",
"@vuepress/plugin-google-analytics": "1.4.0",
"babel-eslint": "10.1.0",
"babel-loader": "^8.0.5",
"codemirror": "5.52.2",
"eslint": "6.8.0",
"eslint-config-prettier": "6.10.1",
"eslint-plugin-vue": "7.0.0-alpha.0",
"faker": "4.1.0",
"jest": "25.1.0",
"prettier": "2.0.2",
"rimraf": "3.0.2",

@@ -63,3 +68,8 @@ "rollup": "2.1.0",

"typescript": "3.8.3",
"vue-codemirror": "4.0.6",
"vue-eslint-parser": "7.0.0",
"vuepress": "1.4.0",
"vuepress-plugin-element-tabs": "0.2.8",
"vuepress-plugin-smooth-scroll": "0.0.9",
"vuepress-plugin-social-share": "0.2.1",
"webpack": "4.42.0",

@@ -66,0 +76,0 @@ "webpack-cli": "3.3.11"

@@ -1,14 +0,10 @@

<p align="center"><a href="https://fusejs.io" target="_blank" rel="noopener noreferrer"><img width="200" src="https://fusejs.io/assets/images/logo.png" alt="Fuse.js logo"></a></p>
# Fuse.js
<p align="center">
<img src="https://github.com/krisk/Fuse/workflows/Node.js%20CI/badge.svg" alt="Node.js CI"/>
<a href="https://www.npmjs.com/package/fuse.js"><img src="https://img.shields.io/npm/v/fuse.js.svg" alt="Version"/></a>
<a href="https://npmcharts.com/compare/fuse.js?minimal=true"><img src="https://img.shields.io/npm/dm/fuse.js.svg" alt="Downloads" /></a>
<a href="https://github.com/krisk/Fuse/graphs/contributors"><img src="https://img.shields.io/github/contributors/krisk/fuse.svg" alt="Contributors" /></a>
<a href="https://www.npmjs.com/package/fuse.js"><img src="https://img.shields.io/npm/l/fuse.js.svg" alt="License"></a>
<!-- <a href="https://discord.gg/QF4B9sf"><img src="https://img.shields.io/badge/chat-on%20discord-7289da.svg" alt="Chat"></a> -->
</p>
![Node.js CI](https://github.com/krisk/Fuse/workflows/Node.js%20CI/badge.svg)
[![Version](https://img.shields.io/npm/v/fuse.js.svg)](https://www.npmjs.com/package/fuse.js)
[![Downloads](https://img.shields.io/npm/dm/fuse.js.svg)](https://npmcharts.com/compare/fuse.js?minimal=tru)
[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)
[![Contributors](https://img.shields.io/github/contributors/krisk/fuse.svg)](https://github.com/krisk/Fuse/graphs/contributors)
![License](https://img.shields.io/npm/l/fuse.js.svg)
## <!--special end-->
## Supporting Fuse.js

@@ -15,0 +11,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc