foxts 5.7.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.
@@ -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,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}};
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.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};
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};
@@ -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;(0!==r||e<a)&&-1!==t;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;(0!==e||n<c)&&-1!==r;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}}};
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}}};
@@ -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;(0!==r||e<a)&&-1!==t;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;(0!==e||n<c)&&-1!==r;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};
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};
@@ -1,5 +1,16 @@
1
- declare function fnv1a(str: string): number;
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
- export { __internal_hl_do_not_use__, fnv1a, fnv1ahex };
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 };
@@ -1 +1 @@
1
- "use strict";const t=Array(256);for(let r=0;r<256;r++)t[r]=(r>>4&15).toString(16)+(15&r).toString(16);exports.__internal_hl_do_not_use__=t,exports.fnv1a=function(t){const r=t.length-3;let o=0,e=0,n=40389,c=33052;for(;o<r;)n^=t.charCodeAt(o++),e=403*n,c=403*c+(n<<8)+(e>>>16)&65535,e=403*(n=65535&e^t.charCodeAt(o++)),c=403*c+(n<<8)+(e>>>16)&65535,e=403*(n=65535&e^t.charCodeAt(o++)),c=403*c+(n<<8)+(e>>>16)&65535,e=403*(n=65535&e^t.charCodeAt(o++)),c=403*c+(n<<8)+(e>>>16)&65535,n=65535&e;for(;o<r+3;)n^=t.charCodeAt(o++),e=403*n,c=403*c+(n<<8)+(e>>>16)&65535,n=65535&e;return(c<<16>>>0)+n},exports.fnv1ahex=function(r){const o=r.length-3;let e=0,n=0,c=40389,a=33052;for(;e<o;)c^=r.charCodeAt(e++),n=403*c,a=403*a+(c<<8)+(n>>>16)&65535,n=403*(c=65535&n^r.charCodeAt(e++)),a=403*a+(c<<8)+(n>>>16)&65535,n=403*(c=65535&n^r.charCodeAt(e++)),a=403*a+(c<<8)+(n>>>16)&65535,n=403*(c=65535&n^r.charCodeAt(e++)),a=403*a+(c<<8)+(n>>>16)&65535,c=65535&n;for(;e<o+3;)c^=r.charCodeAt(e++),n=403*c,a=403*a+(c<<8)+(n>>>16)&65535,c=65535&n;return t[a>>>8&255]+t[255&a]+t[c>>>8&255]+t[255&c]};
1
+ "use strict";var a=require("fast-fnv1a");const e=a.fnv1a,f=a.fnv1ahex;exports.fnv1a=e,exports.fnv1ahex=f;
@@ -1 +1 @@
1
- function t(t){const o=t.length-3;let r=0,e=0,n=40389,c=33052;for(;r<o;)n^=t.charCodeAt(r++),e=403*n,c=403*c+(n<<8)+(e>>>16)&65535,e=403*(n=65535&e^t.charCodeAt(r++)),c=403*c+(n<<8)+(e>>>16)&65535,e=403*(n=65535&e^t.charCodeAt(r++)),c=403*c+(n<<8)+(e>>>16)&65535,e=403*(n=65535&e^t.charCodeAt(r++)),c=403*c+(n<<8)+(e>>>16)&65535,n=65535&e;for(;r<o+3;)n^=t.charCodeAt(r++),e=403*n,c=403*c+(n<<8)+(e>>>16)&65535,n=65535&e;return(c<<16>>>0)+n}const o=Array(256);for(let t=0;t<256;t++)o[t]=(t>>4&15).toString(16)+(15&t).toString(16);const r=o;function e(t){const r=t.length-3;let e=0,n=0,c=40389,a=33052;for(;e<r;)c^=t.charCodeAt(e++),n=403*c,a=403*a+(c<<8)+(n>>>16)&65535,n=403*(c=65535&n^t.charCodeAt(e++)),a=403*a+(c<<8)+(n>>>16)&65535,n=403*(c=65535&n^t.charCodeAt(e++)),a=403*a+(c<<8)+(n>>>16)&65535,n=403*(c=65535&n^t.charCodeAt(e++)),a=403*a+(c<<8)+(n>>>16)&65535,c=65535&n;for(;e<r+3;)c^=t.charCodeAt(e++),n=403*c,a=403*a+(c<<8)+(n>>>16)&65535,c=65535&n;return o[a>>>8&255]+o[255&a]+o[c>>>8&255]+o[255&c]}export{r as __internal_hl_do_not_use__,t as fnv1a,e as fnv1ahex};
1
+ import{fnv1a as a,fnv1ahex as f}from"fast-fnv1a";const n=a,v=f;export{n as fnv1a,v as fnv1ahex};
@@ -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
- * FNV-1a Hash implementation
3
- *
4
- * @author Sukka (sukkaw) <https://skk.moe>
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 function fnv1a52(str: string): number;
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 };
@@ -1 +1 @@
1
- "use strict";var _=require("../fnv1a/index.js");const n=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];exports.fnv1a52=function(_){const n=_.length;let t=0,e=0,o=8997,r=0,l=33826,s=0,a=40164,u=0,h=52210;for(;t<n;)o^=_.charCodeAt(t++),e=435*o,r=435*l,s=435*a,u=435*h,s+=o<<8,u+=l<<8,r+=e>>>16,o=65535&e,s+=r>>>16,l=65535&r,h=u+(s>>>16)&65535,a=65535&s;return(15&h)*0x1000000000000+0x100000000*a+65536*l+(o^h>>4)},exports.fnv1a52hex=function(t){const e=t.length;let o=0,r=0,l=8997,s=0,a=33826,u=0,h=40164,i=0,d=52210;for(;o<e;)l^=t.charCodeAt(o++),r=435*l,s=435*a,u=435*h,i=435*d,u+=l<<8,i+=a<<8,s+=r>>>16,l=65535&r,u+=s>>>16,a=65535&s,d=i+(u>>>16)&65535,h=65535&u;return n[15&d]+_.__internal_hl_do_not_use__[h>>8]+_.__internal_hl_do_not_use__[255&h]+_.__internal_hl_do_not_use__[a>>8]+_.__internal_hl_do_not_use__[255&a]+_.__internal_hl_do_not_use__[l>>8^d>>12]+_.__internal_hl_do_not_use__[(l^d>>4)&255]};
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;
@@ -1 +1 @@
1
- import{__internal_hl_do_not_use__ as n}from"../fnv1a/index.mjs";function t(n){const t=n.length;let e=0,o=0,r=8997,f=0,c=33826,a=0,h=40164,x=0,d=52210;for(;e<t;)r^=n.charCodeAt(e++),o=435*r,f=435*c,a=435*h,x=435*d,a+=r<<8,x+=c<<8,f+=o>>>16,r=65535&o,a+=f>>>16,c=65535&f,d=x+(a>>>16)&65535,h=65535&a;return(15&d)*0x1000000000000+0x100000000*h+65536*c+(r^d>>4)}const e=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function o(t){const o=t.length;let r=0,f=0,c=8997,a=0,h=33826,x=0,d=40164,i=0,l=52210;for(;r<o;)c^=t.charCodeAt(r++),f=435*c,a=435*h,x=435*d,i=435*l,x+=c<<8,i+=h<<8,a+=f>>>16,c=65535&f,x+=a>>>16,h=65535&a,l=i+(x>>>16)&65535,d=65535&x;return e[15&l]+n[d>>8]+n[255&d]+n[h>>8]+n[255&h]+n[c>>8^l>>12]+n[(c^l>>4)&255]}export{t as fnv1a52,o as fnv1a52hex};
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){const r={};return null==e||new Headers(e).forEach((e,t)=>{r[t]=e}),r};
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){const n={};return null==e||new Headers(e).forEach((e,r)=>{n[r]=e}),n}export{e as headersToObject};
1
+ function e(e){return e instanceof Headers?Object.fromEntries(e):null==e?{}:Object.fromEntries(new Headers(e))}export{e as headersToObject};
@@ -1 +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
+ "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)};
@@ -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(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};
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Ponyfill for the TC39 "Property Counting" proposal.
3
+ *
4
+ * @see https://github.com/tc39/proposal-object-property-count
5
+ */
6
+ /**
7
+ * Counts own, enumerable, string-keyed properties (including array indices).
8
+ *
9
+ * Equivalent to `Object.keys(target).length`, but without allocating the
10
+ * intermediate array.
11
+ */
12
+ declare function keysLength(target: object): number;
13
+ /**
14
+ * Counts own, string-keyed properties (including array indices), both
15
+ * enumerable and non-enumerable.
16
+ *
17
+ * There is no allocation-free reflection primitive for this, so it delegates to
18
+ * `Object.getOwnPropertyNames(target).length`.
19
+ */
20
+ declare function getOwnPropertyNamesLength(target: object): number;
21
+ /**
22
+ * Counts own, symbol-keyed properties, regardless of enumerability.
23
+ *
24
+ * There is no allocation-free reflection primitive for this, so it delegates to
25
+ * `Object.getOwnPropertySymbols(target).length`.
26
+ */
27
+ declare function getOwnPropertySymbolsLength(target: object): number;
28
+
29
+ export { getOwnPropertyNamesLength, getOwnPropertySymbolsLength, keysLength };
@@ -0,0 +1,5 @@
1
+ "use strict";/**
2
+ * Ponyfill for the TC39 "Property Counting" proposal.
3
+ *
4
+ * @see https://github.com/tc39/proposal-object-property-count
5
+ */exports.getOwnPropertyNamesLength=function(t){return Object.getOwnPropertyNames(t).length},exports.getOwnPropertySymbolsLength=function(t){return Object.getOwnPropertySymbols(t).length},exports.keysLength=function(t){let e=0;for(const r in t)Object.prototype.hasOwnProperty.call(t,r)&&e++;return e};
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Ponyfill for the TC39 "Property Counting" proposal.
3
+ *
4
+ * @see https://github.com/tc39/proposal-object-property-count
5
+ */function t(t){let e=0;for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&e++;return e}function e(t){return Object.getOwnPropertyNames(t).length}function n(t){return Object.getOwnPropertySymbols(t).length}export{e as getOwnPropertyNamesLength,n as getOwnPropertySymbolsLength,t as keysLength};
@@ -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,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;
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;
@@ -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,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};
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 n=require("../fnv1a52/index.js");require("../fnv1a/index.js"),exports.simpleStringHash=function(r){return n.fnv1a52(r).toString(36)+r.length.toString(36)};
1
+ "use strict";var r=require("fnv1a52");exports.simpleStringHash=function(t){return r.fnv1a52base36(t)+t.length.toString(36)};
@@ -1 +1 @@
1
- import{fnv1a52 as n}from"../fnv1a52/index.mjs";import"../fnv1a/index.mjs";function t(t){return n(t).toString(36)+t.length.toString(36)}export{t as simpleStringHash};
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.7.0",
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"
@@ -268,6 +268,12 @@
268
268
  "require": "./dist/pick-random/index.js",
