ctx-core 5.36.3 → 5.37.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.
- package/all/debounce/index.js +2 -1
- package/all/rate_limit/index.js +8 -7
- package/all/rmemo/index.d.ts +3 -3
- package/all/rmemo/index.js +24 -24
- package/all/rmemo__wait/index.js +3 -1
- package/all/throttle/index.js +3 -3
- package/all/timeout_promise/index.js +1 -4
- package/all/url__join/index.js +5 -2
- package/all/url__join/index.test.ts +6 -0
- package/package.json +413 -412
package/all/debounce/index.js
CHANGED
|
@@ -17,6 +17,7 @@ export function debounce(func, wait, immediate) {
|
|
|
17
17
|
resolve = in_resolve
|
|
18
18
|
reject = in_reject
|
|
19
19
|
})
|
|
20
|
+
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
20
21
|
const apply_this = this
|
|
21
22
|
const later = async ()=>{
|
|
22
23
|
timeout = null
|
|
@@ -31,7 +32,7 @@ export function debounce(func, wait, immediate) {
|
|
|
31
32
|
if (callNow) {
|
|
32
33
|
await invoke()
|
|
33
34
|
}
|
|
34
|
-
return promise
|
|
35
|
+
return promise.finally(()=>clearTimeout(timeout))
|
|
35
36
|
async function invoke() {
|
|
36
37
|
try {
|
|
37
38
|
const in_rv = func.apply(apply_this, arg_a)
|
package/all/rate_limit/index.js
CHANGED
|
@@ -22,22 +22,23 @@ export function rate_limit_(
|
|
|
22
22
|
start = now
|
|
23
23
|
}
|
|
24
24
|
rate = ops_num / (allow_bursts ? 1 : elapsed)
|
|
25
|
-
|
|
25
|
+
let timeout_id
|
|
26
|
+
return new Promise((resolve, reject)=>{
|
|
26
27
|
try {
|
|
27
28
|
if (rate < max_rate) {
|
|
28
29
|
if (queue_a.length) {
|
|
29
|
-
if (fn) queue_a.push(async ()=>resolve(await fn())
|
|
30
|
-
)
|
|
30
|
+
if (fn) queue_a.push(async ()=>resolve(await fn()))
|
|
31
31
|
ops_num += 1
|
|
32
32
|
queue_a.shift()().then()
|
|
33
33
|
} else {
|
|
34
34
|
ops_num += 1
|
|
35
|
-
|
|
35
|
+
fn()
|
|
36
|
+
.then(val=>resolve(val))
|
|
37
|
+
.finally(()=>clearTimeout(timeout_id))
|
|
36
38
|
}
|
|
37
39
|
} else {
|
|
38
|
-
if (fn) queue_a.push(async ()=>resolve(await fn())
|
|
39
|
-
)
|
|
40
|
-
setTimeout(rate_limit, 1 / max_rate)
|
|
40
|
+
if (fn) queue_a.push(async ()=>resolve(await fn()))
|
|
41
|
+
timeout_id = setTimeout(rate_limit, 1 / max_rate)
|
|
41
42
|
}
|
|
42
43
|
} catch (err) {
|
|
43
44
|
reject(err)
|
package/all/rmemo/index.d.ts
CHANGED
|
@@ -66,8 +66,8 @@ export type memo_def_T<val_T, E = unknown> = (sig:sig_T<val_T, E>)=>val_T
|
|
|
66
66
|
export type rmemo_a_T = unknown[]
|
|
67
67
|
export type rmemo_add_def_T<val_T, add_val_T, E = unknown> = (sig:sig_T<val_T, E>)=>add_val_T
|
|
68
68
|
export type rmemo_f_T = (()=>void)&{
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
69
|
+
readonly l:number
|
|
70
|
+
readonly s:rmemo_T<unknown>[]
|
|
71
|
+
readonly t:rmemo_T<unknown>[]
|
|
72
72
|
}
|
|
73
73
|
export type rmemo_r_T = WeakRef<rmemo_f_T>&{ readonly d?: ()=>rmemo_f_T }
|
package/all/rmemo/index.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
/// <reference types="./index.d.ts" />
|
|
2
|
-
/**
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
/**
|
|
3
|
+
* @type {{ c?:memo_T, q:Set<memo_T> }}
|
|
4
|
+
* $.c child memo calling the memo
|
|
5
|
+
* $.q queue
|
|
6
|
+
*/
|
|
7
|
+
let $ = globalThis.rmemo ??= { q: new Set }
|
|
6
8
|
/**
|
|
7
9
|
* @param {memo_def_T}memo_def
|
|
8
10
|
* @param {rmemo_add_def_T}add_def_a
|
|
@@ -15,17 +17,15 @@ export function memo_(memo_def, ...add_def_a) {
|
|
|
15
17
|
if (!('val' in memo)) {
|
|
16
18
|
memo.f()
|
|
17
19
|
}
|
|
18
|
-
if (
|
|
19
|
-
if (!memo.t.includes(
|
|
20
|
-
|
|
21
|
-
)) {
|
|
22
|
-
memo.t.push(cur_memo.s)
|
|
20
|
+
if ($.c) {
|
|
21
|
+
if (!memo.t.includes($.c.s ??= new WeakRef($.c.f))) {
|
|
22
|
+
memo.t.push($.c.s)
|
|
23
23
|
}
|
|
24
|
-
if (
|
|
25
|
-
// memo is called by
|
|
26
|
-
|
|
27
|
-
// prevent memo from GC while
|
|
28
|
-
if (
|
|
24
|
+
if ($.c.f.l < memo.f.l + 1) $.c.f.l = memo.f.l + 1
|
|
25
|
+
// memo is called by $.c's conditional execution...next change to memo will notify $.c
|
|
26
|
+
$.c.f.s.push(memo)
|
|
27
|
+
// prevent memo from GC while $.c still has a strong reference
|
|
28
|
+
if (!$.c.f.t.includes(memo)) $.c.f.t.push(memo)
|
|
29
29
|
}
|
|
30
30
|
return memo.val
|
|
31
31
|
}
|
|
@@ -35,8 +35,8 @@ export function memo_(memo_def, ...add_def_a) {
|
|
|
35
35
|
if (memo.val !== val) {
|
|
36
36
|
memo.t = memo.t.filter(r=>{
|
|
37
37
|
r = r.deref()
|
|
38
|
-
if (r
|
|
39
|
-
|
|
38
|
+
if (r?.s.includes(memo)) { // if added by $.c.f.s.push(memo), add to $.q
|
|
39
|
+
$.q.add(r)
|
|
40
40
|
}
|
|
41
41
|
return r
|
|
42
42
|
})
|
|
@@ -46,11 +46,11 @@ export function memo_(memo_def, ...add_def_a) {
|
|
|
46
46
|
memo.a = []
|
|
47
47
|
add_def_a.map(memo.add)
|
|
48
48
|
}
|
|
49
|
-
cur_refresh_loop:for (let cur_refresh of
|
|
50
|
-
|
|
51
|
-
for (let queue_refresh of
|
|
49
|
+
cur_refresh_loop:for (let cur_refresh of $.q) {
|
|
50
|
+
$.q.delete(cur_refresh)
|
|
51
|
+
for (let queue_refresh of $.q) {
|
|
52
52
|
if (cur_refresh.l > queue_refresh.l) {
|
|
53
|
-
|
|
53
|
+
$.q.add(cur_refresh)
|
|
54
54
|
continue cur_refresh_loop
|
|
55
55
|
}
|
|
56
56
|
}
|
|
@@ -76,15 +76,15 @@ export function memo_(memo_def, ...add_def_a) {
|
|
|
76
76
|
}
|
|
77
77
|
memo.memo_ = memo_
|
|
78
78
|
memo.f = ()=>{
|
|
79
|
-
let prev_memo =
|
|
80
|
-
|
|
81
|
-
memo.f.s = [] // reset references in memo_def conditional execution path...see
|
|
79
|
+
let prev_memo = $.c
|
|
80
|
+
$.c = memo
|
|
81
|
+
memo.f.s = [] // reset references in memo_def conditional execution path...see $.c.f.s.push(memo)
|
|
82
82
|
try {
|
|
83
83
|
memo._ = memo_def(memo)
|
|
84
84
|
} catch (err) {
|
|
85
85
|
console.error(err)
|
|
86
86
|
}
|
|
87
|
-
|
|
87
|
+
$.c = prev_memo // catch does not throw
|
|
88
88
|
}
|
|
89
89
|
memo.f.l = 0
|
|
90
90
|
memo.f.s = []
|
package/all/rmemo__wait/index.js
CHANGED
|
@@ -16,7 +16,7 @@ export function rmemo__wait(
|
|
|
16
16
|
error
|
|
17
17
|
) {
|
|
18
18
|
let memo
|
|
19
|
-
|
|
19
|
+
let _subscribe_wait = new Promise(resolve=>{
|
|
20
20
|
memo = memo_(()=>{
|
|
21
21
|
if (condition_fn(rmemo())) {
|
|
22
22
|
resolve(rmemo())
|
|
@@ -32,5 +32,7 @@ export function rmemo__wait(
|
|
|
32
32
|
error)
|
|
33
33
|
// prevent GC
|
|
34
34
|
promise.m = memo
|
|
35
|
+
let timeout_id = setTimeout(()=>promise.m(), timeout)
|
|
36
|
+
promise.catch(()=>{}).finally(()=>clearTimeout(timeout_id))
|
|
35
37
|
return promise
|
|
36
38
|
}
|
package/all/throttle/index.js
CHANGED
|
@@ -7,15 +7,15 @@
|
|
|
7
7
|
*/
|
|
8
8
|
export function throttle(fn, threshold = 250, _this) {
|
|
9
9
|
threshold || (threshold = 250)
|
|
10
|
-
let last,
|
|
10
|
+
let last, defer_timeout_id
|
|
11
11
|
return function(...arg_a) {
|
|
12
12
|
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
13
13
|
_this ||= this
|
|
14
14
|
const now = +new Date
|
|
15
15
|
if (last && now < last + threshold) {
|
|
16
16
|
// hold on to it
|
|
17
|
-
clearTimeout(
|
|
18
|
-
|
|
17
|
+
clearTimeout(defer_timeout_id)
|
|
18
|
+
defer_timeout_id = setTimeout(()=>{
|
|
19
19
|
last = now
|
|
20
20
|
fn.apply(_this, arg_a)
|
|
21
21
|
}, threshold)
|
|
@@ -22,10 +22,7 @@ export function timeout_promise(
|
|
|
22
22
|
typeof promise === 'function' ? promise() : promise,
|
|
23
23
|
timeout,
|
|
24
24
|
cancel_promise,
|
|
25
|
-
]).
|
|
26
|
-
clearTimeout(id)
|
|
27
|
-
return result
|
|
28
|
-
})
|
|
25
|
+
]).finally(()=>clearTimeout(id))
|
|
29
26
|
ret_promise.cancel = cancel_promise__resolve
|
|
30
27
|
return ret_promise
|
|
31
28
|
}
|
package/all/url__join/index.js
CHANGED
|
@@ -8,17 +8,20 @@ export function url__join(...url_segment_a) {
|
|
|
8
8
|
let in_query = 0
|
|
9
9
|
for (let url_segment of url_segment_a.flat(Infinity)) {
|
|
10
10
|
let url_segment_str = '' + url_segment
|
|
11
|
+
let last_char = url.slice(-1)
|
|
11
12
|
url += (
|
|
12
|
-
url_segment_str[0] === '/' &&
|
|
13
|
+
url_segment_str[0] === '/' && last_char === '/'
|
|
13
14
|
? url_segment_str.slice(1)
|
|
14
15
|
: ~['/', '?', '&'].indexOf(url_segment_str[0])
|
|
15
16
|
|| (!url && url_segment_str.includes('://'))
|
|
17
|
+
|| in_query && last_char === '&'
|
|
18
|
+
|| !in_query && last_char === '/'
|
|
16
19
|
? url_segment_str
|
|
17
20
|
: in_query
|
|
18
21
|
? '&' + url_segment_str
|
|
19
22
|
: '/' + url_segment_str
|
|
20
23
|
)
|
|
21
|
-
if (url_segment_str.includes('?')) in_query = 1
|
|
24
|
+
if (!in_query && url_segment_str.includes('?')) in_query = 1
|
|
22
25
|
}
|
|
23
26
|
return url
|
|
24
27
|
}
|
|
@@ -26,5 +26,11 @@ test('url__join', ()=>{
|
|
|
26
26
|
equal(
|
|
27
27
|
url__join(['http://localhost/', '/foo/bar/baz?id=1', 'something=else']),
|
|
28
28
|
'http://localhost/foo/bar/baz?id=1&something=else')
|
|
29
|
+
equal(
|
|
30
|
+
url__join('http://localhost/', 'foo', 'bar'),
|
|
31
|
+
'http://localhost/foo/bar')
|
|
32
|
+
equal(
|
|
33
|
+
url__join('http://localhost/', '/foo/bar/baz?id=1&', 'something=else'),
|
|
34
|
+
'http://localhost/foo/bar/baz?id=1&something=else')
|
|
29
35
|
})
|
|
30
36
|
test.run()
|
package/package.json
CHANGED
|
@@ -1,413 +1,414 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
2
|
+
"name": "ctx-core",
|
|
3
|
+
"version": "5.37.0",
|
|
4
|
+
"description": "ctx-core core library",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"ctx-core",
|
|
7
|
+
"array",
|
|
8
|
+
"combinators",
|
|
9
|
+
"function",
|
|
10
|
+
"object",
|
|
11
|
+
"set"
|
|
12
|
+
],
|
|
13
|
+
"homepage": "https://github.com/ctx-core/ctx-core#readme",
|
|
14
|
+
"bugs": {
|
|
15
|
+
"url": "https://github.com/ctx-core/ctx-core/issues"
|
|
16
|
+
},
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "https://github.com/ctx-core/ctx-core.git"
|
|
20
|
+
},
|
|
21
|
+
"license": "Apache-2.0",
|
|
22
|
+
"author": "Brian Takita",
|
|
23
|
+
"type": "module",
|
|
24
|
+
"files": [
|
|
25
|
+
"*.d.ts",
|
|
26
|
+
"*.js",
|
|
27
|
+
"*.json",
|
|
28
|
+
"all",
|
|
29
|
+
"array",
|
|
30
|
+
"atob",
|
|
31
|
+
"base16",
|
|
32
|
+
"be",
|
|
33
|
+
"btoa",
|
|
34
|
+
"buffer",
|
|
35
|
+
"chain",
|
|
36
|
+
"class",
|
|
37
|
+
"cli-args",
|
|
38
|
+
"color",
|
|
39
|
+
"combinators",
|
|
40
|
+
"crypto",
|
|
41
|
+
"currency",
|
|
42
|
+
"data",
|
|
43
|
+
"date",
|
|
44
|
+
"debounce",
|
|
45
|
+
"deep_equal",
|
|
46
|
+
"dom",
|
|
47
|
+
"env",
|
|
48
|
+
"error",
|
|
49
|
+
"event_log",
|
|
50
|
+
"falsy",
|
|
51
|
+
"fetch",
|
|
52
|
+
"fibonacci",
|
|
53
|
+
"fs",
|
|
54
|
+
"function",
|
|
55
|
+
"functional",
|
|
56
|
+
"html",
|
|
57
|
+
"http",
|
|
58
|
+
"math",
|
|
59
|
+
"matrix",
|
|
60
|
+
"nullish",
|
|
61
|
+
"number",
|
|
62
|
+
"object",
|
|
63
|
+
"promise",
|
|
64
|
+
"queue",
|
|
65
|
+
"random",
|
|
66
|
+
"regex",
|
|
67
|
+
"rmemo",
|
|
68
|
+
"run",
|
|
69
|
+
"set",
|
|
70
|
+
"sleep",
|
|
71
|
+
"stream",
|
|
72
|
+
"string",
|
|
73
|
+
"tempfile",
|
|
74
|
+
"test",
|
|
75
|
+
"time",
|
|
76
|
+
"tuple",
|
|
77
|
+
"types",
|
|
78
|
+
"uri",
|
|
79
|
+
"uuid",
|
|
80
|
+
"package.json"
|
|
81
|
+
],
|
|
82
|
+
"exports": {
|
|
83
|
+
".": "./index.js",
|
|
84
|
+
"./all": {
|
|
85
|
+
"browser": "./all/index.browser.js",
|
|
86
|
+
"default": "./all/index.js"
|
|
87
|
+
},
|
|
88
|
+
"./array": {
|
|
89
|
+
"browser": "./array/index.browser.js",
|
|
90
|
+
"default": "./array/index.js"
|
|
91
|
+
},
|
|
92
|
+
"./atob": {
|
|
93
|
+
"browser": "./atob/index.browser.js",
|
|
94
|
+
"default": "./atob/index.js"
|
|
95
|
+
},
|
|
96
|
+
"./base16": {
|
|
97
|
+
"browser": "./base16/index.browser.js",
|
|
98
|
+
"default": "./base16/index.js"
|
|
99
|
+
},
|
|
100
|
+
"./be": {
|
|
101
|
+
"browser": "./be/index.browser.js",
|
|
102
|
+
"default": "./be/index.js"
|
|
103
|
+
},
|
|
104
|
+
"./btoa": {
|
|
105
|
+
"browser": "./btoa/index.browser.js",
|
|
106
|
+
"default": "./btoa/index.js"
|
|
107
|
+
},
|
|
108
|
+
"./buffer": {
|
|
109
|
+
"browser": "./buffer/index.browser.js",
|
|
110
|
+
"default": "./buffer/index.js"
|
|
111
|
+
},
|
|
112
|
+
"./chain": {
|
|
113
|
+
"browser": "./chain/index.browser.js",
|
|
114
|
+
"default": "./chain/index.js"
|
|
115
|
+
},
|
|
116
|
+
"./class": {
|
|
117
|
+
"browser": "./class/index.browser.js",
|
|
118
|
+
"default": "./class/index.js"
|
|
119
|
+
},
|
|
120
|
+
"./cli-args": {
|
|
121
|
+
"browser": "./cli-args/index.browser.js",
|
|
122
|
+
"default": "./cli-args/index.js"
|
|
123
|
+
},
|
|
124
|
+
"./color": {
|
|
125
|
+
"browser": "./color/index.browser.js",
|
|
126
|
+
"default": "./color/index.js"
|
|
127
|
+
},
|
|
128
|
+
"./combinators": {
|
|
129
|
+
"browser": "./combinators/index.browser.js",
|
|
130
|
+
"default": "./combinators/index.js"
|
|
131
|
+
},
|
|
132
|
+
"./crypto": {
|
|
133
|
+
"browser": "./crypto/index.browser.js",
|
|
134
|
+
"default": "./crypto/index.js"
|
|
135
|
+
},
|
|
136
|
+
"./currency": {
|
|
137
|
+
"browser": "./currency/index.browser.js",
|
|
138
|
+
"default": "./currency/index.js"
|
|
139
|
+
},
|
|
140
|
+
"./data": {
|
|
141
|
+
"browser": "./data/index.browser.js",
|
|
142
|
+
"default": "./data/index.js"
|
|
143
|
+
},
|
|
144
|
+
"./date": {
|
|
145
|
+
"browser": "./date/index.browser.js",
|
|
146
|
+
"default": "./date/index.js"
|
|
147
|
+
},
|
|
148
|
+
"./debounce": {
|
|
149
|
+
"browser": "./debounce/index.browser.js",
|
|
150
|
+
"default": "./debounce/index.js"
|
|
151
|
+
},
|
|
152
|
+
"./deep_equal": {
|
|
153
|
+
"browser": "./deep_equal/index.browser.js",
|
|
154
|
+
"default": "./deep_equal/index.js"
|
|
155
|
+
},
|
|
156
|
+
"./dom": {
|
|
157
|
+
"browser": "./dom/index.browser.js",
|
|
158
|
+
"default": "./dom/index.js"
|
|
159
|
+
},
|
|
160
|
+
"./env": {
|
|
161
|
+
"browser": "./env/index.browser.js",
|
|
162
|
+
"default": "./env/index.js"
|
|
163
|
+
},
|
|
164
|
+
"./error": {
|
|
165
|
+
"browser": "./error/index.browser.js",
|
|
166
|
+
"default": "./error/index.js"
|
|
167
|
+
},
|
|
168
|
+
"./event_log": {
|
|
169
|
+
"browser": "./event_log/index.browser.js",
|
|
170
|
+
"default": "./event_log/index.js"
|
|
171
|
+
},
|
|
172
|
+
"./falsy": {
|
|
173
|
+
"browser": "./falsy/index.browser.js",
|
|
174
|
+
"default": "./falsy/index.js"
|
|
175
|
+
},
|
|
176
|
+
"./fetch": {
|
|
177
|
+
"browser": "./fetch/index.browser.js",
|
|
178
|
+
"default": "./fetch/index.js"
|
|
179
|
+
},
|
|
180
|
+
"./fibonacci": {
|
|
181
|
+
"browser": "./fibonacci/index.browser.js",
|
|
182
|
+
"default": "./fibonacci/index.js"
|
|
183
|
+
},
|
|
184
|
+
"./fs": {
|
|
185
|
+
"browser": "./fs/index.browser.js",
|
|
186
|
+
"default": "./fs/index.js"
|
|
187
|
+
},
|
|
188
|
+
"./function": {
|
|
189
|
+
"browser": "./function/index.browser.js",
|
|
190
|
+
"default": "./function/index.js"
|
|
191
|
+
},
|
|
192
|
+
"./functional": {
|
|
193
|
+
"browser": "./functional/index.browser.js",
|
|
194
|
+
"default": "./functional/index.js"
|
|
195
|
+
},
|
|
196
|
+
"./html": {
|
|
197
|
+
"browser": "./html/index.browser.js",
|
|
198
|
+
"default": "./html/index.js"
|
|
199
|
+
},
|
|
200
|
+
"./http": {
|
|
201
|
+
"browser": "./http/index.browser.js",
|
|
202
|
+
"default": "./http/index.js"
|
|
203
|
+
},
|
|
204
|
+
"./math": {
|
|
205
|
+
"browser": "./math/index.browser.js",
|
|
206
|
+
"default": "./math/index.js"
|
|
207
|
+
},
|
|
208
|
+
"./matrix": {
|
|
209
|
+
"browser": "./matrix/index.browser.js",
|
|
210
|
+
"default": "./matrix/index.js"
|
|
211
|
+
},
|
|
212
|
+
"./nullish": {
|
|
213
|
+
"browser": "./nullish/index.browser.js",
|
|
214
|
+
"default": "./nullish/index.js"
|
|
215
|
+
},
|
|
216
|
+
"./number": {
|
|
217
|
+
"browser": "./number/index.browser.js",
|
|
218
|
+
"default": "./number/index.js"
|
|
219
|
+
},
|
|
220
|
+
"./object": {
|
|
221
|
+
"browser": "./object/index.browser.js",
|
|
222
|
+
"default": "./object/index.js"
|
|
223
|
+
},
|
|
224
|
+
"./promise": {
|
|
225
|
+
"browser": "./promise/index.browser.js",
|
|
226
|
+
"default": "./promise/index.js"
|
|
227
|
+
},
|
|
228
|
+
"./queue": {
|
|
229
|
+
"browser": "./queue/index.browser.js",
|
|
230
|
+
"default": "./queue/index.js"
|
|
231
|
+
},
|
|
232
|
+
"./random": {
|
|
233
|
+
"browser": "./random/index.browser.js",
|
|
234
|
+
"default": "./random/index.js"
|
|
235
|
+
},
|
|
236
|
+
"./regex": {
|
|
237
|
+
"browser": "./regex/index.browser.js",
|
|
238
|
+
"default": "./regex/index.js"
|
|
239
|
+
},
|
|
240
|
+
"./rmemo": {
|
|
241
|
+
"browser": "./rmemo/index.browser.js",
|
|
242
|
+
"default": "./rmemo/index.js"
|
|
243
|
+
},
|
|
244
|
+
"./run": {
|
|
245
|
+
"browser": "./run/index.browser.js",
|
|
246
|
+
"default": "./run/index.js"
|
|
247
|
+
},
|
|
248
|
+
"./set": {
|
|
249
|
+
"browser": "./set/index.browser.js",
|
|
250
|
+
"default": "./set/index.js"
|
|
251
|
+
},
|
|
252
|
+
"./sleep": {
|
|
253
|
+
"browser": "./sleep/index.browser.js",
|
|
254
|
+
"default": "./sleep/index.js"
|
|
255
|
+
},
|
|
256
|
+
"./stream": {
|
|
257
|
+
"browser": "./stream/index.browser.js",
|
|
258
|
+
"default": "./stream/index.js"
|
|
259
|
+
},
|
|
260
|
+
"./string": {
|
|
261
|
+
"browser": "./string/index.browser.js",
|
|
262
|
+
"default": "./string/index.js"
|
|
263
|
+
},
|
|
264
|
+
"./tempfile": {
|
|
265
|
+
"browser": "./tempfile/index.browser.js",
|
|
266
|
+
"default": "./tempfile/index.js"
|
|
267
|
+
},
|
|
268
|
+
"./test": {
|
|
269
|
+
"browser": "./test/index.browser.js",
|
|
270
|
+
"default": "./test/index.js"
|
|
271
|
+
},
|
|
272
|
+
"./time": {
|
|
273
|
+
"browser": "./time/index.browser.js",
|
|
274
|
+
"default": "./time/index.js"
|
|
275
|
+
},
|
|
276
|
+
"./tuple": {
|
|
277
|
+
"browser": "./tuple/index.browser.js",
|
|
278
|
+
"default": "./tuple/index.js"
|
|
279
|
+
},
|
|
280
|
+
"./types": {
|
|
281
|
+
"browser": "./types/index.browser.js",
|
|
282
|
+
"default": "./types/index.js"
|
|
283
|
+
},
|
|
284
|
+
"./uri": {
|
|
285
|
+
"browser": "./uri/index.browser.js",
|
|
286
|
+
"default": "./uri/index.js"
|
|
287
|
+
},
|
|
288
|
+
"./uuid": {
|
|
289
|
+
"browser": "./uuid/index.browser.js",
|
|
290
|
+
"default": "./uuid/index.js"
|
|
291
|
+
},
|
|
292
|
+
"./package.json": "./package.json"
|
|
293
|
+
},
|
|
294
|
+
"scripts": {
|
|
295
|
+
"build": ":",
|
|
296
|
+
"clean": ":",
|
|
297
|
+
"exec": "$@",
|
|
298
|
+
"prepublishOnly": "pnpm clean && pnpm build && pnpm test",
|
|
299
|
+
"test": "pnpm run /^test:/",
|
|
300
|
+
"test:size": "size-limit",
|
|
301
|
+
"test:type": "check-dts",
|
|
302
|
+
"test:unit": "NODE_OPTIONS=--loader=esmock tsx node_modules/uvu/bin.js . '\\.test\\.(ts|js)$'",
|
|
303
|
+
"disable:test:coverage": "c8 pnpm test:unit"
|
|
304
|
+
},
|
|
305
|
+
"devDependencies": {
|
|
306
|
+
"@arethetypeswrong/cli": "^0.13.6",
|
|
307
|
+
"@ctx-core/preprocess": "^0.1.1",
|
|
308
|
+
"@size-limit/preset-small-lib": "^11.0.2",
|
|
309
|
+
"@types/jsdom": "^21.1.6",
|
|
310
|
+
"@types/node": "^20.11.16",
|
|
311
|
+
"@types/sinon": "^17.0.3",
|
|
312
|
+
"c8": "^9.1.0",
|
|
313
|
+
"check-dts": "^0.7.2",
|
|
314
|
+
"esbuild": "^0.20.0",
|
|
315
|
+
"esmock": "^2.6.3",
|
|
316
|
+
"jsdom": "^24.0.0",
|
|
317
|
+
"sinon": "^17.0.1",
|
|
318
|
+
"size-limit": "^11.0.2",
|
|
319
|
+
"tsx": "^4.7.0",
|
|
320
|
+
"typescript": "next",
|
|
321
|
+
"uvu": "^0.5.6"
|
|
322
|
+
},
|
|
323
|
+
"publishConfig": {
|
|
324
|
+
"access": "public",
|
|
325
|
+
"cache": "~/.npm"
|
|
326
|
+
},
|
|
327
|
+
"sideEffects": false,
|
|
328
|
+
"size-limit": [
|
|
329
|
+
{
|
|
330
|
+
"name": "ctx_",
|
|
331
|
+
"import": {
|
|
332
|
+
"./be": "{ ctx_ }"
|
|
333
|
+
},
|
|
334
|
+
"limit": "33 B"
|
|
335
|
+
},
|
|
336
|
+
{
|
|
337
|
+
"name": "ns_ctx_",
|
|
338
|
+
"import": {
|
|
339
|
+
"./be": "{ ns_ctx_ }"
|
|
340
|
+
},
|
|
341
|
+
"limit": "85 B"
|
|
342
|
+
},
|
|
343
|
+
{
|
|
344
|
+
"name": "be_",
|
|
345
|
+
"import": {
|
|
346
|
+
"./be": "{ be_ }"
|
|
347
|
+
},
|
|
348
|
+
"limit": "99 B"
|
|
349
|
+
},
|
|
350
|
+
{
|
|
351
|
+
"name": "be_ ctx_",
|
|
352
|
+
"import": {
|
|
353
|
+
"./be": "{ be_, ctx_ }"
|
|
354
|
+
},
|
|
355
|
+
"limit": "131 B"
|
|
356
|
+
},
|
|
357
|
+
{
|
|
358
|
+
"name": "be_ ns_ctx_",
|
|
359
|
+
"import": {
|
|
360
|
+
"./be": "{ be_, ctx_, ns_ctx_ }"
|
|
361
|
+
},
|
|
362
|
+
"limit": "191 B"
|
|
363
|
+
},
|
|
364
|
+
{
|
|
365
|
+
"name": "be_ ctx_ ns_ctx_",
|
|
366
|
+
"import": {
|
|
367
|
+
"./be": "{ be_, ctx_, ns_ctx_ }"
|
|
368
|
+
},
|
|
369
|
+
"limit": "191 B"
|
|
370
|
+
},
|
|
371
|
+
{
|
|
372
|
+
"name": "memo_",
|
|
373
|
+
"import": {
|
|
374
|
+
"./rmemo": "{ memo_ }"
|
|
375
|
+
},
|
|
376
|
+
"limit": "372 B"
|
|
377
|
+
},
|
|
378
|
+
{
|
|
379
|
+
"name": "memo_ sig_",
|
|
380
|
+
"import": {
|
|
381
|
+
"./rmemo": "{ sig_, memo_ }"
|
|
382
|
+
},
|
|
383
|
+
"limit": "391 B"
|
|
384
|
+
},
|
|
385
|
+
{
|
|
386
|
+
"name": "memo_ sig_ be_ ctx_",
|
|
387
|
+
"import": {
|
|
388
|
+
"./rmemo": "{ sig_, memo_, be_, ctx_ }"
|
|
389
|
+
},
|
|
390
|
+
"limit": "499 B"
|
|
391
|
+
},
|
|
392
|
+
{
|
|
393
|
+
"name": "memo_ sig_ be_ ctx_ be_memo_pair_ be_sig_triple_",
|
|
394
|
+
"import": {
|
|
395
|
+
"./rmemo": "{ sig_, memo_, be_, ctx_, be_memo_pair_, be_sig_triple_ }"
|
|
396
|
+
},
|
|
397
|
+
"limit": "589 B"
|
|
398
|
+
},
|
|
399
|
+
{
|
|
400
|
+
"name": "uuid",
|
|
401
|
+
"import": {
|
|
402
|
+
"./uuid": "{ uuid_ }"
|
|
403
|
+
},
|
|
404
|
+
"limit": "39 B"
|
|
405
|
+
},
|
|
406
|
+
{
|
|
407
|
+
"name": "short uuid",
|
|
408
|
+
"import": {
|
|
409
|
+
"./uuid": "{ short_uuid_ }"
|
|
410
|
+
},
|
|
411
|
+
"limit": "116 B"
|
|
412
|
+
}
|
|
413
|
+
]
|
|
414
|
+
}
|