foxts 1.1.3 → 1.1.4
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 +43 -43
- package/retrie/index.cjs +1 -1
- package/retrie/index.d.ts +3 -1
- package/retrie/index.mjs +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "foxts",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.4",
|
|
4
4
|
"description": "Opinionated collection of common TypeScript utils by @SukkaW",
|
|
5
5
|
"repository": {
|
|
6
6
|
"url": "https://github.com/SukkaW/foxts"
|
|
@@ -38,15 +38,6 @@
|
|
|
38
38
|
"require": "./add-array-elements-to-set/index.cjs",
|
|
39
39
|
"default": "./add-array-elements-to-set/index.cjs"
|
|
40
40
|
},
|
|
41
|
-
"./ahocorasick": {
|
|
42
|
-
"types": "./ahocorasick/index.d.ts",
|
|
43
|
-
"import": {
|
|
44
|
-
"types": "./ahocorasick/index.d.ts",
|
|
45
|
-
"default": "./ahocorasick/index.mjs"
|
|
46
|
-
},
|
|
47
|
-
"require": "./ahocorasick/index.cjs",
|
|
48
|
-
"default": "./ahocorasick/index.cjs"
|
|
49
|
-
},
|
|
50
41
|
"./append-set-elements-to-array": {
|
|
51
42
|
"types": "./append-set-elements-to-array/index.d.ts",
|
|
52
43
|
"import": {
|
|
@@ -56,15 +47,6 @@
|
|
|
56
47
|
"require": "./append-set-elements-to-array/index.cjs",
|
|
57
48
|
"default": "./append-set-elements-to-array/index.cjs"
|
|
58
49
|
},
|
|
59
|
-
"./async-write-to-stream": {
|
|
60
|
-
"types": "./async-write-to-stream/index.d.ts",
|
|
61
|
-
"import": {
|
|
62
|
-
"types": "./async-write-to-stream/index.d.ts",
|
|
63
|
-
"default": "./async-write-to-stream/index.mjs"
|
|
64
|
-
},
|
|
65
|
-
"require": "./async-write-to-stream/index.cjs",
|
|
66
|
-
"default": "./async-write-to-stream/index.cjs"
|
|
67
|
-
},
|
|
68
50
|
"./bitwise": {
|
|
69
51
|
"types": "./bitwise/index.d.ts",
|
|
70
52
|
"import": {
|
|
@@ -74,6 +56,15 @@
|
|
|
74
56
|
"require": "./bitwise/index.cjs",
|
|
75
57
|
"default": "./bitwise/index.cjs"
|
|
76
58
|
},
|
|
59
|
+
"./ahocorasick": {
|
|
60
|
+
"types": "./ahocorasick/index.d.ts",
|
|
61
|
+
"import": {
|
|
62
|
+
"types": "./ahocorasick/index.d.ts",
|
|
63
|
+
"default": "./ahocorasick/index.mjs"
|
|
64
|
+
},
|
|
65
|
+
"require": "./ahocorasick/index.cjs",
|
|
66
|
+
"default": "./ahocorasick/index.cjs"
|
|
67
|
+
},
|
|
77
68
|
"./escape-string-regexp": {
|
|
78
69
|
"types": "./escape-string-regexp/index.d.ts",
|
|
79
70
|
"import": {
|
|
@@ -83,6 +74,15 @@
|
|
|
83
74
|
"require": "./escape-string-regexp/index.cjs",
|
|
84
75
|
"default": "./escape-string-regexp/index.cjs"
|
|
85
76
|
},
|
|
77
|
+
"./async-write-to-stream": {
|
|
78
|
+
"types": "./async-write-to-stream/index.d.ts",
|
|
79
|
+
"import": {
|
|
80
|
+
"types": "./async-write-to-stream/index.d.ts",
|
|
81
|
+
"default": "./async-write-to-stream/index.mjs"
|
|
82
|
+
},
|
|
83
|
+
"require": "./async-write-to-stream/index.cjs",
|
|
84
|
+
"default": "./async-write-to-stream/index.cjs"
|
|
85
|
+
},
|
|
86
86
|
"./fast-string-array-join": {
|
|
87
87
|
"types": "./fast-string-array-join/index.d.ts",
|
|
88
88
|
"import": {
|
|
@@ -119,15 +119,6 @@
|
|
|
119
119
|
"require": "./fnv1a52/index.cjs",
|
|
120
120
|
"default": "./fnv1a52/index.cjs"
|
|
121
121
|
},
|
|
122
|
-
"./guard": {
|
|
123
|
-
"types": "./guard/index.d.ts",
|
|
124
|
-
"import": {
|
|
125
|
-
"types": "./guard/index.d.ts",
|
|
126
|
-
"default": "./guard/index.mjs"
|
|
127
|
-
},
|
|
128
|
-
"require": "./guard/index.cjs",
|
|
129
|
-
"default": "./guard/index.cjs"
|
|
130
|
-
},
|
|
131
122
|
"./headers-to-object": {
|
|
132
123
|
"types": "./headers-to-object/index.d.ts",
|
|
133
124
|
"import": {
|
|
@@ -146,6 +137,15 @@
|
|
|
146
137
|
"require": "./identity/index.cjs",
|
|
147
138
|
"default": "./identity/index.cjs"
|
|
148
139
|
},
|
|
140
|
+
"./is-probably-ip": {
|
|
141
|
+
"types": "./is-probably-ip/index.d.ts",
|
|
142
|
+
"import": {
|
|
143
|
+
"types": "./is-probably-ip/index.d.ts",
|
|
144
|
+
"default": "./is-probably-ip/index.mjs"
|
|
145
|
+
},
|
|
146
|
+
"require": "./is-probably-ip/index.cjs",
|
|
147
|
+
"default": "./is-probably-ip/index.cjs"
|
|
148
|
+
},
|
|
149
149
|
"./merge-headers": {
|
|
150
150
|
"types": "./merge-headers/index.d.ts",
|
|
151
151
|
"import": {
|
|
@@ -164,15 +164,6 @@
|
|
|
164
164
|
"require": "./noop/index.cjs",
|
|
165
165
|
"default": "./noop/index.cjs"
|
|
166
166
|
},
|
|
167
|
-
"./repool": {
|
|
168
|
-
"types": "./repool/index.d.ts",
|
|
169
|
-
"import": {
|
|
170
|
-
"types": "./repool/index.d.ts",
|
|
171
|
-
"default": "./repool/index.mjs"
|
|
172
|
-
},
|
|
173
|
-
"require": "./repool/index.cjs",
|
|
174
|
-
"default": "./repool/index.cjs"
|
|
175
|
-
},
|
|
176
167
|
"./retrie": {
|
|
177
168
|
"types": "./retrie/index.d.ts",
|
|
178
169
|
"import": {
|
|
@@ -182,6 +173,15 @@
|
|
|
182
173
|
"require": "./retrie/index.cjs",
|
|
183
174
|
"default": "./retrie/index.cjs"
|
|
184
175
|
},
|
|
176
|
+
"./repool": {
|
|
177
|
+
"types": "./repool/index.d.ts",
|
|
178
|
+
"import": {
|
|
179
|
+
"types": "./repool/index.d.ts",
|
|
180
|
+
"default": "./repool/index.mjs"
|
|
181
|
+
},
|
|
182
|
+
"require": "./repool/index.cjs",
|
|
183
|
+
"default": "./repool/index.cjs"
|
|
184
|
+
},
|
|
185
185
|
"./serialized-memo": {
|
|
186
186
|
"types": "./serialized-memo/index.d.ts",
|
|
187
187
|
"import": {
|
|
@@ -218,14 +218,14 @@
|
|
|
218
218
|
"require": "./wait/index.cjs",
|
|
219
219
|
"default": "./wait/index.cjs"
|
|
220
220
|
},
|
|
221
|
-
"./
|
|
222
|
-
"types": "./
|
|
221
|
+
"./guard": {
|
|
222
|
+
"types": "./guard/index.d.ts",
|
|
223
223
|
"import": {
|
|
224
|
-
"types": "./
|
|
225
|
-
"default": "./
|
|
224
|
+
"types": "./guard/index.d.ts",
|
|
225
|
+
"default": "./guard/index.mjs"
|
|
226
226
|
},
|
|
227
|
-
"require": "./
|
|
228
|
-
"default": "./
|
|
227
|
+
"require": "./guard/index.cjs",
|
|
228
|
+
"default": "./guard/index.cjs"
|
|
229
229
|
}
|
|
230
230
|
}
|
|
231
231
|
}
|
package/retrie/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";var t=require("../noop/index.cjs");const e=new Set([".","?","*","+","^","$","|","(",")","{","}","[","]","\\"]);function n(t,r=!1){const o={},i=(t,e)=>{let n;let 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;
|
package/retrie/index.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { Noop } from '../noop/index.js';
|
|
2
|
+
|
|
1
3
|
interface BaseTrie {
|
|
2
4
|
[key: string]: Trie;
|
|
3
5
|
}
|
|
@@ -10,6 +12,6 @@ declare function retrie(keywords: ArrayLike<string>, asPrefixes?: boolean): {
|
|
|
10
12
|
toString: () => string;
|
|
11
13
|
toRe: () => RegExp;
|
|
12
14
|
};
|
|
13
|
-
declare function createRetrieKeywordFilter(keywords: ArrayLike<string>, asPrefixes?: boolean): (string: string) => boolean;
|
|
15
|
+
declare function createRetrieKeywordFilter(keywords: ArrayLike<string>, asPrefixes?: boolean): Noop<false> | ((string: string) => boolean);
|
|
14
16
|
|
|
15
17
|
export { createRetrieKeywordFilter, retrie };
|
package/retrie/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
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;let 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 l=()=>(function t(e){let o,r,i=!1,l=!1;const c=[],s=[];for(const o in e){if(!o){i=!0;continue}((r=t(e[o]))?c:s).push(("-"===o?"\\x2d":n.has(o)?"\\"+o:o)+r)}return i&&null==r?"":(l=!c.length,s.length&&c.push(s[1]?"["+s.join("")+"]":s[0]),o=c[1]?"(?:"+c.join("|")+")":c[0],i&&(o=l?o+"?":"(?:"+o+")?"),o||"")})(r);return{tree:r,add:i,toString:l,toRe:()=>new RegExp((o?"^":"")+l())}}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};
|