269
269
  "default": "./dist/pick-random/index.js"
270
270
  },
271
+ "./property-count": {
272
+ "types": "./dist/property-count/index.d.ts",
273
+ "import": "./dist/property-count/index.mjs",
274
+ "require": "./dist/property-count/index.js",
275
+ "default": "./dist/property-count/index.js"
276
+ },
271
277
  "./random-int": {
272
278
  "types": "./dist/random-int/index.d.ts",
273
279
  "import": "./dist/random-int/index.mjs",
@@ -349,32 +355,36 @@
349
355
  ],
350
356
  "author": "SukkaW <https://skk.moe>",
351
357
  "license": "MIT",
358
+ "dependencies": {
359
+ "fast-fnv1a": "^1.0.0",
360
+ "fnv1a52": "^1.0.0"
361
+ },
352
362
  "devDependencies": {
353
- "@eslint-sukka/node": "^8.13.4",
354
- "@happy-dom/global-registrator": "^20.10.6",
363
+ "@eslint-sukka/node": "^8.14.1",
364
+ "@happy-dom/global-registrator": "^20.11.1",
355
365
  "@istanbuljs/nyc-config-typescript": "^1.0.2",
356
366
  "@mitata/counters": "^0.0.8",
357
- "@monyone/aho-corasick": "^1.1.12",
367
+ "@monyone/aho-corasick": "^1.1.23",
358
368
  "@package-json/types": "^0.0.13",
359
- "@swc-node/register": "^1.11.1",
360
- "@swc/core": "^1.15.43",
369
+ "@swc-node/register": "^1.12.1",
370
+ "@swc/core": "^1.15.46",
361
371
  "@types/mocha": "^10.0.10",
362
372
  "@types/node": "^22.20.1",
363
373
  "@types/sinon": "^21.0.1",
364
374
  "bumpp": "^10.4.1",
365
375
  "earl": "^2.0.0",
366
- "eslint": "^10.6.0",
367
- "eslint-config-sukka": "^8.13.4",
368
- "eslint-formatter-sukka": "^8.13.4",
376
+ "eslint": "^10.8.0",
377
+ "eslint-config-sukka": "^8.14.1",
378
+ "eslint-formatter-sukka": "^8.14.1",
369
379
  "fastscan": "^1.0.6",
370
- "happy-dom": "^20.10.6",
380
+ "happy-dom": "^20.11.1",
371
381
  "is-ci": "^4.1.0",
372
382
  "is-network-error": "^1.3.2",
373
383
  "mitata": "^1.0.34",
374
384
  "mocha": "^11.7.6",
375
385
  "modern-ahocorasick": "^2.0.4",
376
386
  "nyc": "^18.0.0",
377
- "rollup": "^4.62.2",
387
+ "rollup": "^4.62.3",
378
388
  "rollup-plugin-dts": "^6.4.1",
379
389
  "rollup-plugin-oxc-resolve": "^0.0.5",
380
390
  "rollup-plugin-swc3": "^0.12.1",