ctx-core 4.10.1 → 4.11.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_/index.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { nullish } from '../nullish/index.js'
|
|
2
|
+
import type { TupleExclude } from '../tup/index.js'
|
|
2
3
|
export function nullish__none_<
|
|
3
|
-
T extends
|
|
4
|
+
T extends unknown[], U
|
|
4
5
|
>(
|
|
5
6
|
$:T,
|
|
6
|
-
_:(...$:T)=>U,
|
|
7
|
-
onnullish?:(nullish:nullish)=>
|
|
7
|
+
_:(...$:TupleExclude<T, nullish>)=>U,
|
|
8
|
+
onnullish?:(nullish:nullish)=>unknown
|
|
8
9
|
):U
|
|
9
10
|
export {
|
|
10
11
|
nullish__none_ as nullish__check_,
|
|
11
12
|
}
|
|
12
|
-
|
|
@@ -2,8 +2,8 @@ import { test } from 'uvu'
|
|
|
2
2
|
import { equal } from 'uvu/assert'
|
|
3
3
|
import { nullish__none_ } from '../nullish__none/index.js'
|
|
4
4
|
test('nullish__none_|-onnullish', ()=>{
|
|
5
|
-
const arg_aa:
|
|
6
|
-
const _ = (...arg_a:
|
|
5
|
+
const arg_aa:unknown[][] = []
|
|
6
|
+
const _ = (...arg_a:unknown[])=>{
|
|
7
7
|
arg_aa.push(arg_a)
|
|
8
8
|
return arg_a
|
|
9
9
|
}
|
|
@@ -24,13 +24,13 @@ test('nullish__none_|-onnullish', ()=>{
|
|
|
24
24
|
equal(arg_aa, [[zero], [str], [o]])
|
|
25
25
|
})
|
|
26
26
|
test('nullish__none_|+onnullish', ()=>{
|
|
27
|
-
const arg_aa:
|
|
28
|
-
const _ = (...arg_a:
|
|
27
|
+
const arg_aa:unknown[][] = []
|
|
28
|
+
const _ = (...arg_a:unknown[])=>{
|
|
29
29
|
arg_aa.push(arg_a)
|
|
30
30
|
return arg_a
|
|
31
31
|
}
|
|
32
|
-
const onnullish__arg_aa:
|
|
33
|
-
const onnullish = (...arg_a:
|
|
32
|
+
const onnullish__arg_aa:unknown[][] = []
|
|
33
|
+
const onnullish = (...arg_a:unknown[])=>{
|
|
34
34
|
onnullish__arg_aa.push(arg_a)
|
|
35
35
|
return 'foobar'
|
|
36
36
|
}
|
package/all/tup/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export declare function tup<
|
|
2
|
-
Args extends readonly
|
|
2
|
+
Args extends readonly unknown[]
|
|
3
3
|
>(...data:Args):Args
|
|
4
4
|
export declare type tup_T<
|
|
5
|
-
Args extends readonly
|
|
5
|
+
Args extends readonly unknown[]
|
|
6
6
|
> = (...data:Args)=>Args
|
|
7
7
|
export {
|
|
8
8
|
tup as tuple,
|
|
@@ -11,3 +11,10 @@ export {
|
|
|
11
11
|
tup as _tup,
|
|
12
12
|
tup as tup_fn,
|
|
13
13
|
}
|
|
14
|
+
export type TupleRest<T extends unknown[]> =
|
|
15
|
+
T['length'] extends 0 ? undefined :
|
|
16
|
+
(((...b: T) => void) extends (a, ...b: infer I) => void ? I : [])
|
|
17
|
+
export type TupleFirst<T extends unknown[]> =
|
|
18
|
+
T['length'] extends 0 ? undefined : T[0]
|
|
19
|
+
export type TupleExclude<T extends unknown[], E> =
|
|
20
|
+
[Exclude<TupleFirst<T>, E>, ...TupleExclude<TupleRest<T>, E>]
|
package/function/index.d.ts
CHANGED
|
@@ -84,6 +84,7 @@ export * from '../all/tick/index.js'
|
|
|
84
84
|
export * from '../all/Timeout/index.js'
|
|
85
85
|
export * from '../all/timeout_promise/index.js'
|
|
86
86
|
export * from '../all/times/index.js'
|
|
87
|
+
export * from '../all/tup/index.js'
|
|
87
88
|
export * from '../all/tuple__o/index.js'
|
|
88
89
|
export * from '../all/tuple_a_o/index.js'
|
|
89
90
|
export * from '../all/tuple__union/index.js'
|
package/function/index.js
CHANGED
|
@@ -84,6 +84,7 @@ export * from '../all/tick/index.js'
|
|
|
84
84
|
export * from '../all/Timeout/index.js'
|
|
85
85
|
export * from '../all/timeout_promise/index.js'
|
|
86
86
|
export * from '../all/times/index.js'
|
|
87
|
+
export * from '../all/tup/index.js'
|
|
87
88
|
export * from '../all/tuple__o/index.js'
|
|
88
89
|
export * from '../all/tuple_a_o/index.js'
|
|
89
90
|
export * from '../all/tuple__union/index.js'
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ctx-core",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.11.0",
|
|
4
4
|
"description": "ctx-core core library",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ctx-core",
|
|
@@ -106,14 +106,13 @@
|
|
|
106
106
|
},
|
|
107
107
|
"devDependencies": {
|
|
108
108
|
"@arethetypeswrong/cli": "^0.13.3",
|
|
109
|
-
"@size-limit/preset-small-lib": "^11.0.
|
|
110
|
-
"@types/node": "^20.10.
|
|
109
|
+
"@size-limit/preset-small-lib": "^11.0.1",
|
|
110
|
+
"@types/node": "^20.10.4",
|
|
111
111
|
"@types/sinon": "^17.0.2",
|
|
112
112
|
"c8": "^8.0.1",
|
|
113
113
|
"check-dts": "^0.7.2",
|
|
114
114
|
"sinon": "^17.0.1",
|
|
115
|
-
"size-limit": "^11.0.
|
|
116
|
-
"ts-node": "^10.9.1",
|
|
115
|
+
"size-limit": "^11.0.1",
|
|
117
116
|
"tsx": "^4.6.2",
|
|
118
117
|
"typescript": "next",
|
|
119
118
|
"uvu": "^0.5.6"
|