📦 Update packaged FuseJS

This commit is contained in:
dependabot[bot] authored and github-actions[bot] committed 2026-06-04 01:14:19 +00:00
1 parent 864c8328ec
commit c73459b634
1 file changed
+2 -2
+2 -2
View File
@@ -1,9 +1,9 @@
/**
* Fuse.js v7.3.0 - Lightweight fuzzy-search (http://fusejs.io)
* Fuse.js v7.4.1 - Lightweight fuzzy-search (http://fusejs.io)
*
* Copyright (c) 2026 Kiro Risk (http://kiro.me)
* All Rights Reserved. Apache Software License 2.0
*
* http://www.apache.org/licenses/LICENSE-2.0
*/
"use strict";function t(t){return Array.isArray?Array.isArray(t):"[object Array]"===u(t)}function e(t){return null==t?"":function(t){if("string"==typeof t)return t;if("bigint"==typeof t)return t.toString();const e=t+"";return"0"==e&&1/t==-1/0?"-0":e}(t)}function s(t){return"string"==typeof t}function i(t){return"number"==typeof t}function n(t){return!0===t||!1===t||function(t){return r(t)&&null!==t}(t)&&"[object Boolean]"==u(t)}function r(t){return"object"==typeof t}function c(t){return null!=t}function o(t){return!t.trim().length}function u(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const h=Object.prototype.hasOwnProperty;class a{constructor(t){this._keys=[],this._keyMap={};let e=0;t.forEach(t=>{const s=l(t);this._keys.push(s),this._keyMap[s.id]=s,e+=s.weight}),this._keys.forEach(t=>{t.weight/=e})}get(t){return this._keyMap[t]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function l(e){let i=null,n=null,r=null,c=1,o=null;if(s(e)||t(e))r=e,i=d(e),n=g(e);else{if(!h.call(e,"name"))throw new Error((t=>`Missing ${t} property in key`)("name"));const t=e.name;if(r=t,h.call(e,"weight")&&(c=e.weight,c<=0))throw new Error((t=>`Property 'weight' in key '${t}' must be a positive integer`)(t));i=d(t),n=g(t),o=e.getFn}return{path:i,id:n,weight:c,src:r,getFn:o}}function d(e){return t(e)?e:e.split(".")}function g(e){return t(e)?e.join("."):e}const f={useExtendedSearch:!1,useTokenSearch:!1,getFn:function(r,o){const u=[];let h=!1;const a=(r,o,l,d)=>{if(c(r))if(o[l]){const g=r[o[l]];if(!c(g))return;if(l===o.length-1&&(s(g)||i(g)||n(g)||"bigint"==typeof g))u.push(void 0!==d?{v:e(g),i:d}:e(g));else if(t(g)){h=!0;for(let t=0,e=g.length;t<e;t+=1)a(g[t],o,l+1,t)}else o.length&&a(g,o,l+1,d)}else u.push(void 0!==d?{v:r,i:d}:r)};return a(r,s(o)?o.split("."):o,0),h?u:u[0]},ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1},p=Object.freeze({isCaseSensitive:!1,ignoreDiacritics:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(t,e)=>t.score===e.score?t.idx<e.idx?-1:1:t.score<e.score?-1:1,includeMatches:!1,findAllMatches:!1,minMatchCharLength:1,location:0,threshold:.6,distance:100,...f}),A=/[^ ]+/g;class m{constructor({getFn:t=p.getFn,fieldNormWeight:e=p.fieldNormWeight}={}){this.norm=function(t=1,e=3){const s=new Map,i=Math.pow(10,e);return{get(e){const n=e.match(A).length;if(s.has(n))return s.get(n);const r=1/Math.pow(n,.5*t),c=parseFloat(Math.round(r*i)/i);return s.set(n,c),c},clear(){s.clear()}}}(e,3),this.getFn=t,this.isCreated=!1,this.docs=[],this.keys=[],this._keysMap={},this.setIndexRecords()}setSources(t=[]){this.docs=t}setIndexRecords(t=[]){this.records=t}setKeys(t=[]){this.keys=t,this._keysMap={},t.forEach((t,e)=>{this._keysMap[t.id]=e})}create(){!this.isCreated&&this.docs.length&&(this.isCreated=!0,s(this.docs[0])?this.docs.forEach((t,e)=>{this._addString(t,e)}):this.docs.forEach((t,e)=>{this._addObject(t,e)}),this.norm.clear())}add(t){const e=this.size();s(t)?this._addString(t,e):this._addObject(t,e)}removeAt(t){this.records.splice(t,1);for(let e=t,s=this.size();e<s;e+=1)this.records[e].i-=1}removeAll(t){for(let e=t.length-1;e>=0;e-=1)this.records.splice(t[e],1);for(let t=0,e=this.records.length;t<e;t+=1)this.records[t].i=t}getValueForItemAtKeyId(t,e){return t[this._keysMap[e]]}size(){return this.records.length}_addString(t,e){if(!c(t)||o(t))return;const s={v:t,i:e,n:this.norm.get(t)};this.records.push(s)}_addObject(i,n){const r={i:n,$:{}};this.keys.forEach((n,u)=>{const h=n.getFn?n.getFn(i):this.getFn(i,n.path);if(c(h))if(t(h)){const t=[];for(let i=0,n=h.length;i<n;i+=1){const n=h[i];if(c(n))if(s(n)){if(!o(n)){const e={v:n,i:i,n:this.norm.get(n)};t.push(e)}}else if(c(n.v)){const i=s(n.v)?n.v:e(n.v);if(!o(i)){const e={v:i,i:n.i,n:this.norm.get(i)};t.push(e)}}}r.$[u]=t}else if(s(h)&&!o(h)){const t={v:h,n:this.norm.get(h)};r.$[u]=t}}),this.records.push(r)}toJSON(){return{keys:this.keys.map(({getFn:t,...e})=>e),records:this.records}}}function C(t,e,{getFn:s=p.getFn,fieldNormWeight:i=p.fieldNormWeight}={}){const n=new m({getFn:s,fieldNormWeight:i});return n.setKeys(t.map(l)),n.setSources(e),n.create(),n}const M=32;function y(t,e,s,{location:i=p.location,distance:n=p.distance,threshold:r=p.threshold,findAllMatches:c=p.findAllMatches,minMatchCharLength:o=p.minMatchCharLength,includeMatches:u=p.includeMatches,ignoreLocation:h=p.ignoreLocation}={}){if(e.length>M)throw new Error(`Pattern length exceeds max of ${M}.`);const a=e.length,l=t.length,d=Math.max(0,Math.min(i,l));let g=r,f=d;const A=(t,e)=>{const s=t/a;if(h)return s;const i=Math.abs(d-e);return n?s+i/n:i?1:s},m=o>1||u,C=m?Array(l):[];let y;for(;(y=t.indexOf(e,f))>-1;){const t=A(0,y);if(g=Math.min(t,g),f=y+a,m){let t=0;for(;t<a;)C[y+t]=1,t+=1}}f=-1;let x=[],F=1,D=a+l;const E=1<<a-1;for(let e=0;e<a;e+=1){let i=0,n=D;for(;i<n;){A(e,d+n)<=g?i=n:D=n,n=Math.floor((D-i)/2+i)}D=n;let r=Math.max(1,d-n+1);const o=c?l:Math.min(d+n,l)+a,u=Array(o+2);u[o+1]=(1<<e)-1;for(let i=o;i>=r;i-=1){const n=i-1,c=sLine truncated
"use strict";function e(e){return Array.isArray?Array.isArray(e):"[object Array]"===u(e)}function t(e){return null==e?"":function(e){if("string"==typeof e)return e;if("bigint"==typeof e)return e.toString();const t=e+"";return"0"==t&&1/e==-1/0?"-0":t}(e)}function s(e){return"string"==typeof e}function i(e){return"number"==typeof e}function n(e){return!0===e||!1===e||function(e){return r(e)&&null!==e}(e)&&"[object Boolean]"==u(e)}function r(e){return"object"==typeof e}function o(e){return null!=e}function c(e){return!e.trim().length}function u(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const h="Invalid doc index: must be a non-negative integer within the bounds of the docs array",a=Object.prototype.hasOwnProperty;class l{constructor(e){this._keys=[],this._keyMap={};let t=0;e.forEach(e=>{const s=d(e);this._keys.push(s),this._keyMap[s.id]=s,t+=s.weight}),this._keys.forEach(e=>{e.weight/=t})}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function d(t){let i=null,n=null,r=null,o=1,c=null;if(s(t)||e(t))r=t,i=f(t),n=g(t);else{if(!a.call(t,"name"))throw new Error((e=>`Missing ${e} property in key`)("name"));const e=t.name;if(r=e,a.call(t,"weight")&&void 0!==t.weight&&(o=t.weight,o<=0))throw new Error((e=>`Property 'weight' in key '${e}' must be a positive integer`)(g(e)));i=f(e),n=g(e),c=t.getFn??null}return{path:i,id:n,weight:o,src:r,getFn:c}}function f(t){return e(t)?t:t.split(".")}function g(t){return e(t)?t.join("."):t}const m={useExtendedSearch:!1,useTokenSearch:!1,tokenize:void 0,tokenMatch:"any",getFn:function(r,c){const u=[];let h=!1;const a=(r,c,l,d)=>{if(o(r))if(c[l]){const f=r[c[l]];if(!o(f))return;if(l===c.length-1&&(s(f)||i(f)||n(f)||"bigint"==typeof f))u.push(void 0!==d?{v:t(f),i:d}:t(f));else if(e(f)){h=!0;for(let e=0,t=f.length;e<t;e+=1)a(f[e],c,l+1,e)}else c.length&&a(f,c,l+1,d)}else u.push(void 0!==d?{v:r,i:d}:r)};return a(r,s(c)?c.split("."):c,0),h?u:u[0]},ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1},p=Object.freeze({isCaseSensitive:!1,ignoreDiacritics:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(e,t)=>e.score===t.score?e.idx<t.idx?-1:1:e.score<t.score?-1:1,includeMatches:!1,findAllMatches:!1,minMatchCharLength:1,location:0,threshold:.6,distance:100,...m});class A{constructor({getFn:e=p.getFn,fieldNormWeight:t=p.fieldNormWeight}={}){this.norm=function(e=1,t=3){const s=new Map,i=Math.pow(10,t);return{get(t){let n=1,r=!1;for(let e=0;e<t.length;e++)32===t.charCodeAt(e)?r||(n++,r=!0):r=!1;if(s.has(n))return s.get(n);const o=Math.round(i/Math.pow(n,.5*e))/i;return s.set(n,o),o},clear(){s.clear()}}}(t,3),this.getFn=e,this.isCreated=!1,this.docs=[],this.keys=[],this._keysMap={},this.setIndexRecords()}setSources(e=[]){this.docs=e}setIndexRecords(e=[]){this.records=e}setKeys(e=[]){this.keys=e,this._keysMap={},e.forEach((e,t)=>{this._keysMap[e.id]=t})}create(){if(this.isCreated||!this.docs.length)return;this.isCreated=!0;const e=this.docs.length;this.records=new Array(e);let t=0;if(s(this.docs[0]))for(let s=0;s<e;s++){const e=this._createStringRecord(this.docs[s],s);e&&(this.records[t++]=e)}else for(let s=0;s<e;s++)this.records[t++]=this._createObjectRecord(this.docs[s],s);this.records.length=t,this.norm.clear()}add(e,t){if(!Number.isInteger(t)||t<0)throw new Error(h);if(s(e)){const s=this._createStringRecord(e,t);return s&&this.records.push(s),s}const i=this._createObjectRecord(e,t);return this.records.push(i),i}removeAt(e){if(!Number.isInteger(e)||e<0)throw new Error(h);for(let t=0,s=this.records.length;t<s;t+=1)if(this.records[t].i===e){this.records.splice(t,1);break}for(let t=0,s=this.records.length;t<s;t+=1)this.records[t].i>e&&(this.records[t].i-=1)}removeAll(e){const t=new Set;for(const s of e)Number.isInteger(s)&&s>=0&&t.add(s);if(0===t.size)return;this.records=this.records.filter(e=>!t.has(e.i));const s=Array.from(t).sort((e,t)=>e-t);for(const e of this.records){let t=0,i=s.length;for(;t<i;){const n=t+i>>>1;s[n]<e.i?t=n+1:i=n}e.i-=t}}getValueForItemAtKeyId(e,t){return e[this._keysMap[t]]}size(){return this.records.length}_createStringRecord(e,t){return!o(e)||c(e)?null:{v:e,i:t,n:this.norm.get(e)}}_createObjectRecord(i,n){const r={i:n,$:{}};for(let n=0,u=this.keys.length;n<u;n++){const u=this.keys[n],h=u.getFn?u.getFn(i):this.getFn(i,u.path);if(o(h))if(e(h)){const e=[];for(let i=0,n=h.length;i<n;i+=1){const n=h[i];if(o(n))if(s(n)){if(!c(n)){const t={v:n,i:i,n:this.norm.get(n)};e.push(t)}}else if(o(n.v)){const i=s(n.v)?n.v:t(n.v);if(!c(i)){const t={v:i,i:n.i,n:this.norm.get(i)};e.push(t)}}}r.$[n]=e}else if(s(h)&&!c(h)){const e={v:h,n:this.norm.get(h)};r.$[n]=e}}return r}toJSON(){return{keys:this.keys.map(({getFn:e,...t})=>t),records:this.records}}}function C(e,t,{getFn:s=p.getFn,fieldNormWeight:i=p.fieldNormWeight}={}){const n=new A({getFn:s,fieldNormWeight:i});return n.setKeys(e.map(d)),n.setSources(t),n.create(),n}const M=32;function y(e,t,s,{location:i=p.location,distance:n=Line truncated