ctx-core 5.7.0 → 5.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.
- package/all/be_lock_memosig_triple/index.js +1 -1
- package/all/be_memo_pair/index.js +1 -1
- package/all/be_sig_triple/index.js +1 -1
- package/all/cancel/index.d.ts +8 -0
- package/all/cancel/index.js +6 -0
- package/all/cancel/index.test.ts +9 -0
- package/all/file_exists/index.d.ts +3 -2
- package/all/file_exists/index.js +11 -4
- package/all/file_exists/index.test.ts +18 -1
- package/all/index.d.ts +1 -0
- package/all/index.js +1 -0
- package/all/promise/index.d.ts +11 -2
- package/all/promise/index.js +1 -1
- package/all/promise_timeout/index.d.ts +2 -1
- package/all/promise_timeout/index.js +10 -4
- package/all/promise_timeout/index.test.ts +7 -0
- package/all/rmemo__wait/index.d.ts +7 -1
- package/all/rmemo__wait/index.js +6 -5
- package/all/rmemo__wait/index.test.ts +9 -0
- package/all/sleep/index.d.ts +3 -1
- package/all/sleep/index.js +3 -2
- package/all/waitfor/index.d.ts +11 -2
- package/all/waitfor/index.js +43 -13
- package/all/waitfor/index.test.ts +61 -0
- package/function/index.d.ts +1 -0
- package/function/index.js +1 -0
- package/package.json +239 -238
|
@@ -6,7 +6,7 @@ import { be_ } from '../be_/index.js'
|
|
|
6
6
|
import { lock_memosig_ } from '../rmemo/index.js'
|
|
7
7
|
/**
|
|
8
8
|
* @param {Be<sig_T>|be__val__new_T<unknown>}be_OR_val__new
|
|
9
|
-
* @param {
|
|
9
|
+
* @param {memo_subscriber_T[]|[...memo_subscriber_T[], be_config_T]}subscriber_a_THEN_config
|
|
10
10
|
* @returns {be_lock_memosig_triple_T}
|
|
11
11
|
* @private
|
|
12
12
|
*/
|
|
@@ -5,7 +5,7 @@ import { be_ } from '../be_/index.js'
|
|
|
5
5
|
import { memo_ } from '../rmemo/index.js'
|
|
6
6
|
/**
|
|
7
7
|
* @param {Be|be__val__new_T<unknown>}be_OR_val__new
|
|
8
|
-
* @param {
|
|
8
|
+
* @param {memo_subscriber_T[]|[...memo_subscriber_T[], be_config_T]}subscriber_a_THEN_config
|
|
9
9
|
* @returns {be_memo_pair_T}
|
|
10
10
|
* @private
|
|
11
11
|
*/
|
|
@@ -5,7 +5,7 @@ import { be_ } from '../be_/index.js'
|
|
|
5
5
|
import { sig_ } from '../rmemo/index.js'
|
|
6
6
|
/**
|
|
7
7
|
* @param {Be<sig_T>|be__val__new_T<unknown>}be_OR_val__new
|
|
8
|
-
* @param {
|
|
8
|
+
* @param {memo_subscriber_T[]|[...memo_subscriber_T[], be_config_T]}subscriber_a_THEN_config
|
|
9
9
|
* @returns {be_sig_triple_T}
|
|
10
10
|
* @private
|
|
11
11
|
*/
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { test } from 'uvu'
|
|
2
|
+
import { equal } from 'uvu/assert'
|
|
3
|
+
import { Cancel } from './index.js'
|
|
4
|
+
test('Cancel', ()=>{
|
|
5
|
+
equal(new Cancel().message, 'Cancel')
|
|
6
|
+
equal(new Cancel({ message: 'custom message' }).message, 'custom message')
|
|
7
|
+
equal(new Cancel({ returns: 1 }).returns, 1)
|
|
8
|
+
})
|
|
9
|
+
test.run()
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { waitfor_Promise } from '../waitfor/index.js'
|
|
1
2
|
export declare function file_exists_(path:string):Promise<boolean|undefined>
|
|
2
3
|
export {
|
|
3
4
|
file_exists_ as path__exists_
|
|
@@ -5,5 +6,5 @@ export {
|
|
|
5
6
|
export declare function file_exists__waitfor(
|
|
6
7
|
path:string,
|
|
7
8
|
timeout?:number,
|
|
8
|
-
period?:number
|
|
9
|
-
):
|
|
9
|
+
period?:number|((promise:waitfor_Promise<boolean>)=>Promise<number>)
|
|
10
|
+
):waitfor_Promise<boolean>
|
package/all/file_exists/index.js
CHANGED
|
@@ -19,9 +19,16 @@ export {
|
|
|
19
19
|
/**
|
|
20
20
|
* @param {string}path
|
|
21
21
|
* @param {number}[timeout]
|
|
22
|
-
* @param {number}[period]
|
|
23
|
-
* @returns {Promise<
|
|
22
|
+
* @param {number|((promise:waitfor_Promise<boolean>)=>Promise<number>)}[period]
|
|
23
|
+
* @returns {Promise<boolean>}
|
|
24
24
|
*/
|
|
25
|
-
export function file_exists__waitfor(
|
|
26
|
-
|
|
25
|
+
export function file_exists__waitfor(
|
|
26
|
+
path,
|
|
27
|
+
timeout,
|
|
28
|
+
period
|
|
29
|
+
) {
|
|
30
|
+
return waitfor(()=>
|
|
31
|
+
file_exists_(path),
|
|
32
|
+
timeout ?? 5000,
|
|
33
|
+
period ?? 0)
|
|
27
34
|
}
|
|
@@ -3,18 +3,35 @@ import { unlink, writeFile } from 'fs/promises'
|
|
|
3
3
|
import { test } from 'uvu'
|
|
4
4
|
import { equal } from 'uvu/assert'
|
|
5
5
|
import { tempfile_path_ } from '../tempfile_path/index.js'
|
|
6
|
+
import { waitfor_Promise } from '../waitfor/index.js'
|
|
6
7
|
import { file_exists_, file_exists__waitfor } from './index.js'
|
|
7
8
|
test('file_exists_ + file_exists__waitfor|server', async ()=>{
|
|
8
9
|
const tempfile_path = await tempfile_path_()
|
|
9
10
|
equal(await file_exists_(tempfile_path), false)
|
|
10
11
|
await writeFile(tempfile_path, 'test content')
|
|
11
12
|
try {
|
|
12
|
-
await file_exists__waitfor(tempfile_path)
|
|
13
|
+
equal(await file_exists__waitfor(tempfile_path), true)
|
|
13
14
|
equal(await file_exists_(tempfile_path), true)
|
|
14
15
|
} finally {
|
|
15
16
|
await unlink(tempfile_path)
|
|
16
17
|
}
|
|
17
18
|
})
|
|
19
|
+
test('file_exists__waitfor|server|cancel', async ()=>{
|
|
20
|
+
const tempfile_path = await tempfile_path_()
|
|
21
|
+
equal(await file_exists_(tempfile_path), false)
|
|
22
|
+
const promise= file_exists__waitfor(tempfile_path)
|
|
23
|
+
let rv:boolean|undefined = undefined
|
|
24
|
+
promise.then(_rv=>rv = _rv)
|
|
25
|
+
equal(rv, undefined)
|
|
26
|
+
equal(await promise.cancel(), false)
|
|
27
|
+
equal(await promise, false)
|
|
28
|
+
rv = undefined
|
|
29
|
+
const arg_promise= file_exists__waitfor(tempfile_path)
|
|
30
|
+
promise.then(_rv=>rv = _rv)
|
|
31
|
+
equal(rv, undefined)
|
|
32
|
+
equal(await arg_promise.cancel(true), true)
|
|
33
|
+
equal(await arg_promise, true)
|
|
34
|
+
})
|
|
18
35
|
test('file_exists_ + file_exists__waitfor|browser', async ()=>{
|
|
19
36
|
const { file_exists_, file_exists__waitfor } = await esmock('./index.js', {}, {
|
|
20
37
|
'../process_release_name/index.js': {
|
package/all/index.d.ts
CHANGED
|
@@ -70,6 +70,7 @@ export * from './call/index.js'
|
|
|
70
70
|
export * from './call_assign/index.js'
|
|
71
71
|
export * from './call_fn_a/index.js'
|
|
72
72
|
export * from './call_or_fn/index.js'
|
|
73
|
+
export * from './cancel/index.js'
|
|
73
74
|
export * from './chain/index.js'
|
|
74
75
|
export * from './chunk_aa/index.js'
|
|
75
76
|
export * from './circular_idx/index.js'
|
package/all/index.js
CHANGED
|
@@ -70,6 +70,7 @@ export * from './call/index.js'
|
|
|
70
70
|
export * from './call_assign/index.js'
|
|
71
71
|
export * from './call_fn_a/index.js'
|
|
72
72
|
export * from './call_or_fn/index.js'
|
|
73
|
+
export * from './cancel/index.js'
|
|
73
74
|
export * from './chain/index.js'
|
|
74
75
|
export * from './chunk_aa/index.js'
|
|
75
76
|
export * from './circular_idx/index.js'
|
package/all/promise/index.d.ts
CHANGED
|
@@ -1,2 +1,11 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
1
|
+
export type promise_resolve_T<T> = (value:T|PromiseLike<T>)=>void
|
|
2
|
+
export type promise_reject_T = (reason?:unknown)=>void
|
|
3
|
+
export type cancel_Promise<
|
|
4
|
+
V,
|
|
5
|
+
cancel_fn_T extends (
|
|
6
|
+
|(()=>Promise<V>)
|
|
7
|
+
|((val:V)=>Promise<V>)
|
|
8
|
+
)
|
|
9
|
+
> =
|
|
10
|
+
&Promise<V>
|
|
11
|
+
&{ cancel:cancel_fn_T }
|
package/all/promise/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {}
|
|
1
|
+
export {}
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* @param {(()=>Promise<unknown>)|Promise<unknown>}promise
|
|
3
3
|
* @param {number}ms
|
|
4
4
|
* @param {Error}[error]
|
|
5
|
-
* @returns {
|
|
5
|
+
* @returns {cancel_Promise}
|
|
6
6
|
*/
|
|
7
|
-
export
|
|
7
|
+
export function promise_timeout(
|
|
8
8
|
promise,
|
|
9
9
|
ms,
|
|
10
10
|
error
|
|
@@ -14,11 +14,17 @@ export async function promise_timeout(
|
|
|
14
14
|
let timeout = new Promise((_resolve, reject)=>{
|
|
15
15
|
id = setTimeout(()=>reject(error), ms)
|
|
16
16
|
})
|
|
17
|
-
|
|
17
|
+
let cancel_promise__resolve
|
|
18
|
+
let cancel_promise = new Promise(resolve=>cancel_promise__resolve = resolve)
|
|
19
|
+
/** @type {cancel_Promise} */
|
|
20
|
+
let ret_promise = Promise.race([
|
|
18
21
|
typeof promise === 'function' ? promise() : promise,
|
|
19
|
-
timeout
|
|
22
|
+
timeout,
|
|
23
|
+
cancel_promise,
|
|
20
24
|
]).then(result=>{
|
|
21
25
|
clearTimeout(id)
|
|
22
26
|
return result
|
|
23
27
|
})
|
|
28
|
+
ret_promise.cancel = cancel_promise__resolve
|
|
29
|
+
return ret_promise
|
|
24
30
|
}
|
|
@@ -29,4 +29,11 @@ test('promise_timeout|timeout', async ()=>{
|
|
|
29
29
|
equal(count, 1)
|
|
30
30
|
equal(err?.message, 'Timeout 1ms')
|
|
31
31
|
})
|
|
32
|
+
test('promise_timeout|cancel|arg', async ()=>{
|
|
33
|
+
const promise = promise_timeout(
|
|
34
|
+
new Promise<number>(()=>{}),
|
|
35
|
+
1000)
|
|
36
|
+
promise.cancel(5)
|
|
37
|
+
equal(await promise, 5)
|
|
38
|
+
})
|
|
32
39
|
test.run()
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { cancel_Promise } from '../promise/index.js'
|
|
1
2
|
import type { memo_T, rmemo_T, rmemo_val_T } from '../rmemo/index.js'
|
|
2
3
|
export declare function rmemo__wait<
|
|
3
4
|
_rmemo_T extends rmemo_T<unknown> = rmemo_T<unknown>
|
|
@@ -6,7 +7,12 @@ export declare function rmemo__wait<
|
|
|
6
7
|
condition_fn:(val:rmemo_val_T<_rmemo_T>)=>unknown,
|
|
7
8
|
timeout?:number,
|
|
8
9
|
error?:Error
|
|
9
|
-
):
|
|
10
|
+
):rmemo__wait_ret_T<rmemo_val_T<_rmemo_T>>
|
|
11
|
+
export type rmemo__wait_ret_T<R> =
|
|
12
|
+
cancel_Promise<
|
|
13
|
+
R,
|
|
14
|
+
(val?:R)=>Promise<R>
|
|
15
|
+
>&{
|
|
10
16
|
// prevent early usGC
|
|
11
17
|
m:memo_T<unknown>
|
|
12
18
|
}
|
package/all/rmemo__wait/index.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
/// <reference types="../rmemo/index.d.ts" />
|
|
2
2
|
/// <reference types="./index.d.ts" />
|
|
3
|
-
import { isNumber_ } from '../isNumber/index.js'
|
|
4
3
|
import { promise_timeout } from '../promise_timeout/index.js'
|
|
5
4
|
import { memo_ } from '../rmemo/index.js'
|
|
6
5
|
/**
|
|
@@ -8,7 +7,7 @@ import { memo_ } from '../rmemo/index.js'
|
|
|
8
7
|
* @param {(val:unknown)=>unknown}condition_fn
|
|
9
8
|
* @param {number}[timeout]
|
|
10
9
|
* @param {Error}[error]
|
|
11
|
-
* @returns {
|
|
10
|
+
* @returns {cancel_Promise&{ m:memo_T<unknown> }}
|
|
12
11
|
*/
|
|
13
12
|
export function rmemo__wait(
|
|
14
13
|
rmemo,
|
|
@@ -25,10 +24,12 @@ export function rmemo__wait(
|
|
|
25
24
|
})
|
|
26
25
|
memo()
|
|
27
26
|
})
|
|
27
|
+
/** @type {cancel_Promise&{ m:memo_T<unknown> }} */
|
|
28
28
|
let promise =
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
promise_timeout(
|
|
30
|
+
_subscribe_wait,
|
|
31
|
+
timeout ?? Infinity,
|
|
32
|
+
error)
|
|
32
33
|
// prevent GC
|
|
33
34
|
promise.m = memo
|
|
34
35
|
return promise
|
|
@@ -15,4 +15,13 @@ test('rmemo__wait', async ()=>{
|
|
|
15
15
|
await promise
|
|
16
16
|
equal(subject$(), 1)
|
|
17
17
|
})
|
|
18
|
+
test('rmemo__wait|cancel', async ()=>{
|
|
19
|
+
const subject$ = sig_(-1)
|
|
20
|
+
const promise = rmemo__wait(
|
|
21
|
+
subject$,
|
|
22
|
+
subject=>subject >= 0,
|
|
23
|
+
10_000)
|
|
24
|
+
promise.cancel(500)
|
|
25
|
+
equal(await promise, 500)
|
|
26
|
+
})
|
|
18
27
|
test.run()
|
package/all/sleep/index.d.ts
CHANGED
package/all/sleep/index.js
CHANGED
package/all/waitfor/index.d.ts
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
|
+
import type { cancel_Promise } from '../promise/index.js'
|
|
1
2
|
export declare function waitfor<V>(
|
|
2
3
|
fn:()=>Promise<V>|V,
|
|
3
4
|
timeout:number,
|
|
4
|
-
period?:number
|
|
5
|
-
):
|
|
5
|
+
period?:number|((promise:waitfor_Promise<V>)=>Promise<number>)
|
|
6
|
+
):waitfor_Promise<V>
|
|
7
|
+
export declare function cancel__period_<V>(
|
|
8
|
+
ms:number,
|
|
9
|
+
should_cancel_:()=>boolean
|
|
10
|
+
):(
|
|
11
|
+
promise:waitfor_Promise<V>
|
|
12
|
+
)=>Promise<number>
|
|
13
|
+
export type waitfor_Promise<V> =
|
|
14
|
+
cancel_Promise<V, (val?:V)=>Promise<V>>
|
package/all/waitfor/index.js
CHANGED
|
@@ -1,31 +1,61 @@
|
|
|
1
|
+
import { Cancel } from '../cancel/index.js'
|
|
1
2
|
import { promise_timeout } from '../promise_timeout/index.js'
|
|
2
3
|
import { sleep } from '../sleep/index.js'
|
|
3
4
|
/**
|
|
4
5
|
* @param {()=>Promise<unknown>}fn
|
|
5
|
-
* @param {
|
|
6
|
-
* @param {unknown}[period]
|
|
7
|
-
* @returns {Promise<
|
|
6
|
+
* @param {number}timeout
|
|
7
|
+
* @param {number|(()=>Promise<unknown>)}[period]
|
|
8
|
+
* @returns {Promise<unknown>}
|
|
8
9
|
*/
|
|
9
|
-
export function waitfor(
|
|
10
|
-
|
|
10
|
+
export function waitfor(
|
|
11
|
+
fn,
|
|
12
|
+
timeout,
|
|
13
|
+
period
|
|
14
|
+
) {
|
|
15
|
+
let rv
|
|
16
|
+
let cancel_arg_a
|
|
11
17
|
let promise = new Promise((resolve, reject)=>
|
|
12
18
|
promise_timeout(async ()=>{
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
rv =
|
|
16
|
-
if (rv) return rv
|
|
17
|
-
|
|
19
|
+
for (; !cancel_arg_a;) {
|
|
20
|
+
let _rv = await fn()
|
|
21
|
+
rv = cancel_arg_a?.length ? cancel_arg_a[0] : _rv
|
|
22
|
+
if (rv || cancel_arg_a) return rv
|
|
23
|
+
if (typeof period === 'function') {
|
|
24
|
+
await period(promise)
|
|
25
|
+
} else {
|
|
26
|
+
await sleep(period ?? 0)
|
|
27
|
+
}
|
|
18
28
|
}
|
|
19
29
|
return rv
|
|
20
30
|
}, timeout)
|
|
21
31
|
.then(resolve)
|
|
22
32
|
.catch(err=>{
|
|
23
|
-
|
|
33
|
+
cancel_arg_a = []
|
|
24
34
|
reject(err)
|
|
25
35
|
}))
|
|
26
|
-
promise.cancel = ()=>{
|
|
27
|
-
|
|
36
|
+
promise.cancel = (...arg_a)=>{
|
|
37
|
+
cancel_arg_a = arg_a
|
|
28
38
|
return promise
|
|
29
39
|
}
|
|
30
40
|
return promise
|
|
31
41
|
}
|
|
42
|
+
/**
|
|
43
|
+
* @param {number}ms
|
|
44
|
+
* @param {()=>boolean}should_cancel_
|
|
45
|
+
* @param {Cancel_config_T}[Cancel_config]
|
|
46
|
+
* @returns {(promise:Promise<unknown>&{cancel():unknown})=>Promise<number>}
|
|
47
|
+
* @private
|
|
48
|
+
*/
|
|
49
|
+
export function cancel__period_(
|
|
50
|
+
ms,
|
|
51
|
+
should_cancel_,
|
|
52
|
+
Cancel_config
|
|
53
|
+
) {
|
|
54
|
+
return promise=>{
|
|
55
|
+
if (should_cancel_()) {
|
|
56
|
+
promise.cancel()
|
|
57
|
+
throw new Cancel(Cancel_config)
|
|
58
|
+
}
|
|
59
|
+
return sleep(ms)
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { test } from 'uvu'
|
|
2
2
|
import { equal } from 'uvu/assert'
|
|
3
|
+
import { sleep } from '../sleep/index.js'
|
|
3
4
|
import { waitfor } from './index.js'
|
|
4
5
|
test('waitfor|success', async ()=>{
|
|
5
6
|
let count = 0
|
|
@@ -45,5 +46,65 @@ test('waitfor|cancel', async ()=>{
|
|
|
45
46
|
equal(count, 1)
|
|
46
47
|
equal(await promise, false)
|
|
47
48
|
equal(count, 1)
|
|
49
|
+
count = 0
|
|
50
|
+
const undefinable_promise = waitfor<boolean|undefined>(()=>{
|
|
51
|
+
count++
|
|
52
|
+
return false
|
|
53
|
+
}, 10)
|
|
54
|
+
equal(count, 1)
|
|
55
|
+
equal(await undefinable_promise.cancel(undefined), undefined)
|
|
56
|
+
equal(count, 1)
|
|
57
|
+
equal(await undefinable_promise, undefined)
|
|
58
|
+
equal(count, 1)
|
|
59
|
+
})
|
|
60
|
+
test('waitfor|period|number', async ()=>{
|
|
61
|
+
let count = 0
|
|
62
|
+
let ret = false
|
|
63
|
+
const promise = waitfor(()=>{
|
|
64
|
+
count++
|
|
65
|
+
return ret
|
|
66
|
+
}, 10, 2)
|
|
67
|
+
try {
|
|
68
|
+
equal(count, 1)
|
|
69
|
+
await sleep(2)
|
|
70
|
+
await sleep(0)
|
|
71
|
+
equal(count, 2)
|
|
72
|
+
await sleep(2)
|
|
73
|
+
equal(count, 3)
|
|
74
|
+
ret = true
|
|
75
|
+
equal(await promise, true)
|
|
76
|
+
equal(count, 4)
|
|
77
|
+
} finally {
|
|
78
|
+
await promise.cancel()
|
|
79
|
+
}
|
|
80
|
+
})
|
|
81
|
+
test('waitfor|period|async function', async ()=>{
|
|
82
|
+
let count = 0
|
|
83
|
+
let ret = false
|
|
84
|
+
const period_arg_aa:Promise<boolean>[][] = []
|
|
85
|
+
const promise = waitfor(()=>{
|
|
86
|
+
count++
|
|
87
|
+
return ret
|
|
88
|
+
}, 10, (...arg_a)=>{
|
|
89
|
+
period_arg_aa.push(arg_a)
|
|
90
|
+
return sleep(2)
|
|
91
|
+
})
|
|
92
|
+
try {
|
|
93
|
+
equal(count, 1)
|
|
94
|
+
await sleep(0)
|
|
95
|
+
equal(period_arg_aa, [[promise]])
|
|
96
|
+
await sleep(2)
|
|
97
|
+
equal(count, 2)
|
|
98
|
+
equal(period_arg_aa, [[promise], [promise]])
|
|
99
|
+
await sleep(2)
|
|
100
|
+
equal(count, 3)
|
|
101
|
+
equal(period_arg_aa, [[promise], [promise], [promise]])
|
|
102
|
+
ret = true
|
|
103
|
+
equal(await promise, true)
|
|
104
|
+
equal(count, 4)
|
|
105
|
+
equal(period_arg_aa, [[promise], [promise], [promise]])
|
|
106
|
+
} finally {
|
|
107
|
+
await promise.cancel()
|
|
108
|
+
}
|
|
48
109
|
})
|
|
49
110
|
test.run()
|
package/function/index.d.ts
CHANGED
|
@@ -17,6 +17,7 @@ export * from '../all/bind_map_call/index.js'
|
|
|
17
17
|
export * from '../all/call/index.js'
|
|
18
18
|
export * from '../all/call_fn_a/index.js'
|
|
19
19
|
export * from '../all/call_or_fn/index.js'
|
|
20
|
+
export * from '../all/cancel/index.js'
|
|
20
21
|
export * from '../all/compose/index.js'
|
|
21
22
|
export * from '../all/concat/index.js'
|
|
22
23
|
export * from '../all/debounce/index.js'
|
package/function/index.js
CHANGED
|
@@ -17,6 +17,7 @@ export * from '../all/bind_map_call/index.js'
|
|
|
17
17
|
export * from '../all/call/index.js'
|
|
18
18
|
export * from '../all/call_fn_a/index.js'
|
|
19
19
|
export * from '../all/call_or_fn/index.js'
|
|
20
|
+
export * from '../all/cancel/index.js'
|
|
20
21
|
export * from '../all/compose/index.js'
|
|
21
22
|
export * from '../all/concat/index.js'
|
|
22
23
|
export * from '../all/debounce/index.js'
|
package/package.json
CHANGED
|
@@ -1,240 +1,241 @@
|
|
|
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
|
-
|
|
2
|
+
"name": "ctx-core",
|
|
3
|
+
"version": "5.9.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
|
+
"env",
|
|
47
|
+
"error",
|
|
48
|
+
"fetch",
|
|
49
|
+
"fibonacci",
|
|
50
|
+
"fs",
|
|
51
|
+
"function",
|
|
52
|
+
"functional",
|
|
53
|
+
"html",
|
|
54
|
+
"http",
|
|
55
|
+
"math",
|
|
56
|
+
"matrix",
|
|
57
|
+
"number",
|
|
58
|
+
"object",
|
|
59
|
+
"queue",
|
|
60
|
+
"random",
|
|
61
|
+
"regex",
|
|
62
|
+
"rmemo",
|
|
63
|
+
"set",
|
|
64
|
+
"sleep",
|
|
65
|
+
"string",
|
|
66
|
+
"tempfile",
|
|
67
|
+
"test",
|
|
68
|
+
"time",
|
|
69
|
+
"types",
|
|
70
|
+
"uri",
|
|
71
|
+
"uuid",
|
|
72
|
+
"package.json"
|
|
73
|
+
],
|
|
74
|
+
"types": "./src/index.d.ts",
|
|
75
|
+
"exports": {
|
|
76
|
+
".": "./index.js",
|
|
77
|
+
"./all": "./all/index.js",
|
|
78
|
+
"./array": "./array/index.js",
|
|
79
|
+
"./atob": "./atob/index.js",
|
|
80
|
+
"./base16": "./base16/index.js",
|
|
81
|
+
"./be": "./be/index.js",
|
|
82
|
+
"./btoa": "./btoa/index.js",
|
|
83
|
+
"./buffer": "./buffer/index.js",
|
|
84
|
+
"./chain": "./chain/index.js",
|
|
85
|
+
"./class": "./class/index.js",
|
|
86
|
+
"./cli-args": "./cli-args/index.js",
|
|
87
|
+
"./color": "./color/index.js",
|
|
88
|
+
"./combinators": "./combinators/index.js",
|
|
89
|
+
"./crypto": "./crypto/index.js",
|
|
90
|
+
"./currency": "./currency/index.js",
|
|
91
|
+
"./data": "./data/index.js",
|
|
92
|
+
"./date": "./date/index.js",
|
|
93
|
+
"./debounce": "./debounce/index.js",
|
|
94
|
+
"./deep_equal": "./deep_equal/index.js",
|
|
95
|
+
"./env": "./env/index.js",
|
|
96
|
+
"./error": "./error/index.js",
|
|
97
|
+
"./fetch": "./fetch/index.js",
|
|
98
|
+
"./fibonacci": "./fibonacci/index.js",
|
|
99
|
+
"./fs": "./fs/index.js",
|
|
100
|
+
"./function": "./function/index.js",
|
|
101
|
+
"./functional": "./functional/index.js",
|
|
102
|
+
"./html": "./html/index.js",
|
|
103
|
+
"./http": "./http/index.js",
|
|
104
|
+
"./math": "./math/index.js",
|
|
105
|
+
"./matrix": "./matrix/index.js",
|
|
106
|
+
"./number": "./number/index.js",
|
|
107
|
+
"./object": "./object/index.js",
|
|
108
|
+
"./queue": "./queue/index.js",
|
|
109
|
+
"./random": "./random/index.js",
|
|
110
|
+
"./regex": "./regex/index.js",
|
|
111
|
+
"./rmemo": "./rmemo/index.js",
|
|
112
|
+
"./set": "./set/index.js",
|
|
113
|
+
"./sleep": "./sleep/index.js",
|
|
114
|
+
"./string": "./string/index.js",
|
|
115
|
+
"./tempfile": "./tempfile/index.js",
|
|
116
|
+
"./test": "./test/index.js",
|
|
117
|
+
"./time": "./time/index.js",
|
|
118
|
+
"./types": "./types/index.js",
|
|
119
|
+
"./uri": "./uri/index.js",
|
|
120
|
+
"./uuid": "./uuid/index.js",
|
|
121
|
+
"./package.json": "./package.json"
|
|
122
|
+
},
|
|
123
|
+
"scripts": {
|
|
124
|
+
"build": ":",
|
|
125
|
+
"clean": ":",
|
|
126
|
+
"exec": "$@",
|
|
127
|
+
"prepublishOnly": "pnpm clean && pnpm build && pnpm test",
|
|
128
|
+
"test": "pnpm run /^test:/",
|
|
129
|
+
"test:size": "size-limit",
|
|
130
|
+
"test:type": "check-dts",
|
|
131
|
+
"test:unit": "NODE_OPTIONS=--loader=esmock tsx node_modules/uvu/bin.js . '\\.test\\.(ts|js)$'",
|
|
132
|
+
"disable:test:coverage": "c8 pnpm test:unit"
|
|
133
|
+
},
|
|
134
|
+
"devDependencies": {
|
|
135
|
+
"@arethetypeswrong/cli": "^0.13.5",
|
|
136
|
+
"@ctx-core/preprocess": "^0.1.0",
|
|
137
|
+
"@size-limit/preset-small-lib": "^11.0.1",
|
|
138
|
+
"@types/node": "^20.10.6",
|
|
139
|
+
"@types/sinon": "^17.0.2",
|
|
140
|
+
"c8": "^8.0.1",
|
|
141
|
+
"check-dts": "^0.7.2",
|
|
142
|
+
"esbuild": "^0.19.11",
|
|
143
|
+
"esmock": "^2.6.0",
|
|
144
|
+
"sinon": "^17.0.1",
|
|
145
|
+
"size-limit": "^11.0.1",
|
|
146
|
+
"tsx": "^4.7.0",
|
|
147
|
+
"typescript": "next",
|
|
148
|
+
"uvu": "^0.5.6"
|
|
149
|
+
},
|
|
150
|
+
"publishConfig": {
|
|
151
|
+
"access": "public",
|
|
152
|
+
"cache": "~/.npm"
|
|
153
|
+
},
|
|
154
|
+
"sideEffects": false,
|
|
155
|
+
"size-limit": [
|
|
156
|
+
{
|
|
157
|
+
"name": "ctx_",
|
|
158
|
+
"import": {
|
|
159
|
+
"./be": "{ ctx_ }"
|
|
160
|
+
},
|
|
161
|
+
"limit": "33 B"
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
"name": "ns_ctx_",
|
|
165
|
+
"import": {
|
|
166
|
+
"./be": "{ ns_ctx_ }"
|
|
167
|
+
},
|
|
168
|
+
"limit": "85 B"
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
"name": "be_",
|
|
172
|
+
"import": {
|
|
173
|
+
"./be": "{ be_ }"
|
|
174
|
+
},
|
|
175
|
+
"limit": "99 B"
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
"name": "be_ ctx_",
|
|
179
|
+
"import": {
|
|
180
|
+
"./be": "{ be_, ctx_ }"
|
|
181
|
+
},
|
|
182
|
+
"limit": "131 B"
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
"name": "be_ ns_ctx_",
|
|
186
|
+
"import": {
|
|
187
|
+
"./be": "{ be_, ctx_, ns_ctx_ }"
|
|
188
|
+
},
|
|
189
|
+
"limit": "190 B"
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
"name": "be_ ctx_ ns_ctx_",
|
|
193
|
+
"import": {
|
|
194
|
+
"./be": "{ be_, ctx_, ns_ctx_ }"
|
|
195
|
+
},
|
|
196
|
+
"limit": "190 B"
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
"name": "memo_",
|
|
200
|
+
"import": {
|
|
201
|
+
"./rmemo": "{ memo_ }"
|
|
202
|
+
},
|
|
203
|
+
"limit": "336 B"
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
"name": "memo_ sig_",
|
|
207
|
+
"import": {
|
|
208
|
+
"./rmemo": "{ sig_, memo_ }"
|
|
209
|
+
},
|
|
210
|
+
"limit": "352 B"
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
"name": "memo_ sig_ be_ ctx_",
|
|
214
|
+
"import": {
|
|
215
|
+
"./rmemo": "{ sig_, memo_, be_, ctx_ }"
|
|
216
|
+
},
|
|
217
|
+
"limit": "458 B"
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
"name": "memo_ sig_ be_ ctx_ be_memo_pair_ be_sig_triple_",
|
|
221
|
+
"import": {
|
|
222
|
+
"./rmemo": "{ sig_, memo_, be_, ctx_, be_memo_pair_, be_sig_triple_ }"
|
|
223
|
+
},
|
|
224
|
+
"limit": "552 B"
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
"name": "uuid",
|
|
228
|
+
"import": {
|
|
229
|
+
"./uuid": "{ uuid_ }"
|
|
230
|
+
},
|
|
231
|
+
"limit": "39 B"
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
"name": "short uuid",
|
|
235
|
+
"import": {
|
|
236
|
+
"./uuid": "{ short_uuid_ }"
|
|
237
|
+
},
|
|
238
|
+
"limit": "116 B"
|
|
239
|
+
}
|
|
240
|
+
]
|
|
240
241
|
}
|