foxts 3.14.1 → 4.0.0-beta.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/add-array-elements-to-set/index.js +1 -0
- package/dist/add-array-elements-to-set/index.mjs +1 -0
- package/dist/ahocorasick/index.js +1 -0
- package/dist/ahocorasick/index.mjs +1 -0
- package/dist/append-array-in-place/index.js +1 -0
- package/dist/append-array-in-place/index.mjs +1 -0
- package/dist/append-set-elements-to-array/index.js +1 -0
- package/dist/append-set-elements-to-array/index.mjs +1 -0
- package/dist/async-write-to-stream/index.js +1 -0
- package/dist/{async-write-to-stream.mjs → async-write-to-stream/index.mjs} +1 -1
- package/dist/{available-parallelism.d.ts → available-parallelism/index.d.ts} +1 -1
- package/dist/available-parallelism/index.js +1 -0
- package/dist/{available-parallelism.mjs → available-parallelism/index.mjs} +1 -1
- package/dist/bitwise/index.js +1 -0
- package/dist/bitwise/index.mjs +1 -0
- package/dist/chunk/index.js +1 -0
- package/dist/chunk/index.mjs +1 -0
- package/dist/compare-source/index.js +1 -0
- package/dist/compare-source/index.mjs +1 -0
- package/dist/create-fixed-array/index.js +1 -0
- package/dist/create-fixed-array/index.mjs +1 -0
- package/dist/define-lazy-property/index.js +1 -0
- package/dist/define-lazy-property/index.mjs +1 -0
- package/dist/detect-eol/index.js +1 -0
- package/dist/detect-eol/index.mjs +1 -0
- package/dist/empty-node/index.js +1 -0
- package/dist/empty-node/index.mjs +1 -0
- package/dist/{escape-html.d.ts → escape-html/index.d.ts} +1 -0
- package/dist/escape-html/index.js +1 -0
- package/dist/escape-html/index.mjs +1 -0
- package/dist/escape-string-regexp/index.js +1 -0
- package/dist/{escape-string-regexp.mjs → escape-string-regexp/index.mjs} +1 -1
- package/dist/extract-error-message/index.js +1 -0
- package/dist/{extract-error-message.mjs → extract-error-message/index.mjs} +1 -1
- package/dist/fast-ip-version/index.js +1 -0
- package/dist/{fast-ip-version.mjs → fast-ip-version/index.mjs} +1 -1
- package/dist/fast-string-array-join/index.js +1 -0
- package/dist/fast-string-array-join/index.mjs +1 -0
- package/dist/fast-string-compare/index.d.ts +12 -0
- package/dist/fast-string-compare/index.js +1 -0
- package/dist/fast-string-compare/index.mjs +1 -0
- package/dist/fifo/index.js +1 -0
- package/dist/fifo/index.mjs +1 -0
- package/dist/fnv1a/index.js +1 -0
- package/dist/{fnv1a.mjs → fnv1a/index.mjs} +1 -1
- package/dist/fnv1a52/index.js +1 -0
- package/dist/fnv1a52/index.mjs +1 -0
- package/dist/guard/index.js +1 -0
- package/dist/guard/index.mjs +1 -0
- package/dist/{headers-to-object.d.ts → headers-to-object/index.d.ts} +1 -1
- package/dist/headers-to-object/index.js +1 -0
- package/dist/headers-to-object/index.mjs +1 -0
- package/dist/identity/index.js +1 -0
- package/dist/identity/index.mjs +1 -0
- package/dist/is-function/index.d.ts +4 -0
- package/dist/is-function/index.js +1 -0
- package/dist/is-function/index.mjs +1 -0
- package/dist/is-probably-ip/index.js +1 -0
- package/dist/is-probably-ip/index.mjs +1 -0
- package/dist/lazy-promise/index.js +1 -0
- package/dist/lazy-promise/index.mjs +1 -0
- package/dist/lazy-value/index.js +1 -0
- package/dist/lazy-value/index.mjs +1 -0
- package/dist/merge-headers/index.js +1 -0
- package/dist/merge-headers/index.mjs +1 -0
- package/dist/noop/index.js +1 -0
- package/dist/noop/index.mjs +1 -0
- package/dist/once/index.js +1 -0
- package/dist/{once.mjs → once/index.mjs} +1 -1
- package/dist/pick-random/index.js +1 -0
- package/dist/pick-random/index.mjs +1 -0
- package/dist/random-int/index.js +1 -0
- package/dist/random-int/index.mjs +1 -0
- package/dist/repool/index.js +1 -0
- package/dist/repool/index.mjs +1 -0
- package/dist/{retrie.d.ts → retrie/index.d.ts} +2 -2
- package/dist/retrie/index.js +1 -0
- package/dist/retrie/index.mjs +1 -0
- package/dist/shuffle-array/index.js +1 -0
- package/dist/shuffle-array/index.mjs +1 -0
- package/dist/simple-string-hash/index.js +1 -0
- package/dist/simple-string-hash/index.mjs +1 -0
- package/dist/string-join/index.js +1 -0
- package/dist/string-join/index.mjs +1 -0
- package/dist/tagged/index.js +1 -0
- package/dist/{tagged.mjs → tagged/index.mjs} +1 -1
- package/dist/text-line-stream/index.js +1 -0
- package/dist/text-line-stream/index.mjs +1 -0
- package/dist/uint8array-utils/index.d.ts +6 -0
- package/dist/uint8array-utils/index.js +1 -0
- package/dist/uint8array-utils/index.mjs +1 -0
- package/dist/wait/index.js +1 -0
- package/dist/wait/index.mjs +1 -0
- package/package.json +110 -96
- package/dist/add-array-elements-to-set.js +0 -1
- package/dist/add-array-elements-to-set.mjs +0 -1
- package/dist/ahocorasick.js +0 -1
- package/dist/ahocorasick.mjs +0 -1
- package/dist/append-array-in-place.js +0 -1
- package/dist/append-array-in-place.mjs +0 -1
- package/dist/append-set-elements-to-array.js +0 -1
- package/dist/append-set-elements-to-array.mjs +0 -1
- package/dist/async-write-to-stream.js +0 -1
- package/dist/available-parallelism.js +0 -1
- package/dist/bitwise.js +0 -1
- package/dist/bitwise.mjs +0 -1
- package/dist/chunk.js +0 -1
- package/dist/chunk.mjs +0 -1
- package/dist/compare-source.js +0 -1
- package/dist/compare-source.mjs +0 -1
- package/dist/create-fixed-array.js +0 -1
- package/dist/create-fixed-array.mjs +0 -1
- package/dist/define-lazy-property.js +0 -1
- package/dist/define-lazy-property.mjs +0 -1
- package/dist/detect-eol.js +0 -1
- package/dist/detect-eol.mjs +0 -1
- package/dist/empty-node.js +0 -1
- package/dist/empty-node.mjs +0 -1
- package/dist/escape-html.js +0 -1
- package/dist/escape-html.mjs +0 -1
- package/dist/escape-string-regexp.js +0 -1
- package/dist/extract-error-message.js +0 -1
- package/dist/fast-ip-version.js +0 -1
- package/dist/fast-string-array-join.js +0 -1
- package/dist/fast-string-array-join.mjs +0 -1
- package/dist/fifo.js +0 -1
- package/dist/fifo.mjs +0 -1
- package/dist/fnv1a.js +0 -1
- package/dist/fnv1a52.js +0 -1
- package/dist/fnv1a52.mjs +0 -1
- package/dist/guard.js +0 -1
- package/dist/guard.mjs +0 -1
- package/dist/headers-to-object.js +0 -1
- package/dist/headers-to-object.mjs +0 -1
- package/dist/identity.js +0 -1
- package/dist/identity.mjs +0 -1
- package/dist/is-probably-ip.js +0 -1
- package/dist/is-probably-ip.mjs +0 -1
- package/dist/lazy-promise.js +0 -1
- package/dist/lazy-promise.mjs +0 -1
- package/dist/lazy-value.js +0 -1
- package/dist/lazy-value.mjs +0 -1
- package/dist/merge-headers.js +0 -1
- package/dist/merge-headers.mjs +0 -1
- package/dist/noop.js +0 -1
- package/dist/noop.mjs +0 -1
- package/dist/once.js +0 -1
- package/dist/pick-random.js +0 -1
- package/dist/pick-random.mjs +0 -1
- package/dist/random-int.js +0 -1
- package/dist/random-int.mjs +0 -1
- package/dist/repool.js +0 -1
- package/dist/repool.mjs +0 -1
- package/dist/retrie.js +0 -1
- package/dist/retrie.mjs +0 -1
- package/dist/serialized-memo.d.ts +0 -60
- package/dist/serialized-memo.js +0 -1
- package/dist/serialized-memo.mjs +0 -1
- package/dist/shuffle-array.js +0 -1
- package/dist/shuffle-array.mjs +0 -1
- package/dist/simple-string-hash.js +0 -1
- package/dist/simple-string-hash.mjs +0 -1
- package/dist/string-join.js +0 -1
- package/dist/string-join.mjs +0 -1
- package/dist/tagged.js +0 -1
- package/dist/text-line-stream.js +0 -1
- package/dist/text-line-stream.mjs +0 -1
- package/dist/wait.js +0 -1
- package/dist/wait.mjs +0 -1
- /package/dist/{add-array-elements-to-set.d.ts → add-array-elements-to-set/index.d.ts} +0 -0
- /package/dist/{ahocorasick.d.ts → ahocorasick/index.d.ts} +0 -0
- /package/dist/{append-array-in-place.d.ts → append-array-in-place/index.d.ts} +0 -0
- /package/dist/{append-set-elements-to-array.d.ts → append-set-elements-to-array/index.d.ts} +0 -0
- /package/dist/{async-write-to-stream.d.ts → async-write-to-stream/index.d.ts} +0 -0
- /package/dist/{bitwise.d.ts → bitwise/index.d.ts} +0 -0
- /package/dist/{chunk.d.ts → chunk/index.d.ts} +0 -0
- /package/dist/{compare-source.d.ts → compare-source/index.d.ts} +0 -0
- /package/dist/{create-fixed-array.d.ts → create-fixed-array/index.d.ts} +0 -0
- /package/dist/{define-lazy-property.d.ts → define-lazy-property/index.d.ts} +0 -0
- /package/dist/{detect-eol.d.ts → detect-eol/index.d.ts} +0 -0
- /package/dist/{empty-node.d.ts → empty-node/index.d.ts} +0 -0
- /package/dist/{escape-string-regexp.d.ts → escape-string-regexp/index.d.ts} +0 -0
- /package/dist/{extract-error-message.d.ts → extract-error-message/index.d.ts} +0 -0
- /package/dist/{fast-ip-version.d.ts → fast-ip-version/index.d.ts} +0 -0
- /package/dist/{fast-string-array-join.d.ts → fast-string-array-join/index.d.ts} +0 -0
- /package/dist/{fifo.d.ts → fifo/index.d.ts} +0 -0
- /package/dist/{fnv1a.d.ts → fnv1a/index.d.ts} +0 -0
- /package/dist/{fnv1a52.d.ts → fnv1a52/index.d.ts} +0 -0
- /package/dist/{guard.d.ts → guard/index.d.ts} +0 -0
- /package/dist/{identity.d.ts → identity/index.d.ts} +0 -0
- /package/dist/{is-probably-ip.d.ts → is-probably-ip/index.d.ts} +0 -0
- /package/dist/{lazy-promise.d.ts → lazy-promise/index.d.ts} +0 -0
- /package/dist/{lazy-value.d.ts → lazy-value/index.d.ts} +0 -0
- /package/dist/{merge-headers.d.ts → merge-headers/index.d.ts} +0 -0
- /package/dist/{noop.d.ts → noop/index.d.ts} +0 -0
- /package/dist/{once.d.ts → once/index.d.ts} +0 -0
- /package/dist/{pick-random.d.ts → pick-random/index.d.ts} +0 -0
- /package/dist/{random-int.d.ts → random-int/index.d.ts} +0 -0
- /package/dist/{repool.d.ts → repool/index.d.ts} +0 -0
- /package/dist/{shuffle-array.d.ts → shuffle-array/index.d.ts} +0 -0
- /package/dist/{simple-string-hash.d.ts → simple-string-hash/index.d.ts} +0 -0
- /package/dist/{string-join.d.ts → string-join/index.d.ts} +0 -0
- /package/dist/{tagged.d.ts → tagged/index.d.ts} +0 -0
- /package/dist/{text-line-stream.d.ts → text-line-stream/index.d.ts} +0 -0
- /package/dist/{wait.d.ts → wait/index.d.ts} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var e=require("../identity/index.js");exports.addArrayElementsToSet=function(t,r,i=e.identity){return r.forEach(e=>t.add(i(e))),t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{identity as r}from"../identity/index.mjs";function t(e,d,n=r){return d.forEach(r=>e.add(n(r))),e}export{t as addArrayElementsToSet};
|
|
@@ -0,0 +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,s=e.length;o<s;o++){const s=e[o];if(r.has(s))r=r.get(s);else{const e=new t(!1,void 0);r.set(s,e),r=e}}r!==o&&(r.wordEnd=!0)});const r=[o];for(;r.length;){const t=r.pop();t.forEach((e,s)=>{let n=t.fail;for(;n&&!n.has(s);)n=n.fail;e.fail=n?n.get(s):o,r.push(e)})}return t=>{let e=o;for(let r=0,s=t.length;r<s;r++){const s=t[r];for(;e&&!e.has(s);)e=e.fail;if((e=e?e.get(s):o).wordEnd)return!0}return!1}};
|
|
@@ -0,0 +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.pop();t.forEach((o,n)=>{let s=t.fail;for(;s&&!s.has(n);)s=s.fail;o.fail=s?s.get(n):e,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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";function e(e,p){let r=0,n=p.length;if(n<=65535)e.push.apply(e,p);else for(;n>0;){const s=n>65535?65535:n,t=p.slice(r,r+s);e.push.apply(e,t),n-=s,r+=s}return e}exports.appendArrayInPlace=e,exports.appendArrayInPlaceCurried=p=>r=>e(p,r);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e,p){let n=0,r=p.length;if(r<=65535)e.push.apply(e,p);else for(;r>0;){const a=r>65535?65535:r,l=p.slice(n,n+a);e.push.apply(e,l),r-=a,n+=a}return e}const p=p=>n=>e(p,n);export{e as appendArrayInPlace,p as appendArrayInPlaceCurried};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var e=require("../identity/index.js");function r(e,r,t){let n;const i=r.values();for(;!(n=i.next()).done;)e.push(t(n.value));return e}exports.appendSetElementsToArray=function(t,n,i=e.identity){if(!Array.isArray(n))return r(t,n,i);for(let e=0,u=n.length;e<u;e++)r(t,n[e],i);return t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{identity as e}from"../identity/index.mjs";function r(e,r,t){let n;const o=r.values();for(;!(n=o.next()).done;)e.push(t(n.value));return e}function t(n,o,i=e){if(!Array.isArray(o))return r(n,o,i);for(let e=0,t=o.length;e<t;e++)r(n,o[e],i);return n}export{t as appendSetElementsToArray};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var e=require("node:events");exports.asyncWriteToStream=function(r,n){return r.write(n)?null:e.once(r,"drain")};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{once as r}from"node:events";function e(e,n){return e.write(n)?null:r(e,"drain")}export{e as asyncWriteToStream};
|
|
1
|
+
import{once as r}from"node:events";function e(e,n){return e.write(n)?null:r(e,"drain")}export{e as asyncWriteToStream};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";function e(e){return"object"==typeof e&&null!==e&&"cpus"in e&&"function"==typeof e.cpus}function n(e){return"object"==typeof e&&null!==e&&"hardwareConcurrency"in e&&"number"==typeof e.hardwareConcurrency}function a(e){return"availableParallelism"in e&&"function"==typeof e.availableParallelism?e.availableParallelism():e.cpus().length||1}exports.availableParallelism=function(r){return null==r?"object"==typeof window&&"navigator"in globalThis&&n(globalThis.navigator)?Promise.resolve(globalThis.navigator.hardwareConcurrency||1):import("node:os").then(n=>e(n)?a(n):1).catch(()=>1):e(r)?a(r):n(r)?r.hardwareConcurrency??1:"then"in r&&"function"==typeof r.then?r.then(a):1},exports.isNavigatorLike=n,exports.isNodeOSLike=e;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function n(n){return null==n?"object"==typeof window&&"navigator"in globalThis&&a(globalThis.navigator)?Promise.resolve(globalThis.navigator.hardwareConcurrency
|
|
1
|
+
function n(n){return null==n?"object"==typeof window&&"navigator"in globalThis&&a(globalThis.navigator)?Promise.resolve(globalThis.navigator.hardwareConcurrency||1):import("node:os").then(n=>e(n)?r(n):1).catch(()=>1):e(n)?r(n):a(n)?n.hardwareConcurrency??1:"then"in n&&"function"==typeof n.then?n.then(r):1}function e(n){return"object"==typeof n&&null!==n&&"cpus"in n&&"function"==typeof n.cpus}function a(n){return"object"==typeof n&&null!==n&&"hardwareConcurrency"in n&&"number"==typeof n.hardwareConcurrency}function r(n){return"availableParallelism"in n&&"function"==typeof n.availableParallelism?n.availableParallelism():n.cpus().length||1}export{n as availableParallelism,a as isNavigatorLike,e as isNodeOSLike};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const t=t=>t>>16&65535,e=t=>65535&t,r=t=>t>>20&1023,s=t=>t>>10&1023,o=t=>1023&t;exports.bitCount=function(t){return t-=t>>1&0x55555555,((t=(0x33333333&t)+(t>>2&0x33333333))+(t>>4)&0xf0f0f0f)*0x1010101>>24},exports.deleteBit=(t,e)=>t&~e,exports.getBit=(t,e)=>!!(t&e),exports.missingBit=(t,e)=>!(t&e),exports.packThreeBits=(t,e,r)=>t<<20|e<<10|r,exports.packTwoBits=(t,e)=>t<<16|e,exports.setBit=(t,e)=>t|e,exports.unpackThreeBits=function(t,e=Array.from([,,,].keys())){return e[0]=r(t),e[1]=s(t),e[2]=o(t),e},exports.unpackThreeBitsFirst=r,exports.unpackThreeBitsSecond=s,exports.unpackThreeBitsThird=o,exports.unpackTwoBits=function(r,s=Array.from([,,].keys())){return s[0]=t(r),s[1]=e(r),s},exports.unpackTwoBitsFirst=t,exports.unpackTwoBitsSecond=e;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function t(t){return t-=t>>1&0x55555555,((t=(0x33333333&t)+(t>>2&0x33333333))+(t>>4)&0xf0f0f0f)*0x1010101>>24}const e=(t,e)=>!!(t&e),i=(t,e)=>!(t&e),n=(t,e)=>t|e,r=(t,e)=>t&~e,s=(t,e)=>t<<16|e,c=t=>t>>16&65535,o=t=>65535&t;function u(t,e=Array.from([,,].keys())){return e[0]=c(t),e[1]=o(t),e}const B=(t,e,i)=>t<<20|e<<10|i,a=t=>t>>20&1023,k=t=>t>>10&1023,p=t=>1023&t;function T(t,e=Array.from([,,,].keys())){return e[0]=a(t),e[1]=k(t),e[2]=p(t),e}export{t as bitCount,r as deleteBit,e as getBit,i as missingBit,B as packThreeBits,s as packTwoBits,n as setBit,T as unpackThreeBits,a as unpackThreeBitsFirst,k as unpackThreeBitsSecond,p as unpackThreeBitsThird,u as unpackTwoBits,c as unpackTwoBitsFirst,o as unpackTwoBitsSecond};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";exports.chunk=function(t,e){const r=Math.ceil(t.length/e),c=Array(r);let n=0,l=0;for(let s=0;s<r;s++)l=(n=s*e)+e,c[s]=t.slice(n,l);return c};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function t(t,e){const n=Math.ceil(t.length/e),r=Array(n);let c=0,l=0;for(let o=0;o<n;o++)l=(c=o*e)+e,r[o]=t.slice(c,l);return r}export{t as chunk};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var t=require("../guard/index.js");function e(r=Object.is){return async function(e,n){if(0===e.length)return!1;const o=e.length;let i=-1;const a=Symbol.asyncIterator in n?n[Symbol.asyncIterator]():Symbol.iterator in n?n[Symbol.iterator]():null;t.invariant(a,"source must be iterable or async iterable");let c=await a.next();if(!c.done){let t=c.value;do{if(++i===o||!r(e[i],t))return!1;t=(c=await a.next()).value}while(!c.done)}return i===o-1}}async function r(t,n,o=Object.is){return e(o)(t,n)}exports.compareSource=r,exports.createCompareSource=e,exports.fileEqualWithCommentComparator=function(t,e){if(0===t.length)return 0===e.length;const r=t.codePointAt(0);return r===e.codePointAt(0)&&(35===r||33===r||t===e)};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{invariant as t}from"../guard/index.mjs";function e(n=Object.is){return async function(e,r){if(0===e.length)return!1;const o=e.length;let i=-1;const a=Symbol.asyncIterator in r?r[Symbol.asyncIterator]():Symbol.iterator in r?r[Symbol.iterator]():null;t(a,"source must be iterable or async iterable");let c=await a.next();if(!c.done){let t=c.value;do{if(++i===o||!n(e[i],t))return!1;t=(c=await a.next()).value}while(!c.done)}return i===o-1}}async function n(t,r,o=Object.is){return e(o)(t,r)}function r(t,e){if(0===t.length)return 0===e.length;const n=t.codePointAt(0);return n===e.codePointAt(0)&&(35===n||33===n||t===e)}export{n as compareSource,e as createCompareSource,r as fileEqualWithCommentComparator};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=new Map;function t(e){return Array.from(Array(e).keys())}function r(r){if(e.has(r))return e.get(r);const n=t(r);return e.set(r,n),n}const n=new Map;function o(e){let r,o;return n.has(e)&&(o=(r=n.get(e)).deref()),o||(r=new WeakRef(o=t(e)),n.set(e,r)),o}const s="function"==typeof WeakRef?o:r,a=s(0);exports.EMPTY_ARRAY=a,exports.createFixedArray=s,exports.createFixedArrayWithGC=o,exports.createFixedArrayWithoutGC=r;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=new Map;function t(e){return Array.from(Array(e).keys())}function r(r){if(e.has(r))return e.get(r);const n=t(r);return e.set(r,n),n}const n=new Map;function a(e){let r,a;return n.has(e)&&(a=(r=n.get(e)).deref()),a||(r=new WeakRef(a=t(e)),n.set(e,r)),a}const o="function"==typeof WeakRef?a:r,c=o(0);export{c as EMPTY_ARRAY,o as createFixedArray,a as createFixedArrayWithGC,r as createFixedArrayWithoutGC};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";exports.defineLazyProperty=function(e,r,t){const n=t=>Object.defineProperty(e,r,{value:t,enumerable:!0,writable:!0});return Object.defineProperty(e,r,{configurable:!0,enumerable:!0,get(){const e=t();return n(e),e},set(e){n(e)}}),e};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e,r,t){const n=t=>Object.defineProperty(e,r,{value:t,enumerable:!0,writable:!0});return Object.defineProperty(e,r,{configurable:!0,enumerable:!0,get(){const e=t();return n(e),e},set(e){n(e)}}),e}export{e as defineLazyProperty};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";exports.detectEol=function(t){for(let n=0,r=t.length;n<r;n++){const r=t[n];if("\n"===r)break;if("\r"===r&&"\n"===t[n+1])return"\r\n"}return"\n"};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function n(n){for(let r=0,t=n.length;r<t;r++){const t=n[r];if("\n"===t)break;if("\r"===t&&"\n"===n[r+1])return"\r\n"}return"\n"}export{n as detectEol};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";function e(e){for(;e.firstChild;)e.removeChild(e.lastChild)}function t(e){e.replaceChildren()}const n="undefined"!=typeof Element&&"replaceChildren"in Element.prototype?t:e;exports.emptyElement=n,exports.emptyElementModern=t,exports.emptyNode=e;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e){for(;e.firstChild;)e.removeChild(e.lastChild)}function t(e){e.replaceChildren()}const n="undefined"!=typeof Element&&"replaceChildren"in Element.prototype?t:e;export{n as emptyElement,t as emptyElementModern,e as emptyNode};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var e=require("fast-escape-html");Object.keys(e).forEach(function(t){"default"===t||Object.prototype.hasOwnProperty.call(exports,t)||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return e[t]}})});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export*from"fast-escape-html";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var e=require("fast-escape-regexp");Object.defineProperty(exports,"escapeStringRegexp",{enumerable:!0,get:function(){return e.escapeRegexp}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{escapeRegexp as escapeStringRegexp}from"fast-escape-regexp";
|
|
1
|
+
export{escapeRegexp as escapeStringRegexp}from"fast-escape-regexp";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";function t(t){return"object"==typeof t&&null!==t&&"name"in t&&"string"==typeof t.name&&"message"in t&&"string"==typeof t.message&&(!("stack"in t)||"string"==typeof t.stack)}exports.extractErrorMessage=function(e,s=!0,n=!1){if(!t(e))return null;let r="";return s&&(r+=e.name,r+=": "),r+=e.message,n&&"stack"in e&&"string"==typeof e.stack&&(r+="\n"+e.stack),r.trim()},exports.isErrorLikeObject=t;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function t(t){return"object"==typeof t&&null!==t&&"name"in t&&"string"==typeof t.name&&"message"in t&&"string"==typeof t.message&&(!("stack"in t)||"string"==typeof t.stack)}function e(n,r=!0,s=!1){if(!t(n))return null;let i="";return r&&(i+=n.name,i+=": "),i+=n.message,s&&"stack"in n&&"string"==typeof n.stack&&(i+="\n"+n.stack),i.trim()}export{e as extractErrorMessage,t as isErrorLikeObject};
|
|
1
|
+
function t(t){return"object"==typeof t&&null!==t&&"name"in t&&"string"==typeof t.name&&"message"in t&&"string"==typeof t.message&&(!("stack"in t)||"string"==typeof t.stack)}function e(n,r=!0,s=!1){if(!t(n))return null;let i="";return r&&(i+=n.name,i+=": "),i+=n.message,s&&"stack"in n&&"string"==typeof n.stack&&(i+="\n"+n.stack),i.trim()}export{e as extractErrorMessage,t as isErrorLikeObject};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";exports.fastIpVersion=function(s){return s.includes(":")?6:4*!!s.includes(".")};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function n(n){return n.includes(":")?6:4*!!n.includes(".")}export{n as fastIpVersion};
|
|
1
|
+
function n(n){return n.includes(":")?6:4*!!n.includes(".")}export{n as fastIpVersion};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";exports.fastStringArrayJoin=function(t,r){const n=t.length;if(0===n)return"";let e=t[0];for(let i=1;i<n;i++)e+=r,e+=t[i];return e};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function t(t,r){const n=t.length;if(0===n)return"";let e=t[0];for(let o=1;o<n;o++)e+=r,e+=t[o];return e}export{t as fastStringArrayJoin};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This is an alternative to `String.prototype.localeCompare`, but way more performant.
|
|
3
|
+
*
|
|
4
|
+
* `String#localeCompare` is slow because it supports internationalization (e.g. `Intl.Collator`).
|
|
5
|
+
* But if you are only working with ASCII-only characters, this function will produce the same result
|
|
6
|
+
* as `String#localeCompare` with en-US settings, but much faster.
|
|
7
|
+
*
|
|
8
|
+
* This function is expected to be used as a sorter callback for `Array#sort`, `Array#toSorted`, and similar functions.
|
|
9
|
+
*/
|
|
10
|
+
declare function fastStringCompare(a: string, b: string): number;
|
|
11
|
+
|
|
12
|
+
export { fastStringCompare };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";exports.fastStringCompare=function(t,e){const r=t.length,n=e.length,o=r<n?r:n;let c=0;for(let r=0;r<o;++r)if(0!=(c=t.charCodeAt(r)-e.charCodeAt(r)))return c;return r===n?0:r>n?1:-1};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function t(t,e){const r=t.length,n=e.length,o=r<n?r:n;let a=0;for(let r=0;r<o;++r)if(0!=(a=t.charCodeAt(r)-e.charCodeAt(r)))return a;return r===n?0:r>n?1:-1}export{t as fastStringCompare};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var e;e=Symbol.iterator;class t{head=null;tail=null;$size=0;constructor(){this.clear()}enqueue(e){const t=[e,null];this.head?this.tail[1]=t:this.head=t,this.tail=t,this.$size++}push=this.enqueue;dequeue(){const e=this.head;if(e)return this.head=this.head[1],this.$size--,e[0]}shift=this.dequeue;peek(){return this.head?.[0]}clear(){this.head=null,this.tail=null,this.$size=0}get size(){return this.$size}get length(){return this.$size}*[e](){let e=this.head;for(;e;)yield e[0],e=e[1]}}exports.FIFO=t;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e;e=Symbol.iterator;class t{head=null;tail=null;$size=0;constructor(){this.clear()}enqueue(e){const t=[e,null];this.head?this.tail[1]=t:this.head=t,this.tail=t,this.$size++}push=this.enqueue;dequeue(){const e=this.head;if(e)return this.head=this.head[1],this.$size--,e[0]}shift=this.dequeue;peek(){return this.head?.[0]}clear(){this.head=null,this.tail=null,this.$size=0}get size(){return this.$size}get length(){return this.$size}*[e](){let e=this.head;for(;e;)yield e[0],e=e[1]}}export{t as FIFO};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";exports.fnv1a=function(t){let e=0x811c9dc5;for(let r=0,c=t.length;r<c;r++)e^=t.charCodeAt(r),e+=(e<<1)+(e<<4)+(e<<7)+(e<<8)+(e<<24);return e>>>0};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function t(t){let e=0x811c9dc5;for(let n=0,r=t.length;n<r;n++)e^=t.charCodeAt(n),e+=(e<<1)+(e<<4)+(e<<7)+(e<<8)+(e<<24);return e>>>0}export{t as fnv1a};
|
|
1
|
+
function t(t){let e=0x811c9dc5;for(let n=0,r=t.length;n<r;n++)e^=t.charCodeAt(n),e+=(e<<1)+(e<<4)+(e<<7)+(e<<8)+(e<<24);return e>>>0}export{t as fnv1a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";exports.fnv1a52=function(t){const e=t.length;let n=0,r=0,o=8997,c=0,s=33826,f=0,u=40164,x=0,a=52210;for(;n<e;)o^=t.charCodeAt(n++),r=435*o,c=435*s,f=435*u,x=435*a,f+=o<<8,x+=s<<8,c+=r>>>16,o=65535&r,f+=c>>>16,s=65535&c,a=x+(f>>>16)&65535,u=65535&f;return(15&a)*0x1000000000000+0x100000000*u+65536*s+(o^a>>4)};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function t(t){const n=t.length;let e=0,o=0,r=8997,c=0,f=33826,x=0,a=40164,h=0,l=52210;for(;e<n;)r^=t.charCodeAt(e++),o=435*r,c=435*f,x=435*a,h=435*l,x+=r<<8,h+=f<<8,c+=o>>>16,r=65535&o,x+=c>>>16,f=65535&c,l=h+(x>>>16)&65535,a=65535&x;return(15&l)*0x1000000000000+0x100000000*a+65536*f+(r^l>>4)}export{t as fnv1a52};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";function r(r){switch(r){case null:return r=>null!==r;case void 0:return r=>void 0!==r;case!1:return r=>!1!==r;case"nullish":return r=>null!=r;case"falsy":return r=>!!r;default:l(r,"argument")}}function n(r){switch(r){case null:return r=>null===r;case void 0:return r=>void 0===r;case!1:return r=>!1===r;case"nullish":return r=>null==r;case"falsy":return r=>!r;case"truthy":return r=>!!r;default:l(r,"argument")}}const e=n("truthy"),t=n("falsy"),u=r(null),s=r("nullish");function l(r,n="value"){throw TypeError(`Unexpected ${n}: ${r} as ${JSON.stringify(typeof r)}, should be "never"`)}exports.invariant=function(r,n='[foxts/invariant] "value" is null or undefined'){if(null==r)throw TypeError(n)},exports.is=n,exports.isFalsy=t,exports.isNonNull=u,exports.isNonNullish=s,exports.isTruthy=e,exports.never=l,exports.not=r,exports.nullthrow=function(r,n='[foxts/invariant] "value" is null or undefined'){if(null==r)throw TypeError(n);return r};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function n(n){switch(n){case null:return n=>null!==n;case void 0:return n=>void 0!==n;case!1:return n=>!1!==n;case"nullish":return n=>null!=n;case"falsy":return n=>!!n;default:a(n,"argument")}}function r(n){switch(n){case null:return n=>null===n;case void 0:return n=>void 0===n;case!1:return n=>!1===n;case"nullish":return n=>null==n;case"falsy":return n=>!n;case"truthy":return n=>!!n;default:a(n,"argument")}}const e=r("truthy"),u=r("falsy"),l=n(null),t=n("nullish");function i(n,r='[foxts/invariant] "value" is null or undefined'){if(null==n)throw TypeError(r);return n}function s(n,r='[foxts/invariant] "value" is null or undefined'){if(null==n)throw TypeError(r)}function a(n,r="value"){throw TypeError(`Unexpected ${r}: ${n} as ${JSON.stringify(typeof n)}, should be "never"`)}export{s as invariant,r as is,u as isFalsy,l as isNonNull,t as isNonNullish,e as isTruthy,a as never,n as not,i as nullthrow};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";exports.headersToObject=function(e){const r={};return null==e||new Headers(e).forEach((e,t)=>{r[t]=e}),r};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e){const n={};return null==e||new Headers(e).forEach((e,r)=>{n[r]=e}),n}export{e as headersToObject};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";exports.identity=function(t){return t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function t(t){return t}export{t as identity};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";exports.isFunction=t=>"function"==typeof t;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const n=n=>"function"==typeof n;export{n as isFunction};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";exports.isProbablyIpv4=function(t){if(t.length<7||t.length>15)return!1;let e=0;for(let r=0;r<t.length;r+=1){const n=t.charCodeAt(r);if(46===n)e+=1;else if(n<48||n>57)return!1}return 3===e&&46!==t.charCodeAt(0)&&46!==t.charCodeAt(t.length-1)},exports.isProbablyIpv6=function(t){if(t.length<3)return!1;let e=+("["===t[0]),r=t.length;if("]"===t[r-1]&&(r-=1),r-e>39)return!1;let n=!1;for(;e<r;e+=1){const r=t.charCodeAt(e);if(58===r)n=!0;else if((r<48||r>57)&&(r<97||r>102)&&(r<65||r>90))return!1}return n};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e){if(e.length<7||e.length>15)return!1;let t=0;for(let r=0;r<e.length;r+=1){const n=e.charCodeAt(r);if(46===n)t+=1;else if(n<48||n>57)return!1}return 3===t&&46!==e.charCodeAt(0)&&46!==e.charCodeAt(e.length-1)}function t(e){if(e.length<3)return!1;let t=+("["===e[0]),r=e.length;if("]"===e[r-1]&&(r-=1),r-t>39)return!1;let n=!1;for(;t<r;t+=1){const r=e.charCodeAt(t);if(58===r)n=!0;else if((r<48||r>57)&&(r<97||r>102)&&(r<65||r>90))return!1}return n}export{e as isProbablyIpv4,t as isProbablyIpv6};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";class e extends Promise{executor;promise;constructor(e){super(e=>e()),this.executor=e}static from(t){return new e(e=>{e(t())})}static resolve(t){return new e(e=>e(t))}static reject(t){return new e((e,r)=>r(t))}then(e,t){return this.promise??=new Promise(this.executor),this.promise.then(e,t)}catch(e){return this.promise??=new Promise(this.executor),this.promise.catch(e)}finally(e){return this.promise??=new Promise(this.executor),this.promise.finally(e)}}exports.LazyPromise=e;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
class e extends Promise{executor;promise;constructor(e){super(e=>e()),this.executor=e}static from(r){return new e(e=>{e(r())})}static resolve(r){return new e(e=>e(r))}static reject(r){return new e((e,t)=>t(r))}then(e,r){return this.promise??=new Promise(this.executor),this.promise.then(e,r)}catch(e){return this.promise??=new Promise(this.executor),this.promise.catch(e)}finally(e){return this.promise??=new Promise(this.executor),this.promise.finally(e)}}export{e as LazyPromise};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("../once/index.js").once;exports.lazyValue=e;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{once as o}from"../once/index.mjs";const e=o;export{e as lazyValue};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";exports.mergeHeaders=function(e,n,r=null){if(null==e)return null==n?new Headers:new Headers(n);if(null==n)return new Headers(e);const t=new Headers(e),s=new Headers(n);if(null==r)return s.forEach((e,n)=>{t.set(n,e)}),t;if("function"!=typeof r){const e=new Set(r);r=n=>e.has(n)}return s.forEach((e,n)=>{r(n)&&t.set(n,e)}),t},exports.mergeNodeHttpHeaders=function(e,n){return null==e?null==n?{}:n:null==n?e:Object.assign({},e,n)};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(n,r,t=null){if(null==n)return null==r?new Headers:new Headers(r);if(null==r)return new Headers(n);const l=new Headers(n),u=new Headers(r);if(null==t)return u.forEach((e,n)=>{l.set(n,e)}),l;if("function"!=typeof t){const e=new Set(t);t=n=>e.has(n)}return u.forEach((e,n)=>{t(n)&&l.set(n,e)}),l}function n(e,n){return null==e?null==n?{}:n:null==n?e:Object.assign({},e,n)}export{e as mergeHeaders,n as mergeNodeHttpHeaders};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const o=()=>{},r=Promise.resolve(),e=new Promise(o);exports.asyncNeverFn=()=>e,exports.asyncNoop=()=>r,exports.falseFn=()=>!1,exports.noop=o,exports.throwFn=()=>{throw Error()},exports.trueFn=()=>!0;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const o=()=>{},r=()=>!0,e=()=>!1,n=()=>{throw Error()},s=Promise.resolve(),t=()=>s,F=new Promise(o),a=()=>F;export{a as asyncNeverFn,t as asyncNoop,e as falseFn,o as noop,n as throwFn,r as trueFn};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";exports.once=function(t,e=!0){let n,r=!1;return e?(n=t(),()=>n):()=>(r||(r=!0,n=t()),n)};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function e(n,t=!0){let o,r=!1;return t?(o=n(),()=>o):()=>(r||(r=!0,o=n()),o)}export{e as once};
|
|
1
|
+
function e(n,t=!0){let o,r=!1;return t?(o=n(),()=>o):()=>(r||(r=!0,o=n()),o)}export{e as once};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var n=require("../random-int/index.js");function e(n){return function(e,t=1){if(t>e.length)throw TypeError("Count must be lower or the same as the number of picks");const r=e.slice(),o=[];for(;t--;)1===r.length?o.push(r[0]):o.push(r.splice(n(0,r.length-1),1)[0]);return o}}const t=e(n.randomInt);function r(n){return function(e){return 1===e.length?e[0]:e[n(0,e.length-1)]}}const o=r(n.randomInt);exports.createPickOne=r,exports.createPickRandom=e,exports.pickOne=o,exports.pickRandom=t;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{randomInt as n}from"../random-int/index.mjs";function e(n){return function(e,t=1){if(t>e.length)throw TypeError("Count must be lower or the same as the number of picks");const r=e.slice(),o=[];for(;t--;)1===r.length?o.push(r[0]):o.push(r.splice(n(0,r.length-1),1)[0]);return o}}const t=e(n);function r(n){return function(e){return 1===e.length?e[0]:e[n(0,e.length-1)]}}const o=r(n);export{r as createPickOne,e as createPickRandom,o as pickOne,t as pickRandom};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";function t(t){return(n,o)=>Math.floor(t()*(o-n+1))+n}const n=t(Math.random);exports.createRandomInt=t,exports.randomInt=n;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function n(n){return(t,o)=>Math.floor(n()*(o-t+1))+t}const t=n(Math.random);export{n as createRandomInt,t as randomInt};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";exports.Repool=class{createObject;head;tail;constructor(t){this.createObject=t;const e=t();this.tail=e,this.head=e}get(){const t=this.head;if(t.next)this.head=t.next;else{const t=this.createObject();this.tail=t,this.head=t}return t.next=null,t}release(t){this.tail.next=t,this.tail=t}};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
class t{createObject;head;tail;constructor(t){this.createObject=t;const e=t();this.tail=e,this.head=e}get(){const t=this.head;if(t.next)this.head=t.next;else{const t=this.createObject();this.tail=t,this.head=t}return t.next=null,t}release(t){this.tail.next=t,this.tail=t}}export{t as Repool};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Noop } from '../noop/index.js';
|
|
2
2
|
|
|
3
3
|
interface BaseTrie {
|
|
4
4
|
[key: string]: Trie;
|
|
@@ -12,6 +12,6 @@ declare function retrie(keywords: ArrayLike<string>, asPrefixes?: boolean): {
|
|
|
12
12
|
toString: () => string;
|
|
13
13
|
toRe: () => RegExp;
|
|
14
14
|
};
|
|
15
|
-
declare function createRetrieKeywordFilter(keywords: ArrayLike<string>, asPrefixes?: boolean):
|
|
15
|
+
declare function createRetrieKeywordFilter(keywords: ArrayLike<string>, asPrefixes?: boolean): Noop<false> | ((string: string) => boolean);
|
|
16
16
|
|
|
17
17
|
export { createRetrieKeywordFilter, retrie };
|
|
@@ -0,0 +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,i=!1,s=!1;const c=[],l=[];for(const r in n){if(!r){i=!0;continue}((o=t(n[r]))?c:l).push(("-"===r?"\\x2d":e.has(r)?"\\"+r:r)+o)}return i&&null==o?"":(s=!c.length,l.length&&c.push(l[1]?"["+l.join("")+"]":l[0]),r=c[1]?"(?:"+c.join("|")+")":c[0],i&&(r=s?r+"?":"(?:"+r+")?"),r||"")})(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;
|
|
@@ -0,0 +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,i=!1,c=!1;const l=[],s=[];for(const o in e){if(!o){i=!0;continue}((r=t(e[o]))?l:s).push(("-"===o?"\\x2d":n.has(o)?"\\"+o:o)+r)}return i&&null==r?"":(c=!l.length,s.length&&l.push(s[1]?"["+s.join("")+"]":s[0]),o=l[1]?"(?:"+l.join("|")+")":l[0],i&&(o=c?o+"?":"(?:"+o+")?"),o||"")})(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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";exports.shuffleArray=function(t,e={}){let r;const{copy:n=!1,random:s=Math.random}=e,l=n?t.slice():t;let o=0,c=l.length;for(;c;)o=s()*c--|0,r=l[c],l[c]=l[o],l[o]=r;return l};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function t(e,r={}){let n;const{copy:l=!1,random:o=Math.random}=r,f=l?e.slice():e;let a=0,c=f.length;for(;c;)a=o()*c--|0,n=f[c],f[c]=f[a],f[a]=n;return f}export{t as shuffleArray};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var t=require("../fnv1a52/index.js");exports.simpleStringHash=function(n){return t.fnv1a52(n).toString(36)+n.length.toString(36)};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{fnv1a52 as t}from"../fnv1a52/index.mjs";function n(n){return t(n).toString(36)+n.length.toString(36)}export{n as simpleStringHash};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";exports.stringJoin=function(t,r=",",e=!1){let n;const o=t.length;if(0===o)return"";e&&(t=Array.from(new Set(t)));let i="",s=!1;for(let e=0;e<o;e++)(n=t[e])&&(s?i+=r:s=!0,i+=n);return i};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function t(r,e=",",n=!1){let o;const f=r.length;if(0===f)return"";n&&(r=Array.from(new Set(r)));let i="",l=!1;for(let t=0;t<f;t++)(o=r[t])&&(l?i+=e:l=!0,i+=o);return i}export{t as stringJoin};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";exports.tagged=function(e,...t){return e.reduce((e,r,u)=>e+r+(t[u]??""),"")};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function e(r,...t){return r.reduce((e,r,n)=>e+r+(t[n]??""),"")}export{e as tagged};
|
|
1
|
+
function e(r,...t){return r.reduce((e,r,n)=>e+r+(t[n]??""),"")}export{e as tagged};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var e=require("../noop/index.js");class n extends TransformStream{constructor({allowCR:n=!1,skipEmptyLines:t=!1}={}){let r="",s=0;const i=n?(e,n,r)=>{const i=e.indexOf("\r",s);if(-1!==i&&i!==e.length-1&&(-1===n||n-1>i)){const n=e.slice(s,i);return t&&0===n.length||r.enqueue(e.slice(s,i)),s=i+1,!0}return!1}:e.falseFn;super({transform(e,n){for(e=r+e,s=0;;){const r=e.indexOf("\n",s);if(i(e,r,n))continue;if(-1===r)break;let u=r;"\r"===e[r-1]&&u--;const c=e.slice(s,u);if(t&&0===c.length){s=r+1;continue}n.enqueue(c),s=r+1}r=e.slice(s)},flush(e){r.length>0&&(n&&"\r"===r[r.length-1]?e.enqueue(r.slice(0,-1)):e.enqueue(r))}})}}exports.TextLineStream=n;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{falseFn as e}from"../noop/index.mjs";class n extends TransformStream{constructor({allowCR:n=!1,skipEmptyLines:t=!1}={}){let r="",s=0;const o=n?(e,n,r)=>{const o=e.indexOf("\r",s);if(-1!==o&&o!==e.length-1&&(-1===n||n-1>o)){const n=e.slice(s,o);return t&&0===n.length||r.enqueue(e.slice(s,o)),s=o+1,!0}return!1}:e;super({transform(e,n){for(e=r+e,s=0;;){const r=e.indexOf("\n",s);if(o(e,r,n))continue;if(-1===r)break;let i=r;"\r"===e[r-1]&&i--;const c=e.slice(s,i);if(t&&0===c.length){s=r+1;continue}n.enqueue(c),s=r+1}r=e.slice(s)},flush(e){r.length>0&&(n&&"\r"===r[r.length-1]?e.enqueue(r.slice(0,-1)):e.enqueue(r))}})}}export{n as TextLineStream};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
declare function stringToUint8Array(str: string): Uint8Array;
|
|
2
|
+
declare function uint8ArrayToString(array: Uint8Array, encoding?: string): string;
|
|
3
|
+
declare function base64ToUint8Array(base64String: string): Uint8Array;
|
|
4
|
+
declare function uint8ArrayToBase64(array: Uint8Array, urlSafe?: boolean): string;
|
|
5
|
+
|
|
6
|
+
export { base64ToUint8Array, stringToUint8Array, uint8ArrayToBase64, uint8ArrayToString };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=new TextEncoder,r={utf8:new TextDecoder("utf8")};exports.base64ToUint8Array=function(e){return Uint8Array.from(atob(function(e){const r=e.replaceAll("-","+").replaceAll("_","/"),t=(4-r.length%4)%4;return r+"=".repeat(t)}(e)),e=>e.charCodeAt(0))},exports.stringToUint8Array=function(r){return e.encode(r)},exports.uint8ArrayToBase64=function(e,r=!1){let t="";for(let r=0;r<e.length;r+=65535){const n=e.subarray(r,r+65535);t+=globalThis.btoa(String.fromCharCode.apply(void 0,n))}return r?t.replaceAll("+","-").replaceAll("/","_").replace(/=+$/,""):t},exports.uint8ArrayToString=function(e,t="utf8"){return r[t]??=new TextDecoder(t),r[t].decode(e)};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=new TextEncoder;function r(r){return e.encode(r)}const t={utf8:new TextDecoder("utf8")};function n(e,r="utf8"){return t[r]??=new TextDecoder(r),t[r].decode(e)}function o(e){return Uint8Array.from(atob(function(e){const r=e.replaceAll("-","+").replaceAll("_","/"),t=(4-r.length%4)%4;return r+"=".repeat(t)}(e)),e=>e.charCodeAt(0))}function a(e,r=!1){let t="";for(let r=0;r<e.length;r+=65535){const n=e.subarray(r,r+65535);t+=globalThis.btoa(String.fromCharCode.apply(void 0,n))}return r?t.replaceAll("+","-").replaceAll("/","_").replace(/=+$/,""):t}export{o as base64ToUint8Array,r as stringToUint8Array,a as uint8ArrayToBase64,n as uint8ArrayToString};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";exports.wait=function(e){return new Promise(t=>{setTimeout(t,e)})},exports.waitWithAbort=function(e,t){return new Promise((r,o)=>{if(t.aborted)return void o(t.reason);const n=setTimeout(()=>{t.removeEventListener("abort",i),r()},e);function i(){clearTimeout(n),t.removeEventListener("abort",i),o(t.reason)}t.addEventListener("abort",i)})};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e){return new Promise(t=>{setTimeout(t,e)})}function t(e,t){return new Promise((r,n)=>{if(t.aborted)return void n(t.reason);const o=setTimeout(()=>{t.removeEventListener("abort",i),r()},e);function i(){clearTimeout(o),t.removeEventListener("abort",i),n(t.reason)}t.addEventListener("abort",i)})}export{e as wait,t as waitWithAbort};
|