foxts 1.1.2 → 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.2",
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,15 +146,6 @@
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",
151
- "import": {
152
- "types": "./is-probably-ip/index.d.ts",
153
- "default": "./is-probably-ip/index.mjs"
154
- },
155
- "require": "./is-probably-ip/index.cjs",
156
- "default": "./is-probably-ip/index.cjs"
157
- },
158
149
  "./merge-headers": {
159
150
  "types": "./merge-headers/index.d.ts",
160
151
  "import": {
@@ -200,15 +191,6 @@
200
191
  "require": "./serialized-memo/index.cjs",
201
192
  "default": "./serialized-memo/index.cjs"
202
193
  },
203
- "./tagged": {
204
- "types": "./tagged/index.d.ts",
205
- "import": {
206
- "types": "./tagged/index.d.ts",
207
- "default": "./tagged/index.mjs"
208
- },
209
- "require": "./tagged/index.cjs",
210
- "default": "./tagged/index.cjs"
211
- },
212
194
  "./simple-string-hash": {
213
195
  "types": "./simple-string-hash/index.d.ts",
214
196
  "import": {
@@ -218,6 +200,15 @@
218
200
  "require": "./simple-string-hash/index.cjs",
219
201
  "default": "./simple-string-hash/index.cjs"
220
202
  },
203
+ "./tagged": {
204
+ "types": "./tagged/index.d.ts",
205
+ "import": {
206
+ "types": "./tagged/index.d.ts",
207
+ "default": "./tagged/index.mjs"
208
+ },
209
+ "require": "./tagged/index.cjs",
210
+ "default": "./tagged/index.cjs"
211
+ },
221
212
  "./wait": {
222
213
  "types": "./wait/index.d.ts",
223
214
  "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(("-"===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{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(("-"===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{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};