foxts 3.8.0 → 3.9.0

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.
Files changed (136) hide show
  1. package/dist/shuffle-array.d.ts +8 -0
  2. package/dist/shuffle-array.js +1 -0
  3. package/dist/shuffle-array.mjs +1 -0
  4. package/package.json +139 -265
  5. package/dist/es/add-array-elements-to-set.d.mts +0 -3
  6. package/dist/es/ahocorasick.d.mts +0 -3
  7. package/dist/es/append-array-in-place.d.mts +0 -4
  8. package/dist/es/append-set-elements-to-array.d.mts +0 -3
  9. package/dist/es/async-write-to-stream.d.mts +0 -18
  10. package/dist/es/bitwise.d.mts +0 -30
  11. package/dist/es/compare-source.d.mts +0 -5
  12. package/dist/es/create-fixed-array.d.mts +0 -6
  13. package/dist/es/detect-eol.d.mts +0 -3
  14. package/dist/es/escape-html.d.mts +0 -1
  15. package/dist/es/escape-string-regexp.d.mts +0 -11
  16. package/dist/es/fast-ip-version.d.mts +0 -6
  17. package/dist/es/fast-string-array-join.d.mts +0 -6
  18. package/dist/es/fifo.d.mts +0 -18
  19. package/dist/es/fnv1a.d.mts +0 -3
  20. package/dist/es/fnv1a52.d.mts +0 -12
  21. package/dist/es/guard.d.mts +0 -20
  22. package/dist/es/headers-to-object.d.mts +0 -5
  23. package/dist/es/identity.d.mts +0 -3
  24. package/dist/es/is-probably-ip.d.mts +0 -8
  25. package/dist/es/merge-headers.d.mts +0 -15
  26. package/dist/es/noop.d.mts +0 -12
  27. package/dist/es/once.d.mts +0 -3
  28. package/dist/es/pick-random.d.mts +0 -9
  29. package/dist/es/random-int.d.mts +0 -7
  30. package/dist/es/repool.d.mts +0 -19
  31. package/dist/es/retrie.d.mts +0 -17
  32. package/dist/es/serialized-memo.d.mts +0 -60
  33. package/dist/es/simple-string-hash.d.mts +0 -3
  34. package/dist/es/string-join.d.mts +0 -3
  35. package/dist/es/tagged.d.mts +0 -6
  36. package/dist/es/text-line-stream.d.mts +0 -20
  37. package/dist/es/wait.d.mts +0 -4
  38. /package/dist/{cjs/add-array-elements-to-set.d.ts → add-array-elements-to-set.d.ts} +0 -0
  39. /package/dist/{cjs/add-array-elements-to-set.js → add-array-elements-to-set.js} +0 -0
  40. /package/dist/{es/add-array-elements-to-set.mjs → add-array-elements-to-set.mjs} +0 -0
  41. /package/dist/{cjs/ahocorasick.d.ts → ahocorasick.d.ts} +0 -0
  42. /package/dist/{cjs/ahocorasick.js → ahocorasick.js} +0 -0
  43. /package/dist/{es/ahocorasick.mjs → ahocorasick.mjs} +0 -0
  44. /package/dist/{cjs/append-array-in-place.d.ts → append-array-in-place.d.ts} +0 -0
  45. /package/dist/{cjs/append-array-in-place.js → append-array-in-place.js} +0 -0
  46. /package/dist/{es/append-array-in-place.mjs → append-array-in-place.mjs} +0 -0
  47. /package/dist/{cjs/append-set-elements-to-array.d.ts → append-set-elements-to-array.d.ts} +0 -0
  48. /package/dist/{cjs/append-set-elements-to-array.js → append-set-elements-to-array.js} +0 -0
  49. /package/dist/{es/append-set-elements-to-array.mjs → append-set-elements-to-array.mjs} +0 -0
  50. /package/dist/{cjs/async-write-to-stream.d.ts → async-write-to-stream.d.ts} +0 -0
  51. /package/dist/{cjs/async-write-to-stream.js → async-write-to-stream.js} +0 -0
  52. /package/dist/{es/async-write-to-stream.mjs → async-write-to-stream.mjs} +0 -0
  53. /package/dist/{cjs/bitwise.d.ts → bitwise.d.ts} +0 -0
  54. /package/dist/{cjs/bitwise.js → bitwise.js} +0 -0
  55. /package/dist/{es/bitwise.mjs → bitwise.mjs} +0 -0
  56. /package/dist/{cjs/compare-source.d.ts → compare-source.d.ts} +0 -0
  57. /package/dist/{cjs/compare-source.js → compare-source.js} +0 -0
  58. /package/dist/{es/compare-source.mjs → compare-source.mjs} +0 -0
  59. /package/dist/{cjs/create-fixed-array.d.ts → create-fixed-array.d.ts} +0 -0
  60. /package/dist/{cjs/create-fixed-array.js → create-fixed-array.js} +0 -0
  61. /package/dist/{es/create-fixed-array.mjs → create-fixed-array.mjs} +0 -0
  62. /package/dist/{cjs/detect-eol.d.ts → detect-eol.d.ts} +0 -0
  63. /package/dist/{cjs/detect-eol.js → detect-eol.js} +0 -0
  64. /package/dist/{es/detect-eol.mjs → detect-eol.mjs} +0 -0
  65. /package/dist/{cjs/escape-html.d.ts → escape-html.d.ts} +0 -0
  66. /package/dist/{cjs/escape-html.js → escape-html.js} +0 -0
  67. /package/dist/{es/escape-html.mjs → escape-html.mjs} +0 -0
  68. /package/dist/{cjs/escape-string-regexp.d.ts → escape-string-regexp.d.ts} +0 -0
  69. /package/dist/{cjs/escape-string-regexp.js → escape-string-regexp.js} +0 -0
  70. /package/dist/{es/escape-string-regexp.mjs → escape-string-regexp.mjs} +0 -0
  71. /package/dist/{cjs/fast-ip-version.d.ts → fast-ip-version.d.ts} +0 -0
  72. /package/dist/{cjs/fast-ip-version.js → fast-ip-version.js} +0 -0
  73. /package/dist/{es/fast-ip-version.mjs → fast-ip-version.mjs} +0 -0
  74. /package/dist/{cjs/fast-string-array-join.d.ts → fast-string-array-join.d.ts} +0 -0
  75. /package/dist/{cjs/fast-string-array-join.js → fast-string-array-join.js} +0 -0
  76. /package/dist/{es/fast-string-array-join.mjs → fast-string-array-join.mjs} +0 -0
  77. /package/dist/{cjs/fifo.d.ts → fifo.d.ts} +0 -0
  78. /package/dist/{cjs/fifo.js → fifo.js} +0 -0
  79. /package/dist/{es/fifo.mjs → fifo.mjs} +0 -0
  80. /package/dist/{cjs/fnv1a.d.ts → fnv1a.d.ts} +0 -0
  81. /package/dist/{cjs/fnv1a.js → fnv1a.js} +0 -0
  82. /package/dist/{es/fnv1a.mjs → fnv1a.mjs} +0 -0
  83. /package/dist/{cjs/fnv1a52.d.ts → fnv1a52.d.ts} +0 -0
  84. /package/dist/{cjs/fnv1a52.js → fnv1a52.js} +0 -0
  85. /package/dist/{es/fnv1a52.mjs → fnv1a52.mjs} +0 -0
  86. /package/dist/{cjs/guard.d.ts → guard.d.ts} +0 -0
  87. /package/dist/{cjs/guard.js → guard.js} +0 -0
  88. /package/dist/{es/guard.mjs → guard.mjs} +0 -0
  89. /package/dist/{cjs/headers-to-object.d.ts → headers-to-object.d.ts} +0 -0
  90. /package/dist/{cjs/headers-to-object.js → headers-to-object.js} +0 -0
  91. /package/dist/{es/headers-to-object.mjs → headers-to-object.mjs} +0 -0
  92. /package/dist/{cjs/identity.d.ts → identity.d.ts} +0 -0
  93. /package/dist/{cjs/identity.js → identity.js} +0 -0
  94. /package/dist/{es/identity.mjs → identity.mjs} +0 -0
  95. /package/dist/{cjs/is-probably-ip.d.ts → is-probably-ip.d.ts} +0 -0
  96. /package/dist/{cjs/is-probably-ip.js → is-probably-ip.js} +0 -0
  97. /package/dist/{es/is-probably-ip.mjs → is-probably-ip.mjs} +0 -0
  98. /package/dist/{cjs/merge-headers.d.ts → merge-headers.d.ts} +0 -0
  99. /package/dist/{cjs/merge-headers.js → merge-headers.js} +0 -0
  100. /package/dist/{es/merge-headers.mjs → merge-headers.mjs} +0 -0
  101. /package/dist/{cjs/noop.d.ts → noop.d.ts} +0 -0
  102. /package/dist/{cjs/noop.js → noop.js} +0 -0
  103. /package/dist/{es/noop.mjs → noop.mjs} +0 -0
  104. /package/dist/{cjs/once.d.ts → once.d.ts} +0 -0
  105. /package/dist/{cjs/once.js → once.js} +0 -0
  106. /package/dist/{es/once.mjs → once.mjs} +0 -0
  107. /package/dist/{cjs/pick-random.d.ts → pick-random.d.ts} +0 -0
  108. /package/dist/{cjs/pick-random.js → pick-random.js} +0 -0
  109. /package/dist/{es/pick-random.mjs → pick-random.mjs} +0 -0
  110. /package/dist/{cjs/random-int.d.ts → random-int.d.ts} +0 -0
  111. /package/dist/{cjs/random-int.js → random-int.js} +0 -0
  112. /package/dist/{es/random-int.mjs → random-int.mjs} +0 -0
  113. /package/dist/{cjs/repool.d.ts → repool.d.ts} +0 -0
  114. /package/dist/{cjs/repool.js → repool.js} +0 -0
  115. /package/dist/{es/repool.mjs → repool.mjs} +0 -0
  116. /package/dist/{cjs/retrie.d.ts → retrie.d.ts} +0 -0
  117. /package/dist/{cjs/retrie.js → retrie.js} +0 -0
  118. /package/dist/{es/retrie.mjs → retrie.mjs} +0 -0
  119. /package/dist/{cjs/serialized-memo.d.ts → serialized-memo.d.ts} +0 -0
  120. /package/dist/{cjs/serialized-memo.js → serialized-memo.js} +0 -0
  121. /package/dist/{es/serialized-memo.mjs → serialized-memo.mjs} +0 -0
  122. /package/dist/{cjs/simple-string-hash.d.ts → simple-string-hash.d.ts} +0 -0
  123. /package/dist/{cjs/simple-string-hash.js → simple-string-hash.js} +0 -0
  124. /package/dist/{es/simple-string-hash.mjs → simple-string-hash.mjs} +0 -0
  125. /package/dist/{cjs/string-join.d.ts → string-join.d.ts} +0 -0
  126. /package/dist/{cjs/string-join.js → string-join.js} +0 -0
  127. /package/dist/{es/string-join.mjs → string-join.mjs} +0 -0
  128. /package/dist/{cjs/tagged.d.ts → tagged.d.ts} +0 -0
  129. /package/dist/{cjs/tagged.js → tagged.js} +0 -0
  130. /package/dist/{es/tagged.mjs → tagged.mjs} +0 -0
  131. /package/dist/{cjs/text-line-stream.d.ts → text-line-stream.d.ts} +0 -0
  132. /package/dist/{cjs/text-line-stream.js → text-line-stream.js} +0 -0
  133. /package/dist/{es/text-line-stream.mjs → text-line-stream.mjs} +0 -0
  134. /package/dist/{cjs/wait.d.ts → wait.d.ts} +0 -0
  135. /package/dist/{cjs/wait.js → wait.js} +0 -0
  136. /package/dist/{es/wait.mjs → wait.mjs} +0 -0
@@ -0,0 +1,8 @@
1
+ interface ShuffleArrayOptions {
2
+ copy?: boolean;
3
+ random?: () => number;
4
+ }
5
+ declare function shuffleArray<T>(arr: T[], options?: ShuffleArrayOptions): T[];
6
+
7
+ export { shuffleArray };
8
+ export type { ShuffleArrayOptions };
@@ -0,0 +1 @@
1
+ Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./random-int.js");exports.shuffleArray=function(r,t={}){let n,{copy:o=!1,random:a=Math.random}=t,l=o?r.slice():r,s=e.createRandomInt(a),u=0;for(let e=l.length-1;e>0;e--)u=s(0,e),n=l[e],l[e]=l[u],l[u]=n;return l};
@@ -0,0 +1 @@
1
+ import{createRandomInt as r}from"./random-int.mjs";function t(e,n={}){let o,{copy:f=!1,random:l=Math.random}=n,m=f?e.slice():e,a=r(l),i=0;for(let r=m.length-1;r>0;r--)i=a(0,r),o=m[r],m[r]=m[i],m[i]=o;return m}export{t as shuffleArray};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "foxts",
3
- "version": "3.8.0",
3
+ "version": "3.9.0",
4
4
  "description": "Opinionated collection of common TypeScript utils by @SukkaW",
5
5
  "repository": {
6
6
  "url": "https://github.com/SukkaW/foxts"
@@ -10,334 +10,208 @@
10
10
  ],
11
11
  "exports": {
12
12
  "./add-array-elements-to-set": {
13
- "import": {
14
- "types": "./dist/es/add-array-elements-to-set.d.mts",
15
- "default": "./dist/es/add-array-elements-to-set.mjs"
16
- },
17
- "require": {
18
- "types": "./dist/cjs/add-array-elements-to-set.d.ts",
19
- "default": "./dist/cjs/add-array-elements-to-set.js"
20
- }
13
+ "types": "./dist/add-array-elements-to-set.d.ts",
14
+ "import": "./dist/add-array-elements-to-set.mjs",
15
+ "require": "./dist/add-array-elements-to-set.js",
16
+ "default": "./dist/add-array-elements-to-set.js"
21
17
  },
22
18
  "./ahocorasick": {
23
- "import": {
24
- "types": "./dist/es/ahocorasick.d.mts",
25
- "default": "./dist/es/ahocorasick.mjs"
26
- },
27
- "require": {
28
- "types": "./dist/cjs/ahocorasick.d.ts",
29
- "default": "./dist/cjs/ahocorasick.js"
30
- }
19
+ "types": "./dist/ahocorasick.d.ts",
20
+ "import": "./dist/ahocorasick.mjs",
21
+ "require": "./dist/ahocorasick.js",
22
+ "default": "./dist/ahocorasick.js"
31
23
  },
32
24
  "./append-array-in-place": {
33
- "import": {
34
- "types": "./dist/es/append-array-in-place.d.mts",
35
- "default": "./dist/es/append-array-in-place.mjs"
36
- },
37
- "require": {
38
- "types": "./dist/cjs/append-array-in-place.d.ts",
39
- "default": "./dist/cjs/append-array-in-place.js"
40
- }
25
+ "types": "./dist/append-array-in-place.d.ts",
26
+ "import": "./dist/append-array-in-place.mjs",
27
+ "require": "./dist/append-array-in-place.js",
28
+ "default": "./dist/append-array-in-place.js"
41
29
  },
42
30
  "./append-set-elements-to-array": {
43
- "import": {
44
- "types": "./dist/es/append-set-elements-to-array.d.mts",
45
- "default": "./dist/es/append-set-elements-to-array.mjs"
46
- },
47
- "require": {
48
- "types": "./dist/cjs/append-set-elements-to-array.d.ts",
49
- "default": "./dist/cjs/append-set-elements-to-array.js"
50
- }
31
+ "types": "./dist/append-set-elements-to-array.d.ts",
32
+ "import": "./dist/append-set-elements-to-array.mjs",
33
+ "require": "./dist/append-set-elements-to-array.js",
34
+ "default": "./dist/append-set-elements-to-array.js"
51
35
  },
52
36
  "./compare-source": {
53
- "import": {
54
- "types": "./dist/es/compare-source.d.mts",
55
- "default": "./dist/es/compare-source.mjs"
56
- },
57
- "require": {
58
- "types": "./dist/cjs/compare-source.d.ts",
59
- "default": "./dist/cjs/compare-source.js"
60
- }
37
+ "types": "./dist/compare-source.d.ts",
38
+ "import": "./dist/compare-source.mjs",
39
+ "require": "./dist/compare-source.js",
40
+ "default": "./dist/compare-source.js"
61
41
  },
62
42
  "./async-write-to-stream": {
63
- "import": {
64
- "types": "./dist/es/async-write-to-stream.d.mts",
65
- "default": "./dist/es/async-write-to-stream.mjs"
66
- },
67
- "require": {
68
- "types": "./dist/cjs/async-write-to-stream.d.ts",
69
- "default": "./dist/cjs/async-write-to-stream.js"
70
- }
43
+ "types": "./dist/async-write-to-stream.d.ts",
44
+ "import": "./dist/async-write-to-stream.mjs",
45
+ "require": "./dist/async-write-to-stream.js",
46
+ "default": "./dist/async-write-to-stream.js"
71
47
  },
72
48
  "./bitwise": {
73
- "import": {
74
- "types": "./dist/es/bitwise.d.mts",
75
- "default": "./dist/es/bitwise.mjs"
76
- },
77
- "require": {
78
- "types": "./dist/cjs/bitwise.d.ts",
79
- "default": "./dist/cjs/bitwise.js"
80
- }
49
+ "types": "./dist/bitwise.d.ts",
50
+ "import": "./dist/bitwise.mjs",
51
+ "require": "./dist/bitwise.js",
52
+ "default": "./dist/bitwise.js"
81
53
  },
82
54
  "./create-fixed-array": {
83
- "import": {
84
- "types": "./dist/es/create-fixed-array.d.mts",
85
- "default": "./dist/es/create-fixed-array.mjs"
86
- },
87
- "require": {
88
- "types": "./dist/cjs/create-fixed-array.d.ts",
89
- "default": "./dist/cjs/create-fixed-array.js"
90
- }
55
+ "types": "./dist/create-fixed-array.d.ts",
56
+ "import": "./dist/create-fixed-array.mjs",
57
+ "require": "./dist/create-fixed-array.js",
58
+ "default": "./dist/create-fixed-array.js"
91
59
  },
92
60
  "./detect-eol": {
93
- "import": {
94
- "types": "./dist/es/detect-eol.d.mts",
95
- "default": "./dist/es/detect-eol.mjs"
96
- },
97
- "require": {
98
- "types": "./dist/cjs/detect-eol.d.ts",
99
- "default": "./dist/cjs/detect-eol.js"
100
- }
61
+ "types": "./dist/detect-eol.d.ts",
62
+ "import": "./dist/detect-eol.mjs",
63
+ "require": "./dist/detect-eol.js",
64
+ "default": "./dist/detect-eol.js"
101
65
  },
102
66
  "./escape-string-regexp": {
103
- "import": {
104
- "types": "./dist/es/escape-string-regexp.d.mts",
105
- "default": "./dist/es/escape-string-regexp.mjs"
106
- },
107
- "require": {
108
- "types": "./dist/cjs/escape-string-regexp.d.ts",
109
- "default": "./dist/cjs/escape-string-regexp.js"
110
- }
67
+ "types": "./dist/escape-string-regexp.d.ts",
68
+ "import": "./dist/escape-string-regexp.mjs",
69
+ "require": "./dist/escape-string-regexp.js",
70
+ "default": "./dist/escape-string-regexp.js"
111
71
  },
112
72
  "./escape-html": {
113
- "import": {
114
- "types": "./dist/es/escape-html.d.mts",
115
- "default": "./dist/es/escape-html.mjs"
116
- },
117
- "require": {
118
- "types": "./dist/cjs/escape-html.d.ts",
119
- "default": "./dist/cjs/escape-html.js"
120
- }
73
+ "types": "./dist/escape-html.d.ts",
74
+ "import": "./dist/escape-html.mjs",
75
+ "require": "./dist/escape-html.js",
76
+ "default": "./dist/escape-html.js"
121
77
  },
122
78
  "./fast-string-array-join": {
123
- "import": {
124
- "types": "./dist/es/fast-string-array-join.d.mts",
125
- "default": "./dist/es/fast-string-array-join.mjs"
126
- },
127
- "require": {
128
- "types": "./dist/cjs/fast-string-array-join.d.ts",
129
- "default": "./dist/cjs/fast-string-array-join.js"
130
- }
79
+ "types": "./dist/fast-string-array-join.d.ts",
80
+ "import": "./dist/fast-string-array-join.mjs",
81
+ "require": "./dist/fast-string-array-join.js",
82
+ "default": "./dist/fast-string-array-join.js"
131
83
  },
132
84
  "./fifo": {
133
- "import": {
134
- "types": "./dist/es/fifo.d.mts",
135
- "default": "./dist/es/fifo.mjs"
136
- },
137
- "require": {
138
- "types": "./dist/cjs/fifo.d.ts",
139
- "default": "./dist/cjs/fifo.js"
140
- }
85
+ "types": "./dist/fifo.d.ts",
86
+ "import": "./dist/fifo.mjs",
87
+ "require": "./dist/fifo.js",
88
+ "default": "./dist/fifo.js"
141
89
  },
142
90
  "./fnv1a": {
143
- "import": {
144
- "types": "./dist/es/fnv1a.d.mts",
145
- "default": "./dist/es/fnv1a.mjs"
146
- },
147
- "require": {
148
- "types": "./dist/cjs/fnv1a.d.ts",
149
- "default": "./dist/cjs/fnv1a.js"
150
- }
91
+ "types": "./dist/fnv1a.d.ts",
92
+ "import": "./dist/fnv1a.mjs",
93
+ "require": "./dist/fnv1a.js",
94
+ "default": "./dist/fnv1a.js"
151
95
  },
152
96
  "./fnv1a52": {
153
- "import": {
154
- "types": "./dist/es/fnv1a52.d.mts",
155
- "default": "./dist/es/fnv1a52.mjs"
156
- },
157
- "require": {
158
- "types": "./dist/cjs/fnv1a52.d.ts",
159
- "default": "./dist/cjs/fnv1a52.js"
160
- }
97
+ "types": "./dist/fnv1a52.d.ts",
98
+ "import": "./dist/fnv1a52.mjs",
99
+ "require": "./dist/fnv1a52.js",
100
+ "default": "./dist/fnv1a52.js"
161
101
  },
162
102
  "./guard": {
163
- "import": {
164
- "types": "./dist/es/guard.d.mts",
165
- "default": "./dist/es/guard.mjs"
166
- },
167
- "require": {
168
- "types": "./dist/cjs/guard.d.ts",
169
- "default": "./dist/cjs/guard.js"
170
- }
103
+ "types": "./dist/guard.d.ts",
104
+ "import": "./dist/guard.mjs",
105
+ "require": "./dist/guard.js",
106
+ "default": "./dist/guard.js"
171
107
  },
172
108
  "./headers-to-object": {
173
- "import": {
174
- "types": "./dist/es/headers-to-object.d.mts",
175
- "default": "./dist/es/headers-to-object.mjs"
176
- },
177
- "require": {
178
- "types": "./dist/cjs/headers-to-object.d.ts",
179
- "default": "./dist/cjs/headers-to-object.js"
180
- }
109
+ "types": "./dist/headers-to-object.d.ts",
110
+ "import": "./dist/headers-to-object.mjs",
111
+ "require": "./dist/headers-to-object.js",
112
+ "default": "./dist/headers-to-object.js"
181
113
  },
182
114
  "./identity": {
183
- "import": {
184
- "types": "./dist/es/identity.d.mts",
185
- "default": "./dist/es/identity.mjs"
186
- },
187
- "require": {
188
- "types": "./dist/cjs/identity.d.ts",
189
- "default": "./dist/cjs/identity.js"
190
- }
115
+ "types": "./dist/identity.d.ts",
116
+ "import": "./dist/identity.mjs",
117
+ "require": "./dist/identity.js",
118
+ "default": "./dist/identity.js"
191
119
  },
192
120
  "./is-probably-ip": {
193
- "import": {
194
- "types": "./dist/es/is-probably-ip.d.mts",
195
- "default": "./dist/es/is-probably-ip.mjs"
196
- },
197
- "require": {
198
- "types": "./dist/cjs/is-probably-ip.d.ts",
199
- "default": "./dist/cjs/is-probably-ip.js"
200
- }
121
+ "types": "./dist/is-probably-ip.d.ts",
122
+ "import": "./dist/is-probably-ip.mjs",
123
+ "require": "./dist/is-probably-ip.js",
124
+ "default": "./dist/is-probably-ip.js"
201
125
  },
202
126
  "./merge-headers": {
203
- "import": {
204
- "types": "./dist/es/merge-headers.d.mts",
205
- "default": "./dist/es/merge-headers.mjs"
206
- },
207
- "require": {
208
- "types": "./dist/cjs/merge-headers.d.ts",
209
- "default": "./dist/cjs/merge-headers.js"
210
- }
127
+ "types": "./dist/merge-headers.d.ts",
128
+ "import": "./dist/merge-headers.mjs",
129
+ "require": "./dist/merge-headers.js",
130
+ "default": "./dist/merge-headers.js"
211
131
  },
212
132
  "./noop": {
213
- "import": {
214
- "types": "./dist/es/noop.d.mts",
215
- "default": "./dist/es/noop.mjs"
216
- },
217
- "require": {
218
- "types": "./dist/cjs/noop.d.ts",
219
- "default": "./dist/cjs/noop.js"
220
- }
133
+ "types": "./dist/noop.d.ts",
134
+ "import": "./dist/noop.mjs",
135
+ "require": "./dist/noop.js",
136
+ "default": "./dist/noop.js"
221
137
  },
222
138
  "./once": {
223
- "import": {
224
- "types": "./dist/es/once.d.mts",
225
- "default": "./dist/es/once.mjs"
226
- },
227
- "require": {
228
- "types": "./dist/cjs/once.d.ts",
229
- "default": "./dist/cjs/once.js"
230
- }
139
+ "types": "./dist/once.d.ts",
140
+ "import": "./dist/once.mjs",
141
+ "require": "./dist/once.js",
142
+ "default": "./dist/once.js"
231
143
  },
232
144
  "./pick-random": {
233
- "import": {
234
- "types": "./dist/es/pick-random.d.mts",
235
- "default": "./dist/es/pick-random.mjs"
236
- },
237
- "require": {
238
- "types": "./dist/cjs/pick-random.d.ts",
239
- "default": "./dist/cjs/pick-random.js"
240
- }
145
+ "types": "./dist/pick-random.d.ts",
146
+ "import": "./dist/pick-random.mjs",
147
+ "require": "./dist/pick-random.js",
148
+ "default": "./dist/pick-random.js"
241
149
  },
242
150
  "./random-int": {
243
- "import": {
244
- "types": "./dist/es/random-int.d.mts",
245
- "default": "./dist/es/random-int.mjs"
246
- },
247
- "require": {
248
- "types": "./dist/cjs/random-int.d.ts",
249
- "default": "./dist/cjs/random-int.js"
250
- }
151
+ "types": "./dist/random-int.d.ts",
152
+ "import": "./dist/random-int.mjs",
153
+ "require": "./dist/random-int.js",
154
+ "default": "./dist/random-int.js"
251
155
  },
252
156
  "./repool": {
253
- "import": {
254
- "types": "./dist/es/repool.d.mts",
255
- "default": "./dist/es/repool.mjs"
256
- },
257
- "require": {
258
- "types": "./dist/cjs/repool.d.ts",
259
- "default": "./dist/cjs/repool.js"
260
- }
157
+ "types": "./dist/repool.d.ts",
158
+ "import": "./dist/repool.mjs",
159
+ "require": "./dist/repool.js",
160
+ "default": "./dist/repool.js"
261
161
  },
262
162
  "./serialized-memo": {
263
- "import": {
264
- "types": "./dist/es/serialized-memo.d.mts",
265
- "default": "./dist/es/serialized-memo.mjs"
266
- },
267
- "require": {
268
- "types": "./dist/cjs/serialized-memo.d.ts",
269
- "default": "./dist/cjs/serialized-memo.js"
270
- }
163
+ "types": "./dist/serialized-memo.d.ts",
164
+ "import": "./dist/serialized-memo.mjs",
165
+ "require": "./dist/serialized-memo.js",
166
+ "default": "./dist/serialized-memo.js"
271
167
  },
272
168
  "./simple-string-hash": {
273
- "import": {
274
- "types": "./dist/es/simple-string-hash.d.mts",
275
- "default": "./dist/es/simple-string-hash.mjs"
276
- },
277
- "require": {
278
- "types": "./dist/cjs/simple-string-hash.d.ts",
279
- "default": "./dist/cjs/simple-string-hash.js"
280
- }
169
+ "types": "./dist/simple-string-hash.d.ts",
170
+ "import": "./dist/simple-string-hash.mjs",
171
+ "require": "./dist/simple-string-hash.js",
172
+ "default": "./dist/simple-string-hash.js"
281
173
  },
282
174
  "./retrie": {
283
- "import": {
284
- "types": "./dist/es/retrie.d.mts",
285
- "default": "./dist/es/retrie.mjs"
286
- },
287
- "require": {
288
- "types": "./dist/cjs/retrie.d.ts",
289
- "default": "./dist/cjs/retrie.js"
290
- }
175
+ "types": "./dist/retrie.d.ts",
176
+ "import": "./dist/retrie.mjs",
177
+ "require": "./dist/retrie.js",
178
+ "default": "./dist/retrie.js"
291
179
  },
292
180
  "./text-line-stream": {
293
- "import": {
294
- "types": "./dist/es/text-line-stream.d.mts",
295
- "default": "./dist/es/text-line-stream.mjs"
296
- },
297
- "require": {
298
- "types": "./dist/cjs/text-line-stream.d.ts",
299
- "default": "./dist/cjs/text-line-stream.js"
300
- }
181
+ "types": "./dist/text-line-stream.d.ts",
182
+ "import": "./dist/text-line-stream.mjs",
183
+ "require": "./dist/text-line-stream.js",
184
+ "default": "./dist/text-line-stream.js"
301
185
  },
302
186
  "./tagged": {
303
- "import": {
304
- "types": "./dist/es/tagged.d.mts",
305
- "default": "./dist/es/tagged.mjs"
306
- },
307
- "require": {
308
- "types": "./dist/cjs/tagged.d.ts",
309
- "default": "./dist/cjs/tagged.js"
310
- }
187
+ "types": "./dist/tagged.d.ts",
188
+ "import": "./dist/tagged.mjs",
189
+ "require": "./dist/tagged.js",
190
+ "default": "./dist/tagged.js"
311
191
  },
312
192
  "./wait": {
313
- "import": {
314
- "types": "./dist/es/wait.d.mts",
315
- "default": "./dist/es/wait.mjs"
316
- },
317
- "require": {
318
- "types": "./dist/cjs/wait.d.ts",
319
- "default": "./dist/cjs/wait.js"
320
- }
193
+ "types": "./dist/wait.d.ts",
194
+ "import": "./dist/wait.mjs",
195
+ "require": "./dist/wait.js",
196
+ "default": "./dist/wait.js"
321
197
  },
322
198
  "./string-join": {
323
- "import": {
324
- "types": "./dist/es/string-join.d.mts",
325
- "default": "./dist/es/string-join.mjs"
326
- },
327
- "require": {
328
- "types": "./dist/cjs/string-join.d.ts",
329
- "default": "./dist/cjs/string-join.js"
330
- }
199
+ "types": "./dist/string-join.d.ts",
200
+ "import": "./dist/string-join.mjs",
201
+ "require": "./dist/string-join.js",
202
+ "default": "./dist/string-join.js"
331
203
  },
332
204
  "./fast-ip-version": {
333
- "import": {
334
- "types": "./dist/es/fast-ip-version.d.mts",
335
- "default": "./dist/es/fast-ip-version.mjs"
336
- },
337
- "require": {
338
- "types": "./dist/cjs/fast-ip-version.d.ts",
339
- "default": "./dist/cjs/fast-ip-version.js"
340
- }
205
+ "types": "./dist/fast-ip-version.d.ts",
206
+ "import": "./dist/fast-ip-version.mjs",
207
+ "require": "./dist/fast-ip-version.js",
208
+ "default": "./dist/fast-ip-version.js"
209
+ },
210
+ "./shuffle-array": {
211
+ "types": "./dist/shuffle-array.d.ts",
212
+ "import": "./dist/shuffle-array.mjs",
213
+ "require": "./dist/shuffle-array.js",
214
+ "default": "./dist/shuffle-array.js"
341
215
  }
342
216
  },
343
217
  "sideEffects": false,
@@ -1,3 +0,0 @@
1
- declare function addArrayElementsToSet<T>(set: Set<T>, arr: T[], transformer?: (item: T) => T): Set<T>;
2
-
3
- export { addArrayElementsToSet };
@@ -1,3 +0,0 @@
1
- declare function createAhoCorasick(keys: string[] | Set<string> | readonly string[]): (text: string) => boolean;
2
-
3
- export { createAhoCorasick };
@@ -1,4 +0,0 @@
1
- declare function appendArrayInPlace<T>(dest: T[], source: T[]): T[];
2
- declare const appendArrayInPlaceCurried: <T>(dest: T[]) => (source: T[]) => T[];
3
-
4
- export { appendArrayInPlace, appendArrayInPlaceCurried };
@@ -1,3 +0,0 @@
1
- declare function appendSetElementsToArray<T>(dest: T[], source: Set<T> | Array<Set<T>>, transformer?: (item: T) => T): T[];
2
-
3
- export { appendSetElementsToArray };
@@ -1,18 +0,0 @@
1
- import { Writable } from 'node:stream';
2
-
3
- /**
4
- * A small utility function for writing chunk to a stream, and only return promise when needed (stream backpressure)
5
- *
6
- * ```ts
7
- * const writeStream = fs.createWriteStream(outputFile);
8
- * for (const line of source) {
9
- * const p = asyncWriteToStream(writeStream, line + '\n');
10
- * if (p) {
11
- * // eslint-disable-next-line no-await-in-loop -- stream backpressure
12
- * await p;
13
- * }
14
- * }
15
- */
16
- declare function asyncWriteToStream<T>(stream: Writable, chunk: T): Promise<unknown> | null;
17
-
18
- export { asyncWriteToStream };
@@ -1,30 +0,0 @@
1
- declare function bitCount(n: number): number;
2
- declare const getBit: (n: number, mask: number) => boolean;
3
- declare const missingBit: (n: number, mask: number) => boolean;
4
- declare const setBit: (n: number, mask: number) => number;
5
- declare const deleteBit: (n: number, mask: number) => number;
6
- /** Packs two 16-bit integers (0~65535) into one 32-bit integer */
7
- declare const packTwoBits: (a: number, b: number) => number;
8
- declare const unpackTwoBitsFirst: (value: number) => number;
9
- declare const unpackTwoBitsSecond: (value: number) => number;
10
- /**
11
- * Unpacks two 16-bit integers (0~65535) from one 32-bit integer
12
- *
13
- * @param value - The 32-bit integer to unpack
14
- * @param arr - An optional array to store the unpacked values, useful if you are trying to re-use arrays
15
- */
16
- declare function unpackTwoBits(value: number, arr?: [a: number, b: number]): [a: number, b: number];
17
- /** Packs three 10-bit integers (0~1023) into one 32-bit integer */
18
- declare const packThreeBits: (a: number, b: number, c: number) => number;
19
- declare const unpackThreeBitsFirst: (value: number) => number;
20
- declare const unpackThreeBitsSecond: (value: number) => number;
21
- declare const unpackThreeBitsThird: (value: number) => number;
22
- /**
23
- * Unpacks three 10-bit integers (0~1023) from one 32-bit integer
24
- *
25
- * @param value - The 32-bit integer to unpack
26
- * @param arr - An optional array to store the unpacked values, useful if you are trying to re-use arrays
27
- */
28
- declare function unpackThreeBits(value: number, arr?: [a: number, b: number, c: number]): [a: number, b: number, c: number];
29
-
30
- export { bitCount, deleteBit, getBit, missingBit, packThreeBits, packTwoBits, setBit, unpackThreeBits, unpackThreeBitsFirst, unpackThreeBitsSecond, unpackThreeBitsThird, unpackTwoBits, unpackTwoBitsFirst, unpackTwoBitsSecond };
@@ -1,5 +0,0 @@
1
- declare function createCompareSource<T>(callback?: (a: T, b: T) => boolean): (source: T[], target: Iterable<T> | AsyncIterable<T>) => Promise<boolean>;
2
- declare function compareSource<T>(source: T[], target: Iterable<T> | AsyncIterable<T>, callback?: (a: T, b: T) => boolean): Promise<boolean>;
3
- declare function fileEqualWithCommentComparator(lineA: string, lineB: string): boolean;
4
-
5
- export { compareSource, createCompareSource, fileEqualWithCommentComparator };
@@ -1,6 +0,0 @@
1
- declare function createFixedArrayWithoutGC(length: number): readonly number[];
2
- declare function createFixedArrayWithGC(length: number): readonly number[];
3
- declare const createFixedArray: typeof createFixedArrayWithGC;
4
- declare const EMPTY_ARRAY: readonly number[];
5
-
6
- export { EMPTY_ARRAY, createFixedArray, createFixedArrayWithGC, createFixedArrayWithoutGC };
@@ -1,3 +0,0 @@
1
- declare function detectEol(str: string): "\n" | "\r\n";
2
-
3
- export { detectEol };
@@ -1 +0,0 @@
1
- export * from 'fast-escape-html';
@@ -1,11 +0,0 @@
1
- /**
2
- * Escape characters with special meaning either inside or outside character sets.
3
- * Use a simple backslash escape when it’s always valid, and a `\xnn` escape when the simpler form would be disallowed by Unicode patterns’ stricter grammar.
4
- *
5
- * When the `unicodeMode` is `true` (default), the `-` character is escaped as `\x2d` to ensure compatibility with Unicode patterns, PCRE, and MongoDB.
6
- *
7
- * You should disable this option if you are using JavaScript regular expressions without the `u` flag.
8
- */
9
- declare function escapeStringRegexp(str: string, unicodeMode?: boolean): string;
10
-
11
- export { escapeStringRegexp };
@@ -1,6 +0,0 @@
1
- /**
2
- * If you know the input is probably an IP, you can use this function to quickly determine the version of the IP
3
- */
4
- declare function fastIpVersion(probablyIp: string): 4 | 6 | 0;
5
-
6
- export { fastIpVersion };
@@ -1,6 +0,0 @@
1
- /**
2
- * A 200% faster join than the native `Array.prototype.join` for string arrays and string separator.
3
- */
4
- declare function fastStringArrayJoin(arr: string[], sep: string): string;
5
-
6
- export { fastStringArrayJoin };