foxts 5.8.0 → 5.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ahocorasick/index.js +1 -1
- package/dist/ahocorasick/index.mjs +1 -1
- package/dist/base/index.js +1 -1
- package/dist/base/index.mjs +1 -1
- package/dist/fnv1a/index.d.ts +15 -4
- package/dist/fnv1a/index.js +1 -1
- package/dist/fnv1a/index.mjs +1 -1
- package/dist/fnv1a52/index.d.ts +19 -15
- package/dist/fnv1a52/index.js +1 -1
- package/dist/fnv1a52/index.mjs +1 -1
- package/dist/headers-to-object/index.js +1 -1
- package/dist/headers-to-object/index.mjs +1 -1
- package/dist/once/index.js +1 -1
- package/dist/once/index.mjs +1 -1
- package/dist/retrie/index.js +1 -1
- package/dist/retrie/index.mjs +1 -1
- package/dist/simple-string-hash/index.js +1 -1
- package/dist/simple-string-hash/index.mjs +1 -1
- package/package.json +15 -11
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";class t extends Map{wordEnd;fail;constructor(t,e){super(),this.wordEnd=t,this.fail=e}}exports.createAhoCorasick=function(e){const o=new t(!1,void 0);e.forEach(e=>{let r=o;for(let o=0,
|
|
1
|
+
"use strict";class t extends Map{wordEnd;fail;constructor(t,e){super(),this.wordEnd=t,this.fail=e}}exports.createAhoCorasick=function(e){const o=new t(!1,void 0);e.forEach(e=>{let r=o;for(let o=0,n=e.length;o<n;o++){const n=e[o];if(r.has(n))r=r.get(n);else{const e=new t(!1,void 0);r.set(n,e),r=e}}r!==o&&(r.wordEnd=!0)});const r=[o];let n=0;for(;n<r.length;){const t=r[n++];t.forEach((e,n)=>{let s=t.fail;for(;s&&!s.has(n);)s=s.fail;e.fail=s?s.get(n):o,e.fail?.wordEnd&&(e.wordEnd=!0),r.push(e)})}return t=>{let e=o;for(let r=0,n=t.length;r<n;r++){const n=t[r];for(;e&&!e.has(n);)e=e.fail;if((e=e?e.get(n):o).wordEnd)return!0}return!1}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
class t extends Map{wordEnd;fail;constructor(t,o){super(),this.wordEnd=t,this.fail=o}}function o(o){const e=new t(!1,void 0);o.forEach(o=>{let r=e;for(let e=0,n=o.length;e<n;e++){const n=o[e];if(r.has(n))r=r.get(n);else{const o=new t(!1,void 0);r.set(n,o),r=o}}r!==e&&(r.wordEnd=!0)});const r=[e];for(;r.length;){const t=r
|
|
1
|
+
class t extends Map{wordEnd;fail;constructor(t,o){super(),this.wordEnd=t,this.fail=o}}function o(o){const e=new t(!1,void 0);o.forEach(o=>{let r=e;for(let e=0,n=o.length;e<n;e++){const n=o[e];if(r.has(n))r=r.get(n);else{const o=new t(!1,void 0);r.set(n,o),r=o}}r!==e&&(r.wordEnd=!0)});const r=[e];let n=0;for(;n<r.length;){const t=r[n++];t.forEach((o,n)=>{let s=t.fail;for(;s&&!s.has(n);)s=s.fail;o.fail=s?s.get(n):e,o.fail?.wordEnd&&(o.wordEnd=!0),r.push(o)})}return t=>{let o=e;for(let r=0,n=t.length;r<n;r++){const n=t[r];for(;o&&!o.has(n);)o=o.fail;if((o=o?o.get(n):e).wordEnd)return!0}return!1}}export{o as createAhoCorasick};
|
package/dist/base/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";exports.base=function(r){if(r.length>=255)throw TypeError("Alphabet too long");const t=new Uint8Array(256);for(let r=0;r<256;r++)t[r]=255;const o=r.length;for(let e=0;e<o;e++){const o=r.charAt(e),n=o.charCodeAt(0);if(255!==t[n])throw TypeError("Alphabet contains ambiguous characters: "+o);t[n]=e}const e=r.charAt(0),n=Math.log(o)/Math.log(256),l=Math.log(256)/Math.log(o);return{encode:function(t){if(0===t.length)return"";let n=0,a=0,c=0;const h=t.length;for(;c!==h&&0===t[c];)c++,n++;const f=(h-c)*l+1>>>0,i=new Uint8Array(f);for(;c!==h;){let r=t[c],e=0;for(let t=f-1
|
|
1
|
+
"use strict";exports.base=function(r){if(r.length>=255)throw TypeError("Alphabet too long");const t=new Uint8Array(256);for(let r=0;r<256;r++)t[r]=255;const o=r.length;for(let e=0;e<o;e++){const o=r.charAt(e),n=o.charCodeAt(0);if(255!==t[n])throw TypeError("Alphabet contains ambiguous characters: "+o);t[n]=e}const e=r.charAt(0),n=Math.log(o)/Math.log(256),l=Math.log(256)/Math.log(o);return{encode:function(t){if(0===t.length)return"";let n=0,a=0,c=0;const h=t.length;for(;c!==h&&0===t[c];)c++,n++;const f=(h-c)*l+1>>>0,i=new Uint8Array(f);for(;c!==h;){let r=t[c],e=0;for(let t=f-1;-1!==t&&(0!==r||e<a);t--,e++)r+=256*i[t]>>>0,i[t]=r%o>>>0,r=r/o>>>0;if(0!==r)throw Error("Non-zero carry");a=e,c++}let s=f-a;for(;s!==f&&0===i[s];)s++;let g=e.repeat(n);for(;s<f;++s)g+=r.charAt(i[s]);return g},decode:function(r){if(0===r.length)return new Uint8Array(0);let l=0,a=0,c=0;for(;r[l]===e;)a++,l++;const h=(r.length-l)*n+1>>>0,f=new Uint8Array(h);for(;l<r.length;){let e=t[r.charCodeAt(l)],n=0;for(let r=h-1;-1!==r&&(0!==e||n<c);r--,n++)e+=o*f[r]>>>0,f[r]=e%256>>>0,e=e/256>>>0;if(0!==e)throw Error("Non-zero carry");c=n,l++}let i=h-c;for(;i!==h&&0===f[i];)i++;const s=new Uint8Array(a+(h-i));let g=a;for(;i!==h;)s[g++]=f[i++];return s}}};
|
package/dist/base/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function r(r){if(r.length>=255)throw TypeError("Alphabet too long");const t=new Uint8Array(256);for(let r=0;r<256;r++)t[r]=255;const o=r.length;for(let e=0;e<o;e++){const o=r.charAt(e),n=o.charCodeAt(0);if(255!==t[n])throw TypeError("Alphabet contains ambiguous characters: "+o);t[n]=e}const e=r.charAt(0),n=Math.log(o)/Math.log(256),l=Math.log(256)/Math.log(o);return{encode:function(t){if(0===t.length)return"";let n=0,a=0,c=0;const h=t.length;for(;c!==h&&0===t[c];)c++,n++;const f=(h-c)*l+1>>>0,i=new Uint8Array(f);for(;c!==h;){let r=t[c],e=0;for(let t=f-1
|
|
1
|
+
function r(r){if(r.length>=255)throw TypeError("Alphabet too long");const t=new Uint8Array(256);for(let r=0;r<256;r++)t[r]=255;const o=r.length;for(let e=0;e<o;e++){const o=r.charAt(e),n=o.charCodeAt(0);if(255!==t[n])throw TypeError("Alphabet contains ambiguous characters: "+o);t[n]=e}const e=r.charAt(0),n=Math.log(o)/Math.log(256),l=Math.log(256)/Math.log(o);return{encode:function(t){if(0===t.length)return"";let n=0,a=0,c=0;const h=t.length;for(;c!==h&&0===t[c];)c++,n++;const f=(h-c)*l+1>>>0,i=new Uint8Array(f);for(;c!==h;){let r=t[c],e=0;for(let t=f-1;-1!==t&&(0!==r||e<a);t--,e++)r+=256*i[t]>>>0,i[t]=r%o>>>0,r=r/o>>>0;if(0!==r)throw Error("Non-zero carry");a=e,c++}let g=f-a;for(;g!==f&&0===i[g];)g++;let s=e.repeat(n);for(;g<f;++g)s+=r.charAt(i[g]);return s},decode:function(r){if(0===r.length)return new Uint8Array(0);let l=0,a=0,c=0;for(;r[l]===e;)a++,l++;const h=(r.length-l)*n+1>>>0,f=new Uint8Array(h);for(;l<r.length;){let e=t[r.charCodeAt(l)],n=0;for(let r=h-1;-1!==r&&(0!==e||n<c);r--,n++)e+=o*f[r]>>>0,f[r]=e%256>>>0,e=e/256>>>0;if(0!==e)throw Error("Non-zero carry");c=n,l++}let i=h-c;for(;i!==h&&0===f[i];)i++;const g=new Uint8Array(a+(h-i));let s=a;for(;i!==h;)g[s++]=f[i++];return g}}}export{r as base};
|
package/dist/fnv1a/index.d.ts
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
declare const __internal_hl_do_not_use__: string[];
|
|
3
|
-
declare function fnv1ahex(str: string): string;
|
|
1
|
+
import { fnv1a as fnv1a$1, fnv1ahex as fnv1ahex$1 } from 'fast-fnv1a';
|
|
4
2
|
|
|
5
|
-
|
|
3
|
+
/**
|
|
4
|
+
* @deprecated Use the `fast-fnv1a` package directly instead. This re-export is
|
|
5
|
+
* retained for backward compatibility only and will be removed in the next
|
|
6
|
+
* major version.
|
|
7
|
+
*/
|
|
8
|
+
declare const fnv1a: typeof fnv1a$1;
|
|
9
|
+
/**
|
|
10
|
+
* @deprecated Use the `fast-fnv1a` package directly instead. This re-export is
|
|
11
|
+
* retained for backward compatibility only and will be removed in the next
|
|
12
|
+
* major version.
|
|
13
|
+
*/
|
|
14
|
+
declare const fnv1ahex: typeof fnv1ahex$1;
|
|
15
|
+
|
|
16
|
+
export { fnv1a, fnv1ahex };
|
package/dist/fnv1a/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";var a=require("fast-fnv1a");const e=a.fnv1a,f=a.fnv1ahex;exports.fnv1a=e,exports.fnv1ahex=f;
|
package/dist/fnv1a/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{fnv1a as a,fnv1ahex as f}from"fast-fnv1a";const n=a,v=f;export{n as fnv1a,v as fnv1ahex};
|
package/dist/fnv1a52/index.d.ts
CHANGED
|
@@ -1,18 +1,22 @@
|
|
|
1
|
+
import { fnv1a52 as fnv1a52$1, fnv1a52base36 as fnv1a52base36$1, fnv1a52hex as fnv1a52hex$1 } from 'fnv1a52';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @deprecated Use the `fnv1a52` package directly instead. This re-export is
|
|
5
|
+
* retained for backward compatibility only and will be removed in the next
|
|
6
|
+
* major version.
|
|
7
|
+
*/
|
|
8
|
+
declare const fnv1a52: typeof fnv1a52$1;
|
|
9
|
+
/**
|
|
10
|
+
* @deprecated Use the `fnv1a52` package directly instead. This re-export is
|
|
11
|
+
* retained for backward compatibility only and will be removed in the next
|
|
12
|
+
* major version.
|
|
13
|
+
*/
|
|
14
|
+
declare const fnv1a52hex: typeof fnv1a52hex$1;
|
|
1
15
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* @author Travis Webb (tjwebb) <me@traviswebb.com>
|
|
6
|
-
*
|
|
7
|
-
* @description
|
|
8
|
-
*
|
|
9
|
-
* Ported from https://github.com/tjwebb/fnv-plus/blob/master/index.js
|
|
10
|
-
* Simplified, optimized and add modified for 52 bit, which provides a larger hash space
|
|
11
|
-
* and still making use of Javascript's 53-bit integer space.
|
|
12
|
-
*
|
|
13
|
-
* DO NOT USE toString(16) here! Use `fnv1a52hex` instead, way faster
|
|
16
|
+
* @deprecated Use the `fnv1a52` package directly instead. This re-export is
|
|
17
|
+
* retained for backward compatibility only and will be removed in the next
|
|
18
|
+
* major version.
|
|
14
19
|
*/
|
|
15
|
-
declare
|
|
16
|
-
declare function fnv1a52hex(str: string): string;
|
|
20
|
+
declare const fnv1a52base36: typeof fnv1a52base36$1;
|
|
17
21
|
|
|
18
|
-
export { fnv1a52, fnv1a52hex };
|
|
22
|
+
export { fnv1a52, fnv1a52base36, fnv1a52hex };
|
package/dist/fnv1a52/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var a=require("fnv1a52");const e=a.fnv1a52,n=a.fnv1a52hex,s=a.fnv1a52base36;exports.fnv1a52=e,exports.fnv1a52base36=s,exports.fnv1a52hex=n;
|
package/dist/fnv1a52/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{fnv1a52 as a,fnv1a52base36 as f,fnv1a52hex as n}from"fnv1a52";const v=a,s=n,e=f;export{v as fnv1a52,e as fnv1a52base36,s as fnv1a52hex};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";exports.headersToObject=function(e){
|
|
1
|
+
"use strict";exports.headersToObject=function(e){return e instanceof Headers?Object.fromEntries(e):null==e?{}:Object.fromEntries(new Headers(e))};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function e(e){
|
|
1
|
+
function e(e){return e instanceof Headers?Object.fromEntries(e):null==e?{}:Object.fromEntries(new Headers(e))}export{e as headersToObject};
|
package/dist/once/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";exports.once=function(t,e=!0){let
|
|
1
|
+
"use strict";exports.once=function(t,e=!0){let r;if(e)return r=t(),()=>r;let n=!1;return()=>(n||(n=!0,r=t()),r)};
|
package/dist/once/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function e(n
|
|
1
|
+
function e(t,n=!0){let r;if(n)return r=t(),()=>r;let o=!1;return()=>(o||(o=!0,r=t()),r)}export{e as once};
|
package/dist/retrie/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var t=require("../noop/index.js");const e=new Set([".","?","*","+","^","$","|","(",")","{","}","[","]","\\"]);function n(t,r=!1){const o={},i=(t,e)=>{let n,r=o;for(let o=0,i=t.length;o<i;++o)(n=t.charAt(o))in r||(r[n]=e?{"":""}:{}),r=r[n];r[""]=""};for(let e=0,n=t.length;e<n;++e)i(t[e],r);const s=()=>(function t(n){let r,o
|
|
1
|
+
"use strict";var t=require("../noop/index.js");const e=new Set([".","?","*","+","^","$","|","(",")","{","}","[","]","\\"]);function n(t,r=!1){const o={},i=(t,e)=>{let n,r=o;for(let o=0,i=t.length;o<i;++o)(n=t.charAt(o))in r||(r[n]=e?{"":""}:{}),r=r[n];r[""]=""};for(let e=0,n=t.length;e<n;++e)i(t[e],r);const s=()=>(function t(n){let r,o=!1;const i=[],s=[];for(const c in n){if(!c){o=!0;continue}((r=t(n[c]))?i:s).push(("-"===c?"\\x2d":e.has(c)?"\\"+c:c)+r)}if(o&&null==r)return"";const c=!i.length;s.length&&i.push(s[1]?"["+s.join("")+"]":s[0]);let l=i[1]?"(?:"+i.join("|")+")":i[0];return o&&(l=c?l+"?":"(?:"+l+")?"),l||""})(o);return{tree:o,add:i,toString:s,toRe:()=>new RegExp((r?"^":"")+s())}}exports.createRetrieKeywordFilter=function(e,r=!1){if(0===e.length)return t.falseFn;const o=n(e,r).toRe();return o.test.bind(o)},exports.retrie=n;
|
package/dist/retrie/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{falseFn as t}from"../noop/index.mjs";const n=new Set([".","?","*","+","^","$","|","(",")","{","}","[","]","\\"]);function e(t,o=!1){const r={},i=(t,n)=>{let e,o=r;for(let r=0,i=t.length;r<i;++r)(e=t.charAt(r))in o||(o[e]=n?{"":""}:{}),o=o[e];o[""]=""};for(let n=0,e=t.length;n<e;++n)i(t[n],o);const c=()=>(function t(e){let o,r
|
|
1
|
+
import{falseFn as t}from"../noop/index.mjs";const n=new Set([".","?","*","+","^","$","|","(",")","{","}","[","]","\\"]);function e(t,o=!1){const r={},i=(t,n)=>{let e,o=r;for(let r=0,i=t.length;r<i;++r)(e=t.charAt(r))in o||(o[e]=n?{"":""}:{}),o=o[e];o[""]=""};for(let n=0,e=t.length;n<e;++n)i(t[n],o);const c=()=>(function t(e){let o,r=!1;const i=[],c=[];for(const l in e){if(!l){r=!0;continue}((o=t(e[l]))?i:c).push(("-"===l?"\\x2d":n.has(l)?"\\"+l:l)+o)}if(r&&null==o)return"";const l=!i.length;c.length&&i.push(c[1]?"["+c.join("")+"]":c[0]);let s=i[1]?"(?:"+i.join("|")+")":i[0];return r&&(s=l?s+"?":"(?:"+s+")?"),s||""})(r);return{tree:r,add:i,toString:c,toRe:()=>new RegExp((o?"^":"")+c())}}function o(n,r=!1){if(0===n.length)return t;const i=e(n,r).toRe();return i.test.bind(i)}export{o as createRetrieKeywordFilter,e as retrie};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var r=require("fnv1a52");exports.simpleStringHash=function(t){return r.fnv1a52base36(t)+t.length.toString(36)};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{fnv1a52base36 as t}from"fnv1a52";function n(n){return t(n)+n.length.toString(36)}export{n as simpleStringHash};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "foxts",
|
|
3
|
-
"version": "5.8.
|
|
3
|
+
"version": "5.8.1",
|
|
4
4
|
"description": "Opinionated collection of common TypeScript utils by @SukkaW",
|
|
5
5
|
"repository": {
|
|
6
6
|
"url": "https://github.com/SukkaW/foxts"
|
|
@@ -355,32 +355,36 @@
|
|
|
355
355
|
],
|
|
356
356
|
"author": "SukkaW <https://skk.moe>",
|
|
357
357
|
"license": "MIT",
|
|
358
|
+
"dependencies": {
|
|
359
|
+
"fast-fnv1a": "^1.0.0",
|
|
360
|
+
"fnv1a52": "^1.0.0"
|
|
361
|
+
},
|
|
358
362
|
"devDependencies": {
|
|
359
|
-
"@eslint-sukka/node": "^8.
|
|
360
|
-
"@happy-dom/global-registrator": "^20.
|
|
363
|
+
"@eslint-sukka/node": "^8.14.1",
|
|
364
|
+
"@happy-dom/global-registrator": "^20.11.1",
|
|
361
365
|
"@istanbuljs/nyc-config-typescript": "^1.0.2",
|
|
362
366
|
"@mitata/counters": "^0.0.8",
|
|
363
|
-
"@monyone/aho-corasick": "^1.1.
|
|
367
|
+
"@monyone/aho-corasick": "^1.1.23",
|
|
364
368
|
"@package-json/types": "^0.0.13",
|
|
365
|
-
"@swc-node/register": "^1.
|
|
366
|
-
"@swc/core": "^1.15.
|
|
369
|
+
"@swc-node/register": "^1.12.1",
|
|
370
|
+
"@swc/core": "^1.15.46",
|
|
367
371
|
"@types/mocha": "^10.0.10",
|
|
368
372
|
"@types/node": "^22.20.1",
|
|
369
373
|
"@types/sinon": "^21.0.1",
|
|
370
374
|
"bumpp": "^10.4.1",
|
|
371
375
|
"earl": "^2.0.0",
|
|
372
|
-
"eslint": "^10.
|
|
373
|
-
"eslint-config-sukka": "^8.
|
|
374
|
-
"eslint-formatter-sukka": "^8.
|
|
376
|
+
"eslint": "^10.8.0",
|
|
377
|
+
"eslint-config-sukka": "^8.14.1",
|
|
378
|
+
"eslint-formatter-sukka": "^8.14.1",
|
|
375
379
|
"fastscan": "^1.0.6",
|
|
376
|
-
"happy-dom": "^20.
|
|
380
|
+
"happy-dom": "^20.11.1",
|
|
377
381
|
"is-ci": "^4.1.0",
|
|
378
382
|
"is-network-error": "^1.3.2",
|
|
379
383
|
"mitata": "^1.0.34",
|
|
380
384
|
"mocha": "^11.7.6",
|
|
381
385
|
"modern-ahocorasick": "^2.0.4",
|
|
382
386
|
"nyc": "^18.0.0",
|
|
383
|
-
"rollup": "^4.62.
|
|
387
|
+
"rollup": "^4.62.3",
|
|
384
388
|
"rollup-plugin-dts": "^6.4.1",
|
|
385
389
|
"rollup-plugin-oxc-resolve": "^0.0.5",
|
|
386
390
|
"rollup-plugin-swc3": "^0.12.1",
|