type-plus 6.0.0 → 6.2.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 (233) hide show
  1. package/README.md +28 -12
  2. package/cjs/any_plus/any.d.ts +29 -0
  3. package/cjs/any_plus/any.d.ts.map +1 -0
  4. package/cjs/{predicates/IsAny.js → any_plus/any.js} +1 -1
  5. package/cjs/any_plus/any.js.map +1 -0
  6. package/cjs/any_plus/index.d.ts +2 -0
  7. package/cjs/any_plus/index.d.ts.map +1 -0
  8. package/cjs/{array_plus/_plus.js → any_plus/index.js} +1 -1
  9. package/cjs/any_plus/index.js.map +1 -0
  10. package/cjs/array_plus/array.d.ts +16 -5
  11. package/cjs/array_plus/array.d.ts.map +1 -1
  12. package/cjs/array_plus/array_number.d.ts +4 -0
  13. package/cjs/array_plus/array_number.d.ts.map +1 -0
  14. package/cjs/{number_plus/_plus.js → array_plus/array_number.js} +1 -1
  15. package/cjs/array_plus/array_number.js.map +1 -0
  16. package/cjs/array_plus/array_plus.d.ts +35 -0
  17. package/cjs/array_plus/array_plus.d.ts.map +1 -0
  18. package/cjs/{math/IsPositive.js → array_plus/array_plus.js} +1 -1
  19. package/cjs/array_plus/array_plus.js.map +1 -0
  20. package/cjs/array_plus/create_tuple.d.ts +3 -2
  21. package/cjs/array_plus/create_tuple.d.ts.map +1 -1
  22. package/cjs/array_plus/index.d.ts +15 -15
  23. package/cjs/array_plus/index.d.ts.map +1 -1
  24. package/cjs/array_plus/pad_left.d.ts +4 -3
  25. package/cjs/array_plus/pad_left.d.ts.map +1 -1
  26. package/cjs/array_plus/tail.d.ts +1 -1
  27. package/cjs/array_plus/tail.d.ts.map +1 -1
  28. package/cjs/assertion/assertType.d.ts +1 -1
  29. package/cjs/assertion/assertType.d.ts.map +1 -1
  30. package/cjs/assertion/assertType.js.map +1 -1
  31. package/cjs/index.d.ts +4 -3
  32. package/cjs/index.d.ts.map +1 -1
  33. package/cjs/index.js +6 -5
  34. package/cjs/index.js.map +1 -1
  35. package/cjs/math/Add.d.ts +1 -2
  36. package/cjs/math/Add.d.ts.map +1 -1
  37. package/cjs/math/Digit.d.ts +1 -2
  38. package/cjs/math/Digit.d.ts.map +1 -1
  39. package/cjs/math/GreaterThan.d.ts +1 -2
  40. package/cjs/math/GreaterThan.d.ts.map +1 -1
  41. package/cjs/math/Max.d.ts +1 -1
  42. package/cjs/math/Max.d.ts.map +1 -1
  43. package/cjs/math/Subtract.d.ts +1 -2
  44. package/cjs/math/Subtract.d.ts.map +1 -1
  45. package/cjs/math/index.d.ts +0 -2
  46. package/cjs/math/index.d.ts.map +1 -1
  47. package/cjs/number_plus/number.d.ts +79 -2
  48. package/cjs/number_plus/number.d.ts.map +1 -1
  49. package/cjs/number_plus/number_plus.d.ts +2 -0
  50. package/cjs/number_plus/number_plus.d.ts.map +1 -0
  51. package/cjs/{math/IsWhole.js → number_plus/number_plus.js} +1 -1
  52. package/cjs/number_plus/number_plus.js.map +1 -0
  53. package/cjs/object/IsDisjoint.d.ts +2 -2
  54. package/cjs/object/IsDisjoint.d.ts.map +1 -1
  55. package/cjs/object/KeysWithDiffType.d.ts +1 -1
  56. package/cjs/object/KeysWithDiffType.d.ts.map +1 -1
  57. package/cjs/object/KnownKeys.d.ts +1 -1
  58. package/cjs/object/KnownKeys.d.ts.map +1 -1
  59. package/cjs/object/OptionalKeys.d.ts +1 -1
  60. package/cjs/object/OptionalKeys.d.ts.map +1 -1
  61. package/cjs/object/Partial.d.ts +3 -3
  62. package/cjs/object/Partial.d.ts.map +1 -1
  63. package/cjs/object/getField.d.ts +1 -1
  64. package/cjs/object/getField.d.ts.map +1 -1
  65. package/cjs/object/mapKey.d.ts +1 -1
  66. package/cjs/object/mapKey.d.ts.map +1 -1
  67. package/cjs/object/mapProperties.d.ts +1 -1
  68. package/cjs/object/mapProperties.d.ts.map +1 -1
  69. package/cjs/object/omit.d.ts +3 -3
  70. package/cjs/object/omit.d.ts.map +1 -1
  71. package/cjs/object/omit.js +2 -2
  72. package/cjs/object/omit.js.map +1 -1
  73. package/cjs/object/pick.d.ts +1 -1
  74. package/cjs/object/pick.d.ts.map +1 -1
  75. package/cjs/predicates/Equal.d.ts +1 -1
  76. package/cjs/predicates/Equal.d.ts.map +1 -1
  77. package/cjs/predicates/index.d.ts +0 -1
  78. package/cjs/predicates/index.d.ts.map +1 -1
  79. package/cjs/predicates/index.js.map +1 -1
  80. package/cjs/promise/PromiseValueMerge.d.ts +1 -2
  81. package/cjs/promise/PromiseValueMerge.d.ts.map +1 -1
  82. package/esm/any_plus/any.d.ts +29 -0
  83. package/esm/any_plus/any.d.ts.map +1 -0
  84. package/esm/any_plus/any.js +2 -0
  85. package/esm/any_plus/any.js.map +1 -0
  86. package/esm/any_plus/index.d.ts +2 -0
  87. package/esm/any_plus/index.d.ts.map +1 -0
  88. package/esm/any_plus/index.js +2 -0
  89. package/esm/any_plus/index.js.map +1 -0
  90. package/esm/array_plus/array.d.ts +16 -5
  91. package/esm/array_plus/array.d.ts.map +1 -1
  92. package/esm/array_plus/array_number.d.ts +4 -0
  93. package/esm/array_plus/array_number.d.ts.map +1 -0
  94. package/esm/array_plus/array_number.js +2 -0
  95. package/esm/array_plus/array_number.js.map +1 -0
  96. package/esm/array_plus/array_plus.d.ts +35 -0
  97. package/esm/array_plus/array_plus.d.ts.map +1 -0
  98. package/esm/array_plus/array_plus.js +2 -0
  99. package/esm/array_plus/array_plus.js.map +1 -0
  100. package/esm/array_plus/create_tuple.d.ts +3 -2
  101. package/esm/array_plus/create_tuple.d.ts.map +1 -1
  102. package/esm/array_plus/index.d.ts +15 -15
  103. package/esm/array_plus/index.d.ts.map +1 -1
  104. package/esm/array_plus/pad_left.d.ts +4 -3
  105. package/esm/array_plus/pad_left.d.ts.map +1 -1
  106. package/esm/array_plus/tail.d.ts +1 -1
  107. package/esm/array_plus/tail.d.ts.map +1 -1
  108. package/esm/assertion/assertType.d.ts +1 -1
  109. package/esm/assertion/assertType.d.ts.map +1 -1
  110. package/esm/assertion/assertType.js.map +1 -1
  111. package/esm/index.d.ts +4 -3
  112. package/esm/index.d.ts.map +1 -1
  113. package/esm/index.js +3 -2
  114. package/esm/index.js.map +1 -1
  115. package/esm/math/Add.d.ts +1 -2
  116. package/esm/math/Add.d.ts.map +1 -1
  117. package/esm/math/Digit.d.ts +1 -2
  118. package/esm/math/Digit.d.ts.map +1 -1
  119. package/esm/math/GreaterThan.d.ts +1 -2
  120. package/esm/math/GreaterThan.d.ts.map +1 -1
  121. package/esm/math/Max.d.ts +1 -1
  122. package/esm/math/Max.d.ts.map +1 -1
  123. package/esm/math/Subtract.d.ts +1 -2
  124. package/esm/math/Subtract.d.ts.map +1 -1
  125. package/esm/math/index.d.ts +0 -2
  126. package/esm/math/index.d.ts.map +1 -1
  127. package/esm/number_plus/number.d.ts +79 -2
  128. package/esm/number_plus/number.d.ts.map +1 -1
  129. package/esm/number_plus/number_plus.d.ts +2 -0
  130. package/esm/number_plus/number_plus.d.ts.map +1 -0
  131. package/esm/number_plus/number_plus.js +2 -0
  132. package/esm/number_plus/number_plus.js.map +1 -0
  133. package/esm/object/IsDisjoint.d.ts +2 -2
  134. package/esm/object/IsDisjoint.d.ts.map +1 -1
  135. package/esm/object/KeysWithDiffType.d.ts +1 -1
  136. package/esm/object/KeysWithDiffType.d.ts.map +1 -1
  137. package/esm/object/KnownKeys.d.ts +1 -1
  138. package/esm/object/KnownKeys.d.ts.map +1 -1
  139. package/esm/object/OptionalKeys.d.ts +1 -1
  140. package/esm/object/OptionalKeys.d.ts.map +1 -1
  141. package/esm/object/Partial.d.ts +3 -3
  142. package/esm/object/Partial.d.ts.map +1 -1
  143. package/esm/object/getField.d.ts +1 -1
  144. package/esm/object/getField.d.ts.map +1 -1
  145. package/esm/object/mapKey.d.ts +1 -1
  146. package/esm/object/mapKey.d.ts.map +1 -1
  147. package/esm/object/mapProperties.d.ts +1 -1
  148. package/esm/object/mapProperties.d.ts.map +1 -1
  149. package/esm/object/omit.d.ts +3 -3
  150. package/esm/object/omit.d.ts.map +1 -1
  151. package/esm/object/omit.js +1 -1
  152. package/esm/object/omit.js.map +1 -1
  153. package/esm/object/pick.d.ts +1 -1
  154. package/esm/object/pick.d.ts.map +1 -1
  155. package/esm/predicates/Equal.d.ts +1 -1
  156. package/esm/predicates/Equal.d.ts.map +1 -1
  157. package/esm/predicates/index.d.ts +0 -1
  158. package/esm/predicates/index.d.ts.map +1 -1
  159. package/esm/predicates/index.js.map +1 -1
  160. package/esm/promise/PromiseValueMerge.d.ts +1 -2
  161. package/esm/promise/PromiseValueMerge.d.ts.map +1 -1
  162. package/package.json +3 -3
  163. package/ts/any_plus/any.ts +29 -0
  164. package/ts/any_plus/index.ts +1 -0
  165. package/ts/array_plus/array.ts +21 -11
  166. package/ts/array_plus/array_number.ts +12 -0
  167. package/ts/array_plus/array_plus.ts +66 -0
  168. package/ts/array_plus/create_tuple.ts +3 -2
  169. package/ts/array_plus/index.ts +15 -15
  170. package/ts/array_plus/pad_left.ts +4 -3
  171. package/ts/array_plus/tail.ts +1 -1
  172. package/ts/assertion/assertType.ts +1 -1
  173. package/ts/index.ts +4 -15
  174. package/ts/math/Add.ts +1 -3
  175. package/ts/math/Digit.ts +1 -2
  176. package/ts/math/GreaterThan.ts +1 -2
  177. package/ts/math/Max.ts +1 -1
  178. package/ts/math/Subtract.ts +1 -2
  179. package/ts/math/index.ts +0 -2
  180. package/ts/number_plus/number.ts +97 -6
  181. package/ts/object/IsDisjoint.ts +2 -2
  182. package/ts/object/KeysWithDiffType.ts +1 -1
  183. package/ts/object/KnownKeys.ts +1 -1
  184. package/ts/object/OptionalKeys.ts +1 -1
  185. package/ts/object/Partial.ts +3 -3
  186. package/ts/object/getField.ts +1 -1
  187. package/ts/object/mapKey.ts +1 -1
  188. package/ts/object/mapProperties.ts +1 -1
  189. package/ts/object/omit.ts +4 -3
  190. package/ts/object/pick.ts +1 -1
  191. package/ts/predicates/Equal.ts +1 -1
  192. package/ts/predicates/index.ts +0 -1
  193. package/ts/promise/PromiseValueMerge.ts +9 -11
  194. package/cjs/array_plus/_plus.d.ts +0 -2
  195. package/cjs/array_plus/_plus.d.ts.map +0 -1
  196. package/cjs/array_plus/_plus.js.map +0 -1
  197. package/cjs/math/IsPositive.d.ts +0 -7
  198. package/cjs/math/IsPositive.d.ts.map +0 -1
  199. package/cjs/math/IsPositive.js.map +0 -1
  200. package/cjs/math/IsWhole.d.ts +0 -7
  201. package/cjs/math/IsWhole.d.ts.map +0 -1
  202. package/cjs/math/IsWhole.js.map +0 -1
  203. package/cjs/number_plus/_plus.d.ts +0 -2
  204. package/cjs/number_plus/_plus.d.ts.map +0 -1
  205. package/cjs/number_plus/_plus.js.map +0 -1
  206. package/cjs/predicates/IsAny.d.ts +0 -3
  207. package/cjs/predicates/IsAny.d.ts.map +0 -1
  208. package/cjs/predicates/IsAny.js.map +0 -1
  209. package/esm/array_plus/_plus.d.ts +0 -2
  210. package/esm/array_plus/_plus.d.ts.map +0 -1
  211. package/esm/array_plus/_plus.js +0 -2
  212. package/esm/array_plus/_plus.js.map +0 -1
  213. package/esm/math/IsPositive.d.ts +0 -7
  214. package/esm/math/IsPositive.d.ts.map +0 -1
  215. package/esm/math/IsPositive.js +0 -2
  216. package/esm/math/IsPositive.js.map +0 -1
  217. package/esm/math/IsWhole.d.ts +0 -7
  218. package/esm/math/IsWhole.d.ts.map +0 -1
  219. package/esm/math/IsWhole.js +0 -2
  220. package/esm/math/IsWhole.js.map +0 -1
  221. package/esm/number_plus/_plus.d.ts +0 -2
  222. package/esm/number_plus/_plus.d.ts.map +0 -1
  223. package/esm/number_plus/_plus.js +0 -2
  224. package/esm/number_plus/_plus.js.map +0 -1
  225. package/esm/predicates/IsAny.d.ts +0 -3
  226. package/esm/predicates/IsAny.d.ts.map +0 -1
  227. package/esm/predicates/IsAny.js +0 -2
  228. package/esm/predicates/IsAny.js.map +0 -1
  229. package/ts/array_plus/_plus.ts +0 -1
  230. package/ts/math/IsPositive.ts +0 -10
  231. package/ts/math/IsWhole.ts +0 -10
  232. package/ts/predicates/IsAny.ts +0 -3
  233. /package/ts/number_plus/{_plus.ts → number_plus.ts} +0 -0
@@ -1,3 +1,6 @@
1
+ import type { IsNever } from '../PrimitiveTypes.js'
2
+ import type { IsAny } from '../any_plus/any.js'
3
+
1
4
  /**
2
5
  * Either number or bigint.
3
6
  */
@@ -16,12 +19,48 @@ export type Zero = 0 | 0n
16
19
  *
17
20
  * type R = Integer<0> // 0
18
21
  * type R = Integer<1.1> // never
22
+ * type R = Integer<number> // never as it contains non-integer
19
23
  *
20
24
  * type R = Integer<0, true, false> // true
21
25
  * type R = Integer<1.1, true, false> // false
22
26
  * ```
23
27
  */
24
- export type Integer<N extends Numeric, Then = N, Else = never> = `${N}` extends `${bigint}` ? Then : Else
28
+ export type Integer<N extends Numeric, Then = N, Else = never> = IsNever<
29
+ N,
30
+ Else,
31
+ `${N}` extends `${bigint}` ? Then : Else
32
+ >
33
+ /**
34
+ * Check if the value is an integer.
35
+ *
36
+ * ```
37
+ * import type { IsInteger } from 'type-plus'
38
+ *
39
+ * type R = IsInteger<0> // 0
40
+ * type R = IsInteger<1.1> // never
41
+ * type R = IsInteger<number> // never as it contains non-integer
42
+ *
43
+ * type R = IsInteger<0, true, false> // true
44
+ * type R = IsInteger<1.1, true, false> // false
45
+ * ```
46
+ */
47
+ export type IsInteger<N extends Numeric, Then = true, Else = false> = Integer<N, Then, Else>
48
+
49
+ /**
50
+ * Check if the value is an integer.
51
+ *
52
+ * ```
53
+ * import type { IsWhole } from 'type-plus'
54
+ *
55
+ * type R = IsWhole<0> // 0
56
+ * type R = IsWhole<1.1> // never
57
+ * type R = IsWhole<number> // never as it contains non-integer
58
+ *
59
+ * type R = IsWhole<0, true, false> // true
60
+ * type R = IsWhole<1.1, true, false> // false
61
+ * ```
62
+ */
63
+ export type IsWhole<N extends Numeric, Then = true, Else = false> = Integer<N, Then, Else>
25
64
 
26
65
  /**
27
66
  * Check if the value is a negative number.
@@ -36,11 +75,11 @@ export type Integer<N extends Numeric, Then = N, Else = never> = `${N}` extends
36
75
  * type R = Negative<1, true, false> // false
37
76
  * ```
38
77
  */
39
- export type Negative<N extends Numeric, Then = N, Else = never> = N extends Zero
40
- ? Else
41
- : `${N}` extends `-${string}`
42
- ? Then
43
- : Else
78
+ export type Negative<N extends Numeric, Then = N, Else = never> = IsNever<
79
+ N,
80
+ Else,
81
+ N extends Zero ? Else : `${N}` extends `-${string}` ? Then : Else
82
+ >
44
83
 
45
84
  /**
46
85
  * Check if the value it not a negative number.
@@ -56,3 +95,55 @@ export type Negative<N extends Numeric, Then = N, Else = never> = N extends Zero
56
95
  * ```
57
96
  */
58
97
  export type NonNegative<N extends Numeric, Then = N, Else = never> = Negative<N, Else, Then>
98
+
99
+ /**
100
+ * Check if the type `T` is exactly the type `number` and not numeric literals.
101
+ *
102
+ * ```
103
+ * import type { NumberType } from 'type-plus'
104
+ *
105
+ * type R = NumberType<number> // true
106
+ * type R = NumberType<1> // false
107
+ * ```
108
+ */
109
+ export type NumberType<T, Then = T, Else = never> = IsAny<
110
+ T,
111
+ Else,
112
+ [number, T] extends [T, number] ? Then : Else
113
+ >
114
+
115
+ /**
116
+ * Check if the value is a positive number.
117
+ *
118
+ * ```
119
+ * import type { Positive } from 'type-plus'
120
+ *
121
+ * type R = Positive<1> // 1
122
+ * type R = Positive<0> // never
123
+ * type R = Positive<-1> // never
124
+ *
125
+ * type R = Positive<1, true, false> // true
126
+ * type R = Positive<-1, true, false> // false
127
+ * ```
128
+ */
129
+ export type Positive<N extends Numeric, Then = N, Else = never> = IsNever<
130
+ N,
131
+ Else,
132
+ number extends N ? Else : N extends Zero ? Then : `${N}` extends `-${string}` ? Else : Then
133
+ >
134
+
135
+ /**
136
+ * Is the value `N` a positive number.
137
+ *
138
+ * ```
139
+ * import type { IsPositive } from 'type-plus'
140
+ *
141
+ * type R = IsPositive<1> // true
142
+ * type R = IsPositive<0> // false
143
+ * type R = IsPositive<-1> // false
144
+ *
145
+ * type R = IsPositive<1, 'good', 'bad'> // 'good'
146
+ * type R = IsPositive<-1, 'good', 'bad> // 'bad'
147
+ * ```
148
+ */
149
+ export type IsPositive<N extends Numeric, Then = true, Else = false> = Positive<N, Then, Else>
@@ -1,6 +1,6 @@
1
- import { And, Not } from '../predicates/index.js'
1
+ import type { And, Not } from '../predicates/index.js'
2
2
  import type { AnyRecord } from './AnyRecord.js'
3
- import { HasKey } from './hasKey.js'
3
+ import type { HasKey } from './hasKey.js'
4
4
 
5
5
  /**
6
6
  * Are the two records disjoint from each other.
@@ -1,4 +1,4 @@
1
- import { ValueOf } from './ValueOf.js'
1
+ import type { ValueOf } from './ValueOf.js'
2
2
  import type { IsDisjoint } from './IsDisjoint.js'
3
3
  import type { AnyRecord } from './AnyRecord.js'
4
4
 
@@ -2,7 +2,7 @@
2
2
  // known from Gerrit Birkeland @Gerrit0
3
3
  // https://github.com/Microsoft/TypeScript/issues/25987#issuecomment-408339599
4
4
 
5
- import { PrimitiveTypes } from '../PrimitiveTypes.js'
5
+ import type { PrimitiveTypes } from '../PrimitiveTypes.js'
6
6
 
7
7
  // https://github.com/microsoft/TypeScript/issues/25987#issuecomment-441224690
8
8
  export type KnownKeys<T> = T extends PrimitiveTypes
@@ -1,4 +1,4 @@
1
- import { KeyTypes } from './KeyTypes.js'
1
+ import type { KeyTypes } from './KeyTypes.js'
2
2
 
3
3
  export type OptionalKeys<O extends Record<KeyTypes, any>> = O extends unknown ? OptionalKeys._<O> : never
4
4
 
@@ -1,6 +1,6 @@
1
- import { UnionKeys } from '../UnionKeys.js'
2
- import { Omit } from './omit.js'
3
- import { Pick } from './pick.js'
1
+ import type { UnionKeys } from '../UnionKeys.js'
2
+ import type { Omit } from './omit.js'
3
+ import type { Pick } from './pick.js'
4
4
 
5
5
  /**
6
6
  * Apply `Partial<>` on the selected properties.
@@ -1,4 +1,4 @@
1
- import { UnionKeys } from '../UnionKeys.js'
1
+ import type { UnionKeys } from '../UnionKeys.js'
2
2
 
3
3
  export function getField<T, TX extends Exclude<T, undefined | null>, K extends UnionKeys<TX>>(
4
4
  subject: T,
@@ -1,4 +1,4 @@
1
- import { KeyTypes } from './KeyTypes.js'
1
+ import type { KeyTypes } from './KeyTypes.js'
2
2
 
3
3
  export function mapKey<R, S extends Record<KeyTypes, any>, T = any>(
4
4
  subject: S,
@@ -1,6 +1,6 @@
1
1
  import type { AnyRecord } from './AnyRecord.js'
2
2
  import { reduceByKey } from './reduceKey.js'
3
- import { ValueOf } from './ValueOf.js'
3
+ import type { ValueOf } from './ValueOf.js'
4
4
 
5
5
  /**
6
6
  * An Object-specific version of `map`.
package/ts/object/omit.ts CHANGED
@@ -1,7 +1,8 @@
1
- import { AnyRecord, reduceByKey } from '../object/index.js'
2
- import { UnionKeys } from '../UnionKeys.js'
3
- import { Pick } from './pick.js'
1
+ import type { UnionKeys } from '../UnionKeys.js'
2
+ import type { AnyRecord } from './AnyRecord.js'
3
+ import type { Pick } from './pick.js'
4
4
  import { record } from './record.js'
5
+ import { reduceByKey } from './reduceKey.js'
5
6
 
6
7
  // by Titian Cernicova-Dragomir
7
8
  // https://github.com/microsoft/TypeScript/issues/28339#issuecomment-463577347
package/ts/object/pick.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { UnionKeys } from '../UnionKeys.js'
1
+ import type { UnionKeys } from '../UnionKeys.js'
2
2
  import type { AnyRecord } from './AnyRecord.js'
3
3
  import { record } from './record.js'
4
4
  import { reduceByKey } from './reduceKey.js'
@@ -1,4 +1,4 @@
1
- import type { IsAny } from './IsAny.js'
1
+ import type { IsAny } from '../any_plus/any.js'
2
2
  import type { And, Or } from './logical.js'
3
3
 
4
4
  /**
@@ -2,7 +2,6 @@ export * from './CanAssign.js'
2
2
  export type { Equal, IsEqual, IsNotEqual, NotEqual } from './Equal.js'
3
3
  export type { Extendable, IsExtend, IsNotExtend, NotExtendable } from './Extends.js'
4
4
  export type { If } from './If.js'
5
- export type { IsAny } from './IsAny.js'
6
5
  export type { IsEmptyObject } from './IsEmptyObject.js'
7
6
  export * from './isType.js'
8
7
  export type { And, Not, Or, Xor } from './logical.js'
@@ -1,5 +1,3 @@
1
- import type { PromiseValue } from './PromiseValue.js'
2
-
3
1
  /**
4
2
  * Merging value types from multiple promises.
5
3
  */
@@ -14,13 +12,13 @@ export type PromiseValueMerge<
14
12
  P8 extends Promise<any> = any,
15
13
  P9 extends Promise<any> = any
16
14
  > = Promise<
17
- PromiseValue<P1> &
18
- PromiseValue<P2> &
19
- PromiseValue<P3> &
20
- PromiseValue<P4> &
21
- PromiseValue<P5> &
22
- PromiseValue<P6> &
23
- PromiseValue<P7> &
24
- PromiseValue<P8> &
25
- PromiseValue<P9>
15
+ Awaited<P1> &
16
+ Awaited<P2> &
17
+ Awaited<P3> &
18
+ Awaited<P4> &
19
+ Awaited<P5> &
20
+ Awaited<P6> &
21
+ Awaited<P7> &
22
+ Awaited<P8> &
23
+ Awaited<P9>
26
24
  >
@@ -1,2 +0,0 @@
1
- export type * from './array.js';
2
- //# sourceMappingURL=_plus.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"_plus.d.ts","sourceRoot":"","sources":["../../ts/array_plus/_plus.ts"],"names":[],"mappings":"AAAA,mBAAmB,YAAY,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"_plus.js","sourceRoot":"","sources":["../../ts/array_plus/_plus.ts"],"names":[],"mappings":""}
@@ -1,7 +0,0 @@
1
- /**
2
- * Check if type of positive number literal
3
- * `number` type is false as it can be negative.
4
- * @see https://itnext.io/implementing-arithmetic-within-typescripts-type-system-a1ef140a6f6f
5
- */
6
- export type IsPositive<N extends number, Then = true, Else = false> = number extends N ? Else : `${N}` extends `-${number}` ? Else : Then;
7
- //# sourceMappingURL=IsPositive.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"IsPositive.d.ts","sourceRoot":"","sources":["../../ts/math/IsPositive.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,MAAM,UAAU,CAAC,CAAC,SAAS,MAAM,EAAE,IAAI,GAAG,IAAI,EAAE,IAAI,GAAG,KAAK,IAAI,MAAM,SAAS,CAAC,GACnF,IAAI,GACJ,GAAG,CAAC,EAAE,SAAS,IAAI,MAAM,EAAE,GAC3B,IAAI,GACJ,IAAI,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"IsPositive.js","sourceRoot":"","sources":["../../ts/math/IsPositive.ts"],"names":[],"mappings":""}
@@ -1,7 +0,0 @@
1
- /**
2
- * Check if type is whole number literal.
3
- * `number` type is false as it can be fractional.
4
- * @see https://itnext.io/implementing-arithmetic-within-typescripts-type-system-a1ef140a6f6f
5
- */
6
- export type IsWhole<N extends number, Then = true, Else = false> = number extends N ? Else : `${N}` extends `${number}.${number}` ? Else : Then;
7
- //# sourceMappingURL=IsWhole.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"IsWhole.d.ts","sourceRoot":"","sources":["../../ts/math/IsWhole.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,MAAM,OAAO,CAAC,CAAC,SAAS,MAAM,EAAE,IAAI,GAAG,IAAI,EAAE,IAAI,GAAG,KAAK,IAAI,MAAM,SAAS,CAAC,GAChF,IAAI,GACJ,GAAG,CAAC,EAAE,SAAS,GAAG,MAAM,IAAI,MAAM,EAAE,GACpC,IAAI,GACJ,IAAI,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"IsWhole.js","sourceRoot":"","sources":["../../ts/math/IsWhole.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export type * from './number.js';
2
- //# sourceMappingURL=_plus.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"_plus.d.ts","sourceRoot":"","sources":["../../ts/number_plus/_plus.ts"],"names":[],"mappings":"AAAA,mBAAmB,aAAa,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"_plus.js","sourceRoot":"","sources":["../../ts/number_plus/_plus.ts"],"names":[],"mappings":""}
@@ -1,3 +0,0 @@
1
- import type { IsExtend } from './Extends.js';
2
- export type IsAny<T, Then = true, Else = false> = boolean extends IsExtend<T, string> ? Then : Else;
3
- //# sourceMappingURL=IsAny.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"IsAny.d.ts","sourceRoot":"","sources":["../../ts/predicates/IsAny.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AAE5C,MAAM,MAAM,KAAK,CAAC,CAAC,EAAE,IAAI,GAAG,IAAI,EAAE,IAAI,GAAG,KAAK,IAAI,OAAO,SAAS,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC,GAAG,IAAI,GAAG,IAAI,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"IsAny.js","sourceRoot":"","sources":["../../ts/predicates/IsAny.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export type * from './array.js';
2
- //# sourceMappingURL=_plus.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"_plus.d.ts","sourceRoot":"","sources":["../../ts/array_plus/_plus.ts"],"names":[],"mappings":"AAAA,mBAAmB,YAAY,CAAA"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=_plus.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"_plus.js","sourceRoot":"","sources":["../../ts/array_plus/_plus.ts"],"names":[],"mappings":""}
@@ -1,7 +0,0 @@
1
- /**
2
- * Check if type of positive number literal
3
- * `number` type is false as it can be negative.
4
- * @see https://itnext.io/implementing-arithmetic-within-typescripts-type-system-a1ef140a6f6f
5
- */
6
- export type IsPositive<N extends number, Then = true, Else = false> = number extends N ? Else : `${N}` extends `-${number}` ? Else : Then;
7
- //# sourceMappingURL=IsPositive.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"IsPositive.d.ts","sourceRoot":"","sources":["../../ts/math/IsPositive.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,MAAM,UAAU,CAAC,CAAC,SAAS,MAAM,EAAE,IAAI,GAAG,IAAI,EAAE,IAAI,GAAG,KAAK,IAAI,MAAM,SAAS,CAAC,GACnF,IAAI,GACJ,GAAG,CAAC,EAAE,SAAS,IAAI,MAAM,EAAE,GAC3B,IAAI,GACJ,IAAI,CAAA"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=IsPositive.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"IsPositive.js","sourceRoot":"","sources":["../../ts/math/IsPositive.ts"],"names":[],"mappings":""}
@@ -1,7 +0,0 @@
1
- /**
2
- * Check if type is whole number literal.
3
- * `number` type is false as it can be fractional.
4
- * @see https://itnext.io/implementing-arithmetic-within-typescripts-type-system-a1ef140a6f6f
5
- */
6
- export type IsWhole<N extends number, Then = true, Else = false> = number extends N ? Else : `${N}` extends `${number}.${number}` ? Else : Then;
7
- //# sourceMappingURL=IsWhole.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"IsWhole.d.ts","sourceRoot":"","sources":["../../ts/math/IsWhole.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,MAAM,OAAO,CAAC,CAAC,SAAS,MAAM,EAAE,IAAI,GAAG,IAAI,EAAE,IAAI,GAAG,KAAK,IAAI,MAAM,SAAS,CAAC,GAChF,IAAI,GACJ,GAAG,CAAC,EAAE,SAAS,GAAG,MAAM,IAAI,MAAM,EAAE,GACpC,IAAI,GACJ,IAAI,CAAA"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=IsWhole.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"IsWhole.js","sourceRoot":"","sources":["../../ts/math/IsWhole.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export type * from './number.js';
2
- //# sourceMappingURL=_plus.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"_plus.d.ts","sourceRoot":"","sources":["../../ts/number_plus/_plus.ts"],"names":[],"mappings":"AAAA,mBAAmB,aAAa,CAAA"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=_plus.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"_plus.js","sourceRoot":"","sources":["../../ts/number_plus/_plus.ts"],"names":[],"mappings":""}
@@ -1,3 +0,0 @@
1
- import type { IsExtend } from './Extends.js';
2
- export type IsAny<T, Then = true, Else = false> = boolean extends IsExtend<T, string> ? Then : Else;
3
- //# sourceMappingURL=IsAny.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"IsAny.d.ts","sourceRoot":"","sources":["../../ts/predicates/IsAny.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AAE5C,MAAM,MAAM,KAAK,CAAC,CAAC,EAAE,IAAI,GAAG,IAAI,EAAE,IAAI,GAAG,KAAK,IAAI,OAAO,SAAS,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC,GAAG,IAAI,GAAG,IAAI,CAAA"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=IsAny.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"IsAny.js","sourceRoot":"","sources":["../../ts/predicates/IsAny.ts"],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- export type * from './array.js'
@@ -1,10 +0,0 @@
1
- /**
2
- * Check if type of positive number literal
3
- * `number` type is false as it can be negative.
4
- * @see https://itnext.io/implementing-arithmetic-within-typescripts-type-system-a1ef140a6f6f
5
- */
6
- export type IsPositive<N extends number, Then = true, Else = false> = number extends N
7
- ? Else
8
- : `${N}` extends `-${number}`
9
- ? Else
10
- : Then
@@ -1,10 +0,0 @@
1
- /**
2
- * Check if type is whole number literal.
3
- * `number` type is false as it can be fractional.
4
- * @see https://itnext.io/implementing-arithmetic-within-typescripts-type-system-a1ef140a6f6f
5
- */
6
- export type IsWhole<N extends number, Then = true, Else = false> = number extends N
7
- ? Else
8
- : `${N}` extends `${number}.${number}`
9
- ? Else
10
- : Then
@@ -1,3 +0,0 @@
1
- import type { IsExtend } from './Extends.js'
2
-
3
- export type IsAny<T, Then = true, Else = false> = boolean extends IsExtend<T, string> ? Then : Else
File without changes