@idlebox/common 1.4.1 → 1.4.3
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/lib/cjs/array/arrayUnique.cjs +2 -4
- package/lib/cjs/array/arrayUnique.cjs.map +1 -1
- package/lib/cjs/array/normalizeArray.cjs +2 -4
- package/lib/cjs/array/normalizeArray.cjs.map +1 -1
- package/lib/cjs/array/sortAlpha.cjs +2 -4
- package/lib/cjs/array/sortAlpha.cjs.map +1 -1
- package/lib/cjs/date/isInvalid.cjs +1 -1
- package/lib/cjs/date/isInvalid.cjs.map +1 -1
- package/lib/cjs/date/timeString.cjs +8 -10
- package/lib/cjs/date/timeString.cjs.map +1 -1
- package/lib/cjs/debugging/serializable.cjs +2 -2
- package/lib/cjs/debugging/serializable.cjs.map +1 -1
- package/lib/cjs/debugging/tryInspect.cjs +7 -9
- package/lib/cjs/debugging/tryInspect.cjs.map +1 -1
- package/lib/cjs/error/convertUnknown.cjs +2 -4
- package/lib/cjs/error/convertUnknown.cjs.map +1 -1
- package/lib/cjs/error/getFrame.cjs +2 -2
- package/lib/cjs/error/getFrame.cjs.map +1 -1
- package/lib/cjs/error/known.cjs.map +1 -1
- package/lib/cjs/error/pretty.cjs +22 -30
- package/lib/cjs/error/pretty.cjs.map +1 -1
- package/lib/cjs/function/asyncCallbackList.cjs.map +1 -1
- package/lib/cjs/function/callbackList.cjs.map +1 -1
- package/lib/cjs/function/delayCallbackList.cjs +3 -3
- package/lib/cjs/function/delayCallbackList.cjs.map +1 -1
- package/lib/cjs/lifecycle/dispose/disposableEvent.cjs +1 -3
- package/lib/cjs/lifecycle/dispose/disposableEvent.cjs.map +1 -1
- package/lib/cjs/lifecycle/dispose/lifecycle.async.cjs.map +1 -1
- package/lib/cjs/lifecycle/dispose/lifecycle.global.cjs +4 -8
- package/lib/cjs/lifecycle/dispose/lifecycle.global.cjs.map +1 -1
- package/lib/cjs/lifecycle/dispose/lifecycle.sync.cjs +1 -1
- package/lib/cjs/lifecycle/dispose/lifecycle.sync.cjs.map +1 -1
- package/lib/cjs/lifecycle/event/event.cjs +61 -6
- package/lib/cjs/lifecycle/event/event.cjs.map +1 -1
- package/lib/cjs/lifecycle/event/memorized.cjs +1 -1
- package/lib/cjs/lifecycle/event/memorized.cjs.map +1 -1
- package/lib/cjs/lifecycle/promise/cancellationToken/driver.common.cjs.map +1 -1
- package/lib/cjs/lifecycle/promise/deferredPromise.cjs +2 -2
- package/lib/cjs/lifecycle/promise/deferredPromise.cjs.map +1 -1
- package/lib/cjs/lifecycle/timeout/timeout.cjs +1 -3
- package/lib/cjs/lifecycle/timeout/timeout.cjs.map +1 -1
- package/lib/cjs/lifecycle/timeout/timeoutError.cjs.map +1 -1
- package/lib/cjs/log/logger.cjs +4 -6
- package/lib/cjs/log/logger.cjs.map +1 -1
- package/lib/cjs/mapSet/customSet.cjs +3 -7
- package/lib/cjs/mapSet/customSet.cjs.map +1 -1
- package/lib/cjs/mapSet/extendMap.cjs +5 -9
- package/lib/cjs/mapSet/extendMap.cjs.map +1 -1
- package/lib/cjs/misc/assertNotNull.cjs +1 -3
- package/lib/cjs/misc/assertNotNull.cjs.map +1 -1
- package/lib/cjs/misc/package.json.cjs +1 -1
- package/lib/cjs/misc/package.json.cjs.map +1 -1
- package/lib/cjs/object/initOnRead.cjs.map +1 -1
- package/lib/cjs/object/objectSame.cjs +2 -1
- package/lib/cjs/object/objectSame.cjs.map +1 -1
- package/lib/cjs/path/normalizePath.cjs +7 -9
- package/lib/cjs/path/normalizePath.cjs.map +1 -1
- package/lib/cjs/path/pathArray.cjs +1 -1
- package/lib/cjs/path/pathArray.cjs.map +1 -1
- package/lib/cjs/platform/globalSingleton.cjs +1 -1
- package/lib/cjs/platform/globalSymbol.cjs +6 -8
- package/lib/cjs/platform/globalSymbol.cjs.map +1 -1
- package/lib/cjs/promise/promiseCollection.cjs +3 -3
- package/lib/cjs/promise/promiseCollection.cjs.map +1 -1
- package/lib/cjs/reflection/classes/singleton.cjs +1 -3
- package/lib/cjs/reflection/classes/singleton.cjs.map +1 -1
- package/lib/cjs/reflection/methods/bind.cjs +1 -3
- package/lib/cjs/reflection/methods/bind.cjs.map +1 -1
- package/lib/cjs/reflection/methods/initOnRead.cjs +2 -2
- package/lib/cjs/reflection/methods/initOnRead.cjs.map +1 -1
- package/lib/cjs/string/castCase.cjs +5 -5
- package/lib/cjs/string/castCase.cjs.map +1 -1
- package/lib/cjs/string/pad2.cjs +2 -4
- package/lib/cjs/string/pad2.cjs.map +1 -1
- package/lib/cjs/string/sizeString.cjs +23 -27
- package/lib/cjs/string/sizeString.cjs.map +1 -1
- package/lib/esm/array/arrayUnique.d.ts +1 -3
- package/lib/esm/array/arrayUnique.d.ts.map +1 -1
- package/lib/esm/array/arrayUnique.js +2 -4
- package/lib/esm/array/arrayUnique.js.map +1 -1
- package/lib/esm/array/normalizeArray.js +2 -4
- package/lib/esm/array/normalizeArray.js.map +1 -1
- package/lib/esm/array/sortAlpha.js +2 -4
- package/lib/esm/array/sortAlpha.js.map +1 -1
- package/lib/esm/date/isInvalid.js +1 -1
- package/lib/esm/date/isInvalid.js.map +1 -1
- package/lib/esm/date/timeString.d.ts +1 -3
- package/lib/esm/date/timeString.d.ts.map +1 -1
- package/lib/esm/date/timeString.js +8 -10
- package/lib/esm/date/timeString.js.map +1 -1
- package/lib/esm/debugging/serializable.d.ts +1 -1
- package/lib/esm/debugging/serializable.d.ts.map +1 -1
- package/lib/esm/debugging/serializable.js +2 -2
- package/lib/esm/debugging/serializable.js.map +1 -1
- package/lib/esm/debugging/tryInspect.d.ts.map +1 -1
- package/lib/esm/debugging/tryInspect.js +7 -9
- package/lib/esm/debugging/tryInspect.js.map +1 -1
- package/lib/esm/error/convertUnknown.d.ts.map +1 -1
- package/lib/esm/error/convertUnknown.js +2 -4
- package/lib/esm/error/convertUnknown.js.map +1 -1
- package/lib/esm/error/getFrame.js +2 -2
- package/lib/esm/error/getFrame.js.map +1 -1
- package/lib/esm/error/known.d.ts.map +1 -1
- package/lib/esm/error/known.js.map +1 -1
- package/lib/esm/error/pretty.d.ts.map +1 -1
- package/lib/esm/error/pretty.js +22 -30
- package/lib/esm/error/pretty.js.map +1 -1
- package/lib/esm/function/asyncCallbackList.d.ts +1 -1
- package/lib/esm/function/asyncCallbackList.d.ts.map +1 -1
- package/lib/esm/function/asyncCallbackList.js.map +1 -1
- package/lib/esm/function/callbackList.d.ts.map +1 -1
- package/lib/esm/function/callbackList.js.map +1 -1
- package/lib/esm/function/delayCallbackList.d.ts.map +1 -1
- package/lib/esm/function/delayCallbackList.js +3 -3
- package/lib/esm/function/delayCallbackList.js.map +1 -1
- package/lib/esm/lifecycle/dispose/disposableEvent.d.ts +1 -1
- package/lib/esm/lifecycle/dispose/disposableEvent.d.ts.map +1 -1
- package/lib/esm/lifecycle/dispose/disposableEvent.js +1 -3
- package/lib/esm/lifecycle/dispose/disposableEvent.js.map +1 -1
- package/lib/esm/lifecycle/dispose/lifecycle.async.d.ts +2 -2
- package/lib/esm/lifecycle/dispose/lifecycle.async.d.ts.map +1 -1
- package/lib/esm/lifecycle/dispose/lifecycle.async.js.map +1 -1
- package/lib/esm/lifecycle/dispose/lifecycle.d.ts +1 -1
- package/lib/esm/lifecycle/dispose/lifecycle.d.ts.map +1 -1
- package/lib/esm/lifecycle/dispose/lifecycle.global.d.ts +1 -1
- package/lib/esm/lifecycle/dispose/lifecycle.global.d.ts.map +1 -1
- package/lib/esm/lifecycle/dispose/lifecycle.global.js +4 -8
- package/lib/esm/lifecycle/dispose/lifecycle.global.js.map +1 -1
- package/lib/esm/lifecycle/dispose/lifecycle.sync.d.ts +2 -2
- package/lib/esm/lifecycle/dispose/lifecycle.sync.d.ts.map +1 -1
- package/lib/esm/lifecycle/dispose/lifecycle.sync.js +1 -1
- package/lib/esm/lifecycle/dispose/lifecycle.sync.js.map +1 -1
- package/lib/esm/lifecycle/event/event.d.ts +15 -7
- package/lib/esm/lifecycle/event/event.d.ts.map +1 -1
- package/lib/esm/lifecycle/event/event.js +61 -6
- package/lib/esm/lifecycle/event/event.js.map +1 -1
- package/lib/esm/lifecycle/event/memorized.d.ts +2 -2
- package/lib/esm/lifecycle/event/memorized.d.ts.map +1 -1
- package/lib/esm/lifecycle/event/memorized.js +1 -1
- package/lib/esm/lifecycle/event/memorized.js.map +1 -1
- package/lib/esm/lifecycle/promise/cancellationToken/driver.common.js.map +1 -1
- package/lib/esm/lifecycle/promise/cancellationToken/source.d.ts +2 -2
- package/lib/esm/lifecycle/promise/cancellationToken/source.d.ts.map +1 -1
- package/lib/esm/lifecycle/promise/deferredPromise.js +2 -2
- package/lib/esm/lifecycle/promise/deferredPromise.js.map +1 -1
- package/lib/esm/lifecycle/timeout/timeout.js +1 -3
- package/lib/esm/lifecycle/timeout/timeout.js.map +1 -1
- package/lib/esm/lifecycle/timeout/timeoutError.d.ts.map +1 -1
- package/lib/esm/lifecycle/timeout/timeoutError.js.map +1 -1
- package/lib/esm/log/logger.d.ts.map +1 -1
- package/lib/esm/log/logger.js +4 -6
- package/lib/esm/log/logger.js.map +1 -1
- package/lib/esm/mapSet/customSet.d.ts +1 -3
- package/lib/esm/mapSet/customSet.d.ts.map +1 -1
- package/lib/esm/mapSet/customSet.js +3 -7
- package/lib/esm/mapSet/customSet.js.map +1 -1
- package/lib/esm/mapSet/extendMap.d.ts.map +1 -1
- package/lib/esm/mapSet/extendMap.js +5 -9
- package/lib/esm/mapSet/extendMap.js.map +1 -1
- package/lib/esm/misc/assertNotNull.d.ts.map +1 -1
- package/lib/esm/misc/assertNotNull.js +1 -3
- package/lib/esm/misc/assertNotNull.js.map +1 -1
- package/lib/esm/misc/package.json.js +1 -1
- package/lib/esm/misc/package.json.js.map +1 -1
- package/lib/esm/object/initOnRead.d.ts +1 -3
- package/lib/esm/object/initOnRead.d.ts.map +1 -1
- package/lib/esm/object/initOnRead.js.map +1 -1
- package/lib/esm/object/objectSame.js +2 -1
- package/lib/esm/object/objectSame.js.map +1 -1
- package/lib/esm/path/normalizePath.d.ts.map +1 -1
- package/lib/esm/path/normalizePath.js +7 -9
- package/lib/esm/path/normalizePath.js.map +1 -1
- package/lib/esm/path/pathArray.js +1 -1
- package/lib/esm/path/pathArray.js.map +1 -1
- package/lib/esm/platform/globalSingleton.js +1 -1
- package/lib/esm/platform/globalSymbol.d.ts.map +1 -1
- package/lib/esm/platform/globalSymbol.js +6 -8
- package/lib/esm/platform/globalSymbol.js.map +1 -1
- package/lib/esm/promise/promiseCollection.js +3 -3
- package/lib/esm/promise/promiseCollection.js.map +1 -1
- package/lib/esm/reflection/classes/hookClass.d.ts +1 -1
- package/lib/esm/reflection/classes/hookClass.d.ts.map +1 -1
- package/lib/esm/reflection/classes/singleton.d.ts.map +1 -1
- package/lib/esm/reflection/classes/singleton.js +1 -3
- package/lib/esm/reflection/classes/singleton.js.map +1 -1
- package/lib/esm/reflection/methods/bind.d.ts.map +1 -1
- package/lib/esm/reflection/methods/bind.js +1 -3
- package/lib/esm/reflection/methods/bind.js.map +1 -1
- package/lib/esm/reflection/methods/initOnRead.d.ts +1 -1
- package/lib/esm/reflection/methods/initOnRead.d.ts.map +1 -1
- package/lib/esm/reflection/methods/initOnRead.js +2 -2
- package/lib/esm/reflection/methods/initOnRead.js.map +1 -1
- package/lib/esm/string/castCase.js +5 -5
- package/lib/esm/string/castCase.js.map +1 -1
- package/lib/esm/string/pad2.d.ts.map +1 -1
- package/lib/esm/string/pad2.js +2 -4
- package/lib/esm/string/pad2.js.map +1 -1
- package/lib/esm/string/sizeString.d.ts.map +1 -1
- package/lib/esm/string/sizeString.js +23 -27
- package/lib/esm/string/sizeString.js.map +1 -1
- package/lib/esm/typingHelper/deep.partial.d.ts +1 -1
- package/lib/esm/typingHelper/deep.partial.d.ts.map +1 -1
- package/lib/esm/typingHelper/deep.readonly.d.ts +1 -1
- package/lib/esm/typingHelper/deep.readonly.d.ts.map +1 -1
- package/lib/esm/typingHelper/deep.required.d.ts +1 -1
- package/lib/esm/typingHelper/deep.required.d.ts.map +1 -1
- package/lib/esm/typingHelper/deep.writable.d.ts +1 -1
- package/lib/esm/typingHelper/deep.writable.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/array/arrayUnique.ts +3 -6
- package/src/array/normalizeArray.ts +3 -3
- package/src/array/sortAlpha.ts +3 -3
- package/src/date/isInvalid.ts +1 -1
- package/src/date/timeString.ts +9 -15
- package/src/debugging/serializable.ts +8 -8
- package/src/debugging/tryInspect.ts +12 -8
- package/src/error/convertUnknown.ts +2 -3
- package/src/error/getFrame.ts +2 -2
- package/src/error/known.ts +2 -2
- package/src/error/pretty.ts +29 -34
- package/src/function/asyncCallbackList.ts +3 -3
- package/src/function/callbackList.ts +2 -2
- package/src/function/delayCallbackList.ts +4 -4
- package/src/lifecycle/dispose/disposableEvent.ts +2 -3
- package/src/lifecycle/dispose/disposedError.ts +1 -1
- package/src/lifecycle/dispose/lifecycle.async.ts +2 -2
- package/src/lifecycle/dispose/lifecycle.global.ts +6 -7
- package/src/lifecycle/dispose/lifecycle.sync.ts +3 -3
- package/src/lifecycle/dispose/lifecycle.ts +1 -1
- package/src/lifecycle/event/event.ts +66 -13
- package/src/lifecycle/event/memorized.ts +4 -4
- package/src/lifecycle/promise/cancellationToken/driver.browser.ts +1 -1
- package/src/lifecycle/promise/cancellationToken/driver.common.ts +2 -2
- package/src/lifecycle/promise/cancellationToken/source.ts +2 -2
- package/src/lifecycle/promise/deferredPromise.ts +2 -2
- package/src/lifecycle/timeout/timeout.ts +1 -2
- package/src/lifecycle/timeout/timeoutError.ts +1 -1
- package/src/log/logger.ts +8 -9
- package/src/mapSet/customSet.ts +4 -8
- package/src/mapSet/extendMap.ts +6 -7
- package/src/misc/assertNotNull.ts +1 -2
- package/src/misc/package.json.ts +1 -1
- package/src/object/initOnRead.ts +1 -3
- package/src/object/objectSame.ts +2 -2
- package/src/path/normalizePath.ts +14 -17
- package/src/path/pathArray.ts +2 -2
- package/src/platform/globalSingleton.ts +1 -1
- package/src/platform/globalSymbol.ts +8 -9
- package/src/promise/promiseCollection.ts +3 -3
- package/src/reflection/classes/hookClass.ts +1 -1
- package/src/reflection/classes/singleton.ts +3 -4
- package/src/reflection/methods/bind.ts +1 -2
- package/src/reflection/methods/initOnRead.ts +3 -3
- package/src/string/castCase.ts +5 -5
- package/src/string/pad2.ts +2 -3
- package/src/string/sizeString.ts +33 -25
- package/src/tsconfig.json +1 -1
- package/src/typingHelper/deep.partial.ts +7 -7
- package/src/typingHelper/deep.readonly.ts +7 -7
- package/src/typingHelper/deep.required.ts +7 -7
- package/src/typingHelper/deep.writable.ts +7 -7
package/src/string/sizeString.ts
CHANGED
|
@@ -5,19 +5,23 @@
|
|
|
5
5
|
export function humanSizeSI(bytes: number, fixed = 2) {
|
|
6
6
|
if (bytes < 0) {
|
|
7
7
|
return '<0B';
|
|
8
|
-
} else if (bytes < 1000) {
|
|
9
|
-
return bytes + 'B';
|
|
10
|
-
} else if (bytes < 1000000) {
|
|
11
|
-
return (bytes / 1000).toFixed(fixed) + 'KiB';
|
|
12
|
-
} else if (bytes < 1000000000) {
|
|
13
|
-
return (bytes / 1000000).toFixed(fixed) + 'MiB';
|
|
14
|
-
} else if (bytes < 1000000000000) {
|
|
15
|
-
return (bytes / 1000000000).toFixed(fixed) + 'GiB';
|
|
16
|
-
} else if (bytes < 1000000000000000) {
|
|
17
|
-
return (bytes / 1000000000000).toFixed(fixed) + 'TiB';
|
|
18
|
-
} else {
|
|
19
|
-
return (bytes / 1000000000000000).toFixed(fixed) + 'PiB';
|
|
20
8
|
}
|
|
9
|
+
if (bytes < 1000) {
|
|
10
|
+
return `${bytes}B`;
|
|
11
|
+
}
|
|
12
|
+
if (bytes < 1000000) {
|
|
13
|
+
return `${(bytes / 1000).toFixed(fixed)}KiB`;
|
|
14
|
+
}
|
|
15
|
+
if (bytes < 1000000000) {
|
|
16
|
+
return `${(bytes / 1000000).toFixed(fixed)}MiB`;
|
|
17
|
+
}
|
|
18
|
+
if (bytes < 1000000000000) {
|
|
19
|
+
return `${(bytes / 1000000000).toFixed(fixed)}GiB`;
|
|
20
|
+
}
|
|
21
|
+
if (bytes < 1000000000000000) {
|
|
22
|
+
return `${(bytes / 1000000000000).toFixed(fixed)}TiB`;
|
|
23
|
+
}
|
|
24
|
+
return `${(bytes / 1000000000000000).toFixed(fixed)}PiB`;
|
|
21
25
|
}
|
|
22
26
|
|
|
23
27
|
/**
|
|
@@ -27,26 +31,30 @@ export function humanSizeSI(bytes: number, fixed = 2) {
|
|
|
27
31
|
export function humanSize(bytes: number, fixed = 2) {
|
|
28
32
|
if (bytes < 0) {
|
|
29
33
|
return '<0B';
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
|
|
34
|
+
}
|
|
35
|
+
if (bytes < 1024) {
|
|
36
|
+
return `${bytes}B`;
|
|
37
|
+
}
|
|
38
|
+
if (bytes < 1048576) {
|
|
33
39
|
// 1024 * 1024
|
|
34
|
-
return (bytes / 1024).toFixed(fixed)
|
|
35
|
-
}
|
|
40
|
+
return `${(bytes / 1024).toFixed(fixed)}KiB`;
|
|
41
|
+
}
|
|
42
|
+
if (bytes < 1073741824) {
|
|
36
43
|
// 1024 * 1024 * 1024
|
|
37
|
-
return (bytes / 1048576).toFixed(fixed)
|
|
38
|
-
}
|
|
44
|
+
return `${(bytes / 1048576).toFixed(fixed)}MiB`;
|
|
45
|
+
}
|
|
46
|
+
if (bytes < 1099511627776) {
|
|
39
47
|
// 1024 * 1024 * 1024 * 1024
|
|
40
|
-
return (bytes / 1073741824).toFixed(fixed)
|
|
41
|
-
}
|
|
48
|
+
return `${(bytes / 1073741824).toFixed(fixed)}GiB`;
|
|
49
|
+
}
|
|
50
|
+
if (bytes < 1125899906842624) {
|
|
42
51
|
// 1024 * 1024 * 1024 * 1024 * 1024
|
|
43
|
-
return (bytes / 1099511627776).toFixed(fixed)
|
|
44
|
-
} else {
|
|
45
|
-
return (bytes / 1125899906842624).toFixed(fixed) + 'PiB';
|
|
52
|
+
return `${(bytes / 1099511627776).toFixed(fixed)}TiB`;
|
|
46
53
|
}
|
|
54
|
+
return `${(bytes / 1125899906842624).toFixed(fixed)}PiB`;
|
|
47
55
|
}
|
|
48
56
|
|
|
49
57
|
/** @deprecated */
|
|
50
58
|
export function humanSpeed(bps: number) {
|
|
51
|
-
return humanSize(bps)
|
|
59
|
+
return `${humanSize(bps)}/s`;
|
|
52
60
|
}
|
package/src/tsconfig.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { Primitive } from './literal.js';
|
|
1
|
+
import type { Primitive } from './literal.js';
|
|
2
2
|
|
|
3
3
|
export type DeepPartial<T> = T extends Primitive
|
|
4
4
|
? T
|
|
5
5
|
: T extends ReadonlyArray<infer U>
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
? DeepPartialArray<U>
|
|
7
|
+
: T extends ReadonlyMap<infer K, infer V>
|
|
8
|
+
? DeepPartialMap<K, V>
|
|
9
|
+
: T extends ReadonlySet<infer M>
|
|
10
|
+
? DeepPartialSet<M>
|
|
11
|
+
: DeepPartialObject<T>;
|
|
12
12
|
|
|
13
13
|
type DeepPartialArray<T> = Array<DeepPartial<T>>;
|
|
14
14
|
type DeepPartialMap<K, V> = Map<DeepPartial<K>, DeepPartial<V>>;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { Primitive } from './literal.js';
|
|
1
|
+
import type { Primitive } from './literal.js';
|
|
2
2
|
|
|
3
3
|
export type DeepReadonly<T> = T extends Primitive
|
|
4
4
|
? T
|
|
5
5
|
: T extends Array<infer U>
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
? DeepReadonlyArray<U>
|
|
7
|
+
: T extends Map<infer K, infer V>
|
|
8
|
+
? DeepReadonlyMap<K, V>
|
|
9
|
+
: T extends Set<infer M>
|
|
10
|
+
? DeepReadonlySet<M>
|
|
11
|
+
: DeepReadonlyObject<T>;
|
|
12
12
|
|
|
13
13
|
type DeepReadonlyArray<T> = ReadonlyArray<DeepReadonly<T>>;
|
|
14
14
|
type DeepReadonlyMap<K, V> = ReadonlyMap<DeepReadonly<K>, DeepReadonly<V>>;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { Primitive } from './literal.js';
|
|
1
|
+
import type { Primitive } from './literal.js';
|
|
2
2
|
|
|
3
3
|
export type DeepNonNullable<T> = T extends Primitive
|
|
4
4
|
? T
|
|
5
5
|
: T extends ReadonlyArray<infer U> | Array<infer U>
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
? DeepNonNullableArray<U>
|
|
7
|
+
: T extends ReadonlyMap<infer K, infer V> | Map<infer K, infer V>
|
|
8
|
+
? DeepNonNullableMap<K, V>
|
|
9
|
+
: T extends ReadonlySet<infer M>
|
|
10
|
+
? DeepNonNullableSet<M>
|
|
11
|
+
: DeepNonNullableObject<T>;
|
|
12
12
|
|
|
13
13
|
type DeepNonNullableArray<T> = Array<DeepNonNullable<T>>;
|
|
14
14
|
type DeepNonNullableMap<K, V> = Map<DeepNonNullable<K>, DeepNonNullable<V>>;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { Primitive } from './literal.js';
|
|
1
|
+
import type { Primitive } from './literal.js';
|
|
2
2
|
|
|
3
3
|
export type DeepWriteable<T> = T extends Primitive
|
|
4
4
|
? T
|
|
5
5
|
: T extends ReadonlyArray<infer U>
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
? DeepWriteableArray<U>
|
|
7
|
+
: T extends ReadonlyMap<infer K, infer V>
|
|
8
|
+
? DeepWriteableMap<K, V>
|
|
9
|
+
: T extends ReadonlySet<infer M>
|
|
10
|
+
? DeepWriteableSet<M>
|
|
11
|
+
: DeepWriteableObject<T>;
|
|
12
12
|
|
|
13
13
|
type DeepWriteableArray<T> = Array<DeepWriteable<T>>;
|
|
14
14
|
type DeepWriteableMap<K, V> = Map<DeepWriteable<K>, DeepWriteable<V>>;
|