foxts 1.1.1 → 1.1.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "foxts",
3
- "version": "1.1.1",
3
+ "version": "1.1.3",
4
4
  "description": "Opinionated collection of common TypeScript utils by @SukkaW",
5
5
  "repository": {
6
6
  "url": "https://github.com/SukkaW/foxts"
@@ -47,6 +47,15 @@
47
47
  "require": "./ahocorasick/index.cjs",
48
48
  "default": "./ahocorasick/index.cjs"
49
49
  },
50
+ "./append-set-elements-to-array": {
51
+ "types": "./append-set-elements-to-array/index.d.ts",
52
+ "import": {
53
+ "types": "./append-set-elements-to-array/index.d.ts",
54
+ "default": "./append-set-elements-to-array/index.mjs"
55
+ },
56
+ "require": "./append-set-elements-to-array/index.cjs",
57
+ "default": "./append-set-elements-to-array/index.cjs"
58
+ },
50
59
  "./async-write-to-stream": {
51
60
  "types": "./async-write-to-stream/index.d.ts",
52
61
  "import": {
@@ -65,15 +74,6 @@
65
74
  "require": "./bitwise/index.cjs",
66
75
  "default": "./bitwise/index.cjs"
67
76
  },
68
- "./append-set-elements-to-array": {
69
- "types": "./append-set-elements-to-array/index.d.ts",
70
- "import": {
71
- "types": "./append-set-elements-to-array/index.d.ts",
72
- "default": "./append-set-elements-to-array/index.mjs"
73
- },
74
- "require": "./append-set-elements-to-array/index.cjs",
75
- "default": "./append-set-elements-to-array/index.cjs"
76
- },
77
77
  "./escape-string-regexp": {
78
78
  "types": "./escape-string-regexp/index.d.ts",
79
79
  "import": {
@@ -101,15 +101,6 @@
101
101
  "require": "./fifo/index.cjs",
102
102
  "default": "./fifo/index.cjs"
103
103
  },
104
- "./fnv1a52": {
105
- "types": "./fnv1a52/index.d.ts",
106
- "import": {
107
- "types": "./fnv1a52/index.d.ts",
108
- "default": "./fnv1a52/index.mjs"
109
- },
110
- "require": "./fnv1a52/index.cjs",
111
- "default": "./fnv1a52/index.cjs"
112
- },
113
104
  "./fnv1a": {
114
105
  "types": "./fnv1a/index.d.ts",
115
106
  "import": {
@@ -119,6 +110,15 @@
119
110
  "require": "./fnv1a/index.cjs",
120
111
  "default": "./fnv1a/index.cjs"
121
112
  },
113
+ "./fnv1a52": {
114
+ "types": "./fnv1a52/index.d.ts",
115
+ "import": {
116
+ "types": "./fnv1a52/index.d.ts",
117
+ "default": "./fnv1a52/index.mjs"
118
+ },
119
+ "require": "./fnv1a52/index.cjs",
120
+ "default": "./fnv1a52/index.cjs"
121
+ },
122
122
  "./guard": {
123
123
  "types": "./guard/index.d.ts",
124
124
  "import": {
@@ -146,14 +146,14 @@
146
146
  "require": "./identity/index.cjs",
147
147
  "default": "./identity/index.cjs"
148
148
  },
149
- "./is-probably-ip": {
150
- "types": "./is-probably-ip/index.d.ts",
149
+ "./merge-headers": {
150
+ "types": "./merge-headers/index.d.ts",
151
151
  "import": {
152
- "types": "./is-probably-ip/index.d.ts",
153
- "default": "./is-probably-ip/index.mjs"
152
+ "types": "./merge-headers/index.d.ts",
153
+ "default": "./merge-headers/index.mjs"
154
154
  },
155
- "require": "./is-probably-ip/index.cjs",
156
- "default": "./is-probably-ip/index.cjs"
155
+ "require": "./merge-headers/index.cjs",
156
+ "default": "./merge-headers/index.cjs"
157
157
  },
158
158
  "./noop": {
159
159
  "types": "./noop/index.d.ts",
@@ -164,15 +164,6 @@
164
164
  "require": "./noop/index.cjs",
165
165
  "default": "./noop/index.cjs"
166
166
  },
167
- "./merge-headers": {
168
- "types": "./merge-headers/index.d.ts",
169
- "import": {
170
- "types": "./merge-headers/index.d.ts",
171
- "default": "./merge-headers/index.mjs"
172
- },
173
- "require": "./merge-headers/index.cjs",
174
- "default": "./merge-headers/index.cjs"
175
- },
176
167
  "./repool": {
177
168
  "types": "./repool/index.d.ts",
178
169
  "import": {
@@ -191,15 +182,6 @@
191
182
  "require": "./retrie/index.cjs",
192
183
  "default": "./retrie/index.cjs"
193
184
  },
194
- "./simple-string-hash": {
195
- "types": "./simple-string-hash/index.d.ts",
196
- "import": {
197
- "types": "./simple-string-hash/index.d.ts",
198
- "default": "./simple-string-hash/index.mjs"
199
- },
200
- "require": "./simple-string-hash/index.cjs",
201
- "default": "./simple-string-hash/index.cjs"
202
- },
203
185
  "./serialized-memo": {
204
186
  "types": "./serialized-memo/index.d.ts",
205
187
  "import": {
@@ -209,6 +191,15 @@
209
191
  "require": "./serialized-memo/index.cjs",
210
192
  "default": "./serialized-memo/index.cjs"
211
193
  },
194
+ "./simple-string-hash": {
195
+ "types": "./simple-string-hash/index.d.ts",
196
+ "import": {
197
+ "types": "./simple-string-hash/index.d.ts",
198
+ "default": "./simple-string-hash/index.mjs"
199
+ },
200
+ "require": "./simple-string-hash/index.cjs",
201
+ "default": "./simple-string-hash/index.cjs"
202
+ },
212
203
  "./tagged": {
213
204
  "types": "./tagged/index.d.ts",
214
205
  "import": {
@@ -226,6 +217,15 @@
226
217
  },
227
218
  "require": "./wait/index.cjs",
228
219
  "default": "./wait/index.cjs"
220
+ },
221
+ "./is-probably-ip": {
222
+ "types": "./is-probably-ip/index.d.ts",
223
+ "import": {
224
+ "types": "./is-probably-ip/index.d.ts",
225
+ "default": "./is-probably-ip/index.mjs"
226
+ },
227
+ "require": "./is-probably-ip/index.cjs",
228
+ "default": "./is-probably-ip/index.cjs"
229
229
  }
230
230
  }
231
231
  }
package/retrie/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";const t=new Set([".","?","*","+","^","$","|","(",")","{","[","\\"]);function e(n,o=!1){const r={},i=(t,e)=>{let n;let o=r;for(let r=0,i=t.length;r<i;++r)(n=t.charAt(r))in o||(o[n]=e?{"":""}:{}),o=o[n];e&&(o[""]="")};for(let t=0,e=n.length;t<e;++t)i(n[t],o);const s=()=>(function e(n){let o,r,i=!1,s=!1;const c=[],l=[];for(const o in n){if(!o){i=!0;continue}((r=e(n[o]))?c:l).push((t.has(o)?"\\"+o:o)+r)}return i&&null==r?"":(s=!c.length,l.length&&c.push(l[1]?"["+l.join("")+"]":l[0]),o=c[1]?"(?:"+c.join("|")+")":c[0],i&&(o=s?o+"?":"(?:"+o+")?"),o||"")})(r);return{add:i,toString:s,toRe:()=>new RegExp((o?"^":"")+s())}}exports.createRetrieKeywordFilter=function(t,n=!1){const o=e(t,n).toRe();return o.test.bind(o)},exports.retrie=e;
1
+ "use strict";const t=new Set([".","?","*","+","^","$","|","(",")","{","}","[","]","\\"]);function e(n,o=!1){const r={},i=(t,e)=>{let n;let o=r;for(let r=0,i=t.length;r<i;++r)(n=t.charAt(r))in o||(o[n]=e?{"":""}:{}),o=o[n];o[""]=""};for(let t=0,e=n.length;t<e;++t)i(n[t],o);const s=()=>(function e(n){let o,r,i=!1,s=!1;const c=[],l=[];for(const o in n){if(!o){i=!0;continue}((r=e(n[o]))?c:l).push(("-"===o?"\\x2d":t.has(o)?"\\"+o:o)+r)}return i&&null==r?"":(s=!c.length,l.length&&c.push(l[1]?"["+l.join("")+"]":l[0]),o=c[1]?"(?:"+c.join("|")+")":c[0],i&&(o=s?o+"?":"(?:"+o+")?"),o||"")})(r);return{tree:r,add:i,toString:s,toRe:()=>new RegExp((o?"^":"")+s())}}exports.createRetrieKeywordFilter=function(t,n=!1){const o=e(t,n).toRe();return o.test.bind(o)},exports.retrie=e;
package/retrie/index.d.ts CHANGED
@@ -1,4 +1,11 @@
1
+ interface BaseTrie {
2
+ [key: string]: Trie;
3
+ }
4
+ type Trie = BaseTrie | {
5
+ '': '';
6
+ };
1
7
  declare function retrie(keywords: ArrayLike<string>, asPrefixes?: boolean): {
8
+ tree: BaseTrie;
2
9
  add: (keywords: string, asPrefixes: boolean) => void;
3
10
  toString: () => string;
4
11
  toRe: () => RegExp;
package/retrie/index.mjs CHANGED
@@ -1 +1 @@
1
- const t=new Set([".","?","*","+","^","$","|","(",")","{","[","\\"]);function e(n,o=!1){const r={},i=(t,e)=>{let n;let o=r;for(let r=0,i=t.length;r<i;++r)(n=t.charAt(r))in o||(o[n]=e?{"":""}:{}),o=o[n];e&&(o[""]="")};for(let t=0,e=n.length;t<e;++t)i(n[t],o);const c=()=>(function e(n){let o,r,i=!1,c=!1;const l=[],s=[];for(const o in n){if(!o){i=!0;continue}((r=e(n[o]))?l:s).push((t.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{add:i,toString:c,toRe:()=>new RegExp((o?"^":"")+c())}}function n(t,o=!1){const r=e(t,o).toRe();return r.test.bind(r)}export{n as createRetrieKeywordFilter,e as retrie};
1
+ const t=new Set([".","?","*","+","^","$","|","(",")","{","}","[","]","\\"]);function e(n,o=!1){const r={},i=(t,e)=>{let n;let o=r;for(let r=0,i=t.length;r<i;++r)(n=t.charAt(r))in o||(o[n]=e?{"":""}:{}),o=o[n];o[""]=""};for(let t=0,e=n.length;t<e;++t)i(n[t],o);const c=()=>(function e(n){let o,r,i=!1,c=!1;const l=[],s=[];for(const o in n){if(!o){i=!0;continue}((r=e(n[o]))?l:s).push(("-"===o?"\\x2d":t.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 n(t,o=!1){const r=e(t,o).toRe();return r.test.bind(r)}export{n as createRetrieKeywordFilter,e as retrie};