@augment-vir/common 29.3.0 → 30.0.1

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 (296) hide show
  1. package/LICENSE-CC0 +121 -0
  2. package/LICENSE-MIT +21 -0
  3. package/README.md +7 -3
  4. package/dist/augments/array/array-map.d.ts +34 -0
  5. package/dist/augments/array/array-map.js +32 -0
  6. package/dist/augments/array/array-to-object.d.ts +53 -0
  7. package/dist/augments/array/array-to-object.js +67 -0
  8. package/dist/augments/array/awaited/awaited-filter.d.ts +36 -0
  9. package/dist/augments/array/awaited/awaited-filter.js +36 -0
  10. package/dist/augments/array/awaited/awaited-for-each.d.ts +31 -0
  11. package/dist/augments/array/awaited/awaited-for-each.js +34 -0
  12. package/dist/augments/array/awaited/awaited-map.d.ts +33 -0
  13. package/dist/augments/array/awaited/awaited-map.js +40 -0
  14. package/dist/augments/array/filter.d.ts +32 -0
  15. package/dist/augments/array/filter.js +74 -0
  16. package/dist/augments/array/remove-duplicates.d.ts +60 -0
  17. package/dist/augments/array/remove-duplicates.js +72 -0
  18. package/dist/augments/array/repeat-array.d.ts +23 -0
  19. package/dist/augments/array/repeat-array.js +25 -0
  20. package/dist/augments/array/shuffle-array.d.ts +9 -0
  21. package/dist/augments/array/shuffle-array.js +17 -0
  22. package/dist/augments/array/string-array.d.ts +9 -0
  23. package/dist/augments/array/string-array.js +11 -0
  24. package/dist/augments/core-exports.d.ts +1 -0
  25. package/dist/augments/core-exports.js +1 -0
  26. package/dist/augments/enum/enum-value-check.d.ts +32 -0
  27. package/dist/augments/enum/enum-value-check.js +34 -0
  28. package/dist/augments/error/combine-errors.d.ts +24 -0
  29. package/dist/augments/error/combine-errors.js +34 -0
  30. package/dist/augments/function/call-asynchronously.d.ts +25 -0
  31. package/dist/augments/function/call-asynchronously.js +26 -0
  32. package/dist/augments/function/call-with-retries.d.ts +24 -0
  33. package/dist/augments/function/call-with-retries.js +50 -0
  34. package/dist/augments/function/debounce.d.ts +89 -0
  35. package/dist/augments/function/debounce.js +112 -0
  36. package/dist/augments/function/execution-duration.d.ts +20 -0
  37. package/dist/augments/function/execution-duration.js +39 -0
  38. package/dist/augments/function/if-truthy.d.ts +28 -0
  39. package/dist/augments/function/if-truthy.js +35 -0
  40. package/dist/{types/augments → augments/function}/wrap-in-try.d.ts +14 -7
  41. package/dist/augments/function/wrap-in-try.js +98 -0
  42. package/dist/augments/json/append-json.d.ts +5 -0
  43. package/dist/augments/json/append-json.js +59 -0
  44. package/dist/augments/json/copy-through-json.d.ts +34 -0
  45. package/dist/augments/json/copy-through-json.js +42 -0
  46. package/dist/augments/json/json-compatible.d.ts +50 -0
  47. package/dist/augments/json/jsonify.d.ts +31 -0
  48. package/dist/augments/json/jsonify.js +33 -0
  49. package/dist/augments/log/log-colors.d.ts +64 -0
  50. package/dist/augments/log/log-colors.js +157 -0
  51. package/dist/augments/log/log-string.d.ts +35 -0
  52. package/dist/augments/log/log-string.js +73 -0
  53. package/dist/augments/log/log-writer.d.ts +30 -0
  54. package/dist/augments/log/log.d.ts +56 -0
  55. package/dist/augments/log/log.js +85 -0
  56. package/dist/augments/log/logger.d.ts +60 -0
  57. package/dist/augments/log/logger.js +59 -0
  58. package/dist/augments/number/clamp.d.ts +18 -0
  59. package/dist/augments/number/clamp.js +19 -0
  60. package/dist/augments/number/coords.d.ts +23 -0
  61. package/dist/augments/number/digit.d.ts +8 -0
  62. package/dist/augments/number/dimensions.d.ts +23 -0
  63. package/dist/augments/number/min-max.d.ts +18 -0
  64. package/dist/augments/number/min-max.js +16 -0
  65. package/dist/augments/number/number-conversion.d.ts +29 -0
  66. package/dist/augments/number/number-conversion.js +56 -0
  67. package/dist/augments/number/round.d.ts +22 -0
  68. package/dist/augments/number/round.js +24 -0
  69. package/dist/augments/number/scientific.d.ts +18 -0
  70. package/dist/augments/number/scientific.js +20 -0
  71. package/dist/augments/number/truncate-number.d.ts +40 -0
  72. package/dist/{esm/augments → augments/number}/truncate-number.js +39 -17
  73. package/dist/augments/number/wrap-number.d.ts +19 -0
  74. package/dist/augments/number/wrap-number.js +28 -0
  75. package/dist/augments/object/diff.d.ts +51 -0
  76. package/dist/augments/object/diff.js +149 -0
  77. package/dist/augments/object/empty.d.ts +9 -0
  78. package/dist/augments/object/get-or-set.d.ts +10 -0
  79. package/dist/augments/object/get-or-set.js +100 -0
  80. package/dist/augments/object/key-count.d.ts +21 -0
  81. package/dist/augments/object/map-entries.d.ts +13 -0
  82. package/dist/augments/object/map-entries.js +80 -0
  83. package/dist/augments/object/map-enum.d.ts +11 -0
  84. package/dist/augments/object/map-enum.js +45 -0
  85. package/dist/augments/object/map-values.d.ts +35 -0
  86. package/dist/augments/object/map-values.js +65 -0
  87. package/dist/{types/augments → augments}/object/merge-deep.d.ts +4 -0
  88. package/dist/{esm/augments → augments}/object/merge-deep.js +9 -6
  89. package/dist/augments/object/merge-defined-properties.d.ts +19 -0
  90. package/dist/augments/object/merge-defined-properties.js +32 -0
  91. package/dist/augments/object/merge-property-arrays.d.ts +29 -0
  92. package/dist/augments/object/merge-property-arrays.js +39 -0
  93. package/dist/augments/object/object-entries.d.ts +31 -0
  94. package/dist/augments/object/object-entries.js +40 -0
  95. package/dist/augments/object/object-filter.d.ts +22 -0
  96. package/dist/augments/object/object-filter.js +27 -0
  97. package/dist/augments/object/object-keys.d.ts +34 -0
  98. package/dist/augments/object/object-keys.js +43 -0
  99. package/dist/augments/object/object-values.d.ts +11 -0
  100. package/dist/augments/object/object-values.js +13 -0
  101. package/dist/augments/path/esm-path.d.ts +26 -0
  102. package/dist/augments/path/esm-path.js +31 -0
  103. package/dist/augments/prisma/prisma-models.d.ts +143 -0
  104. package/dist/augments/prisma/prisma-models.js +1 -0
  105. package/dist/augments/promise/timed-promise.d.ts +22 -0
  106. package/dist/augments/promise/timed-promise.js +51 -0
  107. package/dist/augments/random/random-boolean.d.ts +24 -0
  108. package/dist/augments/random/random-boolean.js +32 -0
  109. package/dist/augments/random/random-integer.d.ts +14 -0
  110. package/dist/augments/random/random-integer.js +34 -0
  111. package/dist/augments/random/random-string.d.ts +18 -0
  112. package/dist/augments/random/random-string.js +67 -0
  113. package/dist/augments/regexp/match.d.ts +10 -0
  114. package/dist/augments/regexp/match.js +13 -0
  115. package/dist/augments/regexp/regexp-flags.d.ts +56 -0
  116. package/dist/augments/regexp/regexp-flags.js +75 -0
  117. package/dist/augments/regexp/regexp-string.d.ts +9 -0
  118. package/dist/augments/regexp/regexp-string.js +11 -0
  119. package/dist/augments/selection-set/select-collapsed.d.ts +54 -0
  120. package/dist/augments/selection-set/select-collapsed.js +63 -0
  121. package/dist/augments/selection-set/select-from.d.ts +48 -0
  122. package/dist/augments/selection-set/select-from.js +72 -0
  123. package/dist/augments/selection-set/selection-set.d.ts +37 -0
  124. package/dist/augments/selection-set/selection-set.js +1 -0
  125. package/dist/augments/string/casing/capitalization.d.ts +17 -0
  126. package/dist/augments/string/casing/capitalization.js +25 -0
  127. package/dist/augments/string/casing/casing.d.ts +73 -0
  128. package/dist/augments/string/casing/casing.js +65 -0
  129. package/dist/augments/string/casing/kebab-and-camel.d.ts +17 -0
  130. package/dist/augments/string/casing/kebab-and-camel.js +57 -0
  131. package/dist/augments/string/comma.d.ts +26 -0
  132. package/dist/augments/string/comma.js +48 -0
  133. package/dist/augments/string/join.d.ts +21 -0
  134. package/dist/augments/string/join.js +34 -0
  135. package/dist/augments/string/prefix.d.ts +30 -0
  136. package/dist/augments/string/prefix.js +30 -0
  137. package/dist/augments/string/remove-duplicate-characters.d.ts +17 -0
  138. package/dist/augments/string/remove-duplicate-characters.js +22 -0
  139. package/dist/augments/string/replace.d.ts +18 -0
  140. package/dist/augments/string/replace.js +22 -0
  141. package/dist/augments/string/split.d.ts +31 -0
  142. package/dist/augments/string/split.js +53 -0
  143. package/dist/augments/string/substring-index.d.ts +19 -0
  144. package/dist/augments/string/substring-index.js +47 -0
  145. package/dist/augments/string/suffix.d.ts +96 -0
  146. package/dist/augments/string/suffix.js +89 -0
  147. package/dist/augments/string/white-space.d.ts +12 -0
  148. package/dist/augments/string/white-space.js +19 -0
  149. package/dist/augments/string/wrap-string.d.ts +19 -0
  150. package/dist/augments/string/wrap-string.js +20 -0
  151. package/dist/augments/type/ensure-type.d.ts +12 -0
  152. package/dist/augments/type/ensure-type.js +14 -0
  153. package/dist/augments/type/readonly.d.ts +9 -0
  154. package/dist/augments/type/readonly.js +10 -0
  155. package/dist/augments/type/type-recursion.d.ts +253 -0
  156. package/dist/augments/type/type-recursion.js +1 -0
  157. package/dist/augments/type/union.d.ts +1 -0
  158. package/dist/augments/type/union.js +1 -0
  159. package/dist/augments/type/void-type.d.ts +9 -0
  160. package/dist/augments/type/void-type.js +1 -0
  161. package/dist/augments/type/writable.d.ts +10 -0
  162. package/dist/augments/type/writable.js +10 -0
  163. package/dist/index.d.ts +83 -0
  164. package/dist/index.js +83 -0
  165. package/package.json +43 -15
  166. package/dist/cjs/augments/ansi.js +0 -27
  167. package/dist/cjs/augments/array/array.js +0 -68
  168. package/dist/cjs/augments/array/remove-duplicates.js +0 -16
  169. package/dist/cjs/augments/async.js +0 -28
  170. package/dist/cjs/augments/boolean.js +0 -19
  171. package/dist/cjs/augments/common-number.js +0 -112
  172. package/dist/cjs/augments/common-string.js +0 -245
  173. package/dist/cjs/augments/debounce.js +0 -38
  174. package/dist/cjs/augments/environment.js +0 -6
  175. package/dist/cjs/augments/error.js +0 -52
  176. package/dist/cjs/augments/esm-path.js +0 -11
  177. package/dist/cjs/augments/function.js +0 -2
  178. package/dist/cjs/augments/json-compatible.js +0 -2
  179. package/dist/cjs/augments/json.js +0 -28
  180. package/dist/cjs/augments/object/any-object.js +0 -2
  181. package/dist/cjs/augments/object/enum.js +0 -48
  182. package/dist/cjs/augments/object/filter-object.js +0 -26
  183. package/dist/cjs/augments/object/get-or-set.js +0 -40
  184. package/dist/cjs/augments/object/has-key.js +0 -6
  185. package/dist/cjs/augments/object/jsonify.js +0 -6
  186. package/dist/cjs/augments/object/key-count.js +0 -2
  187. package/dist/cjs/augments/object/map-object.js +0 -61
  188. package/dist/cjs/augments/object/merge-deep.js +0 -52
  189. package/dist/cjs/augments/object/merge-property-arrays.js +0 -14
  190. package/dist/cjs/augments/object/object-entries.js +0 -40
  191. package/dist/cjs/augments/object/object.js +0 -18
  192. package/dist/cjs/augments/object/pick-deep.js +0 -2
  193. package/dist/cjs/augments/object/selection-set.js +0 -56
  194. package/dist/cjs/augments/object/typed-has-property.js +0 -29
  195. package/dist/cjs/augments/promise/deferred-promise.js +0 -31
  196. package/dist/cjs/augments/promise/promise.js +0 -79
  197. package/dist/cjs/augments/promise/wait.js +0 -66
  198. package/dist/cjs/augments/random.js +0 -118
  199. package/dist/cjs/augments/regexp.js +0 -19
  200. package/dist/cjs/augments/string/prefixes.js +0 -20
  201. package/dist/cjs/augments/string/suffixes.js +0 -40
  202. package/dist/cjs/augments/string/uuid.js +0 -13
  203. package/dist/cjs/augments/time.js +0 -35
  204. package/dist/cjs/augments/truncate-number.js +0 -153
  205. package/dist/cjs/augments/tuple.js +0 -20
  206. package/dist/cjs/augments/type-recursion.js +0 -2
  207. package/dist/cjs/augments/type.js +0 -36
  208. package/dist/cjs/augments/union.js +0 -2
  209. package/dist/cjs/augments/wrap-in-try.js +0 -37
  210. package/dist/cjs/index.js +0 -60
  211. package/dist/esm/augments/ansi.js +0 -24
  212. package/dist/esm/augments/array/array.js +0 -57
  213. package/dist/esm/augments/array/remove-duplicates.js +0 -13
  214. package/dist/esm/augments/async.js +0 -23
  215. package/dist/esm/augments/boolean.js +0 -14
  216. package/dist/esm/augments/common-number.js +0 -100
  217. package/dist/esm/augments/common-string.js +0 -227
  218. package/dist/esm/augments/debounce.js +0 -34
  219. package/dist/esm/augments/environment.js +0 -3
  220. package/dist/esm/augments/error.js +0 -45
  221. package/dist/esm/augments/esm-path.js +0 -8
  222. package/dist/esm/augments/json.js +0 -24
  223. package/dist/esm/augments/object/enum.js +0 -41
  224. package/dist/esm/augments/object/filter-object.js +0 -21
  225. package/dist/esm/augments/object/get-or-set.js +0 -36
  226. package/dist/esm/augments/object/has-key.js +0 -3
  227. package/dist/esm/augments/object/jsonify.js +0 -3
  228. package/dist/esm/augments/object/map-object.js +0 -57
  229. package/dist/esm/augments/object/merge-property-arrays.js +0 -11
  230. package/dist/esm/augments/object/object-entries.js +0 -32
  231. package/dist/esm/augments/object/object.js +0 -14
  232. package/dist/esm/augments/object/selection-set.js +0 -52
  233. package/dist/esm/augments/object/typed-has-property.js +0 -25
  234. package/dist/esm/augments/promise/deferred-promise.js +0 -28
  235. package/dist/esm/augments/promise/promise.js +0 -71
  236. package/dist/esm/augments/promise/wait.js +0 -60
  237. package/dist/esm/augments/random.js +0 -113
  238. package/dist/esm/augments/regexp.js +0 -14
  239. package/dist/esm/augments/string/prefixes.js +0 -16
  240. package/dist/esm/augments/string/suffixes.js +0 -31
  241. package/dist/esm/augments/string/uuid.js +0 -9
  242. package/dist/esm/augments/time.js +0 -31
  243. package/dist/esm/augments/tuple.js +0 -16
  244. package/dist/esm/augments/type.js +0 -30
  245. package/dist/esm/augments/wrap-in-try.js +0 -34
  246. package/dist/esm/index.js +0 -44
  247. package/dist/types/augments/ansi.d.ts +0 -1
  248. package/dist/types/augments/array/array.d.ts +0 -26
  249. package/dist/types/augments/array/remove-duplicates.d.ts +0 -1
  250. package/dist/types/augments/async.d.ts +0 -14
  251. package/dist/types/augments/boolean.d.ts +0 -6
  252. package/dist/types/augments/common-number.d.ts +0 -52
  253. package/dist/types/augments/common-string.d.ts +0 -74
  254. package/dist/types/augments/debounce.d.ts +0 -15
  255. package/dist/types/augments/environment.d.ts +0 -1
  256. package/dist/types/augments/error.d.ts +0 -9
  257. package/dist/types/augments/esm-path.d.ts +0 -4
  258. package/dist/types/augments/function.d.ts +0 -25
  259. package/dist/types/augments/json-compatible.d.ts +0 -22
  260. package/dist/types/augments/json.d.ts +0 -9
  261. package/dist/types/augments/object/any-object.d.ts +0 -2
  262. package/dist/types/augments/object/enum.d.ts +0 -8
  263. package/dist/types/augments/object/filter-object.d.ts +0 -4
  264. package/dist/types/augments/object/get-or-set.d.ts +0 -26
  265. package/dist/types/augments/object/has-key.d.ts +0 -1
  266. package/dist/types/augments/object/jsonify.d.ts +0 -2
  267. package/dist/types/augments/object/key-count.d.ts +0 -13
  268. package/dist/types/augments/object/map-object.d.ts +0 -20
  269. package/dist/types/augments/object/merge-property-arrays.d.ts +0 -1
  270. package/dist/types/augments/object/object-entries.d.ts +0 -8
  271. package/dist/types/augments/object/object.d.ts +0 -21
  272. package/dist/types/augments/object/pick-deep.d.ts +0 -14
  273. package/dist/types/augments/object/selection-set.d.ts +0 -27
  274. package/dist/types/augments/object/typed-has-property.d.ts +0 -7
  275. package/dist/types/augments/promise/deferred-promise.d.ts +0 -8
  276. package/dist/types/augments/promise/promise.d.ts +0 -15
  277. package/dist/types/augments/promise/wait.d.ts +0 -18
  278. package/dist/types/augments/random.d.ts +0 -37
  279. package/dist/types/augments/regexp.d.ts +0 -3
  280. package/dist/types/augments/string/prefixes.d.ts +0 -9
  281. package/dist/types/augments/string/suffixes.d.ts +0 -17
  282. package/dist/types/augments/string/uuid.d.ts +0 -5
  283. package/dist/types/augments/time.d.ts +0 -14
  284. package/dist/types/augments/truncate-number.d.ts +0 -19
  285. package/dist/types/augments/tuple.d.ts +0 -17
  286. package/dist/types/augments/type-recursion.d.ts +0 -161
  287. package/dist/types/augments/type.d.ts +0 -69
  288. package/dist/types/augments/union.d.ts +0 -5
  289. package/dist/types/index.d.ts +0 -44
  290. /package/dist/{esm/augments → augments/json}/json-compatible.js +0 -0
  291. /package/dist/{esm/augments/function.js → augments/log/log-writer.js} +0 -0
  292. /package/dist/{esm/augments/object/any-object.js → augments/number/coords.js} +0 -0
  293. /package/dist/{esm/augments/object/key-count.js → augments/number/digit.js} +0 -0
  294. /package/dist/{esm/augments/object/pick-deep.js → augments/number/dimensions.js} +0 -0
  295. /package/dist/{esm/augments/type-recursion.js → augments/object/empty.js} +0 -0
  296. /package/dist/{esm/augments/union.js → augments/object/key-count.js} +0 -0
@@ -1,161 +0,0 @@
1
- type TsRecursionArray = [
2
- 1,
3
- 2,
4
- 3,
5
- 4,
6
- 5,
7
- 6,
8
- 7,
9
- 8,
10
- 9,
11
- 10,
12
- 11,
13
- 12,
14
- 13,
15
- 14,
16
- 15,
17
- 16,
18
- 17,
19
- 18,
20
- 19,
21
- 20,
22
- 21,
23
- 22,
24
- 23,
25
- 24,
26
- 25,
27
- 26,
28
- 27,
29
- 28,
30
- 29,
31
- 30,
32
- 31,
33
- 32,
34
- 33,
35
- 34,
36
- 35,
37
- 36,
38
- 37,
39
- 38,
40
- 39,
41
- 40,
42
- 41,
43
- 42,
44
- 43,
45
- 44,
46
- 45,
47
- 46,
48
- 47,
49
- 48,
50
- 49,
51
- 50,
52
- 51,
53
- 52,
54
- 53,
55
- 54,
56
- 55,
57
- 56,
58
- 57,
59
- 58,
60
- 59,
61
- 60,
62
- 61,
63
- 62,
64
- 63,
65
- 64,
66
- 65,
67
- 66,
68
- 67,
69
- 68,
70
- 69,
71
- 70,
72
- 71,
73
- 72,
74
- 73,
75
- 74,
76
- 75,
77
- 76,
78
- 77,
79
- 78,
80
- 79,
81
- 80,
82
- 81,
83
- 82,
84
- 83,
85
- 84,
86
- 85,
87
- 86,
88
- 87,
89
- 88,
90
- 89,
91
- 90,
92
- 91,
93
- 92,
94
- 93,
95
- 94,
96
- 95,
97
- 96,
98
- 97,
99
- 98,
100
- 99,
101
- 100,
102
- 101,
103
- 102,
104
- 103,
105
- 104,
106
- 105,
107
- 106,
108
- 107,
109
- 108,
110
- 109,
111
- 110,
112
- 111,
113
- 112,
114
- 113,
115
- 114,
116
- 115,
117
- 116,
118
- 117,
119
- 118,
120
- 119,
121
- 120,
122
- 121,
123
- 122,
124
- 123,
125
- 124,
126
- 125,
127
- 126,
128
- 127,
129
- 128,
130
- 129,
131
- 130,
132
- 131,
133
- 132,
134
- 133,
135
- 134,
136
- 135,
137
- 136,
138
- 137,
139
- 138,
140
- 139,
141
- 140,
142
- 141,
143
- 142,
144
- 143,
145
- 144,
146
- 145,
147
- 146,
148
- 147,
149
- 148,
150
- 149,
151
- 150
152
- ];
153
- export type TsRecursionTracker = keyof TsRecursionArray;
154
- /**
155
- * Through experimentation on Typescript version 5.4.5, this is the maximum recursion depth we can
156
- * go to before TypeScript will block recursive types.
157
- */
158
- export type TsTooMuchRecursion = 91;
159
- export type TsRecursionStart = 0;
160
- export type TsRecurse<CurrentRecursion extends TsRecursionTracker> = TsRecursionArray[CurrentRecursion] extends TsRecursionTracker ? TsRecursionArray[CurrentRecursion] : TsTooMuchRecursion;
161
- export {};
@@ -1,69 +0,0 @@
1
- import { Except, Simplify } from 'type-fest';
2
- /** Makes all properties in an object writable. This is the opposite of Readonly<> */
3
- export type Writeable<T> = {
4
- -readonly [P in keyof T]: T[P];
5
- };
6
- /** Makes all property values in an object also readonly. Can cause issues on primitive. */
7
- export type DeepWriteable<T> = {
8
- -readonly [P in keyof T]: DeepWriteable<T[P]>;
9
- };
10
- /** Replace properties in T with properties in U. */
11
- export type Overwrite<T, U> = Pick<T, Exclude<keyof T, keyof U>> & U;
12
- /**
13
- * Require that the NonVoid parameter is not void. If it is void, the ErrorType or an error string
14
- * type is returned. If it not void, the given SuccessType is returned.
15
- */
16
- export type RequireNonVoid<NonVoid, SuccessType, ErrorType = 'Input should not be void'> = void extends NonVoid ? (NonVoid extends void ? ErrorType : SuccessType) : SuccessType;
17
- /** Extract the element type out of an array type. */
18
- export type ArrayElement<ArrayType extends ReadonlyArray<any>> = ArrayType[number];
19
- /**
20
- * Same as the Required<> built-in type helper but this requires that each property be present and
21
- * be not null.
22
- */
23
- export type RequiredAndNotNull<T> = {
24
- [P in keyof T]-?: NonNullable<T[P]>;
25
- };
26
- export type SetOptionalAndNullable<OriginalObjectGeneric, OptionalKeysGeneric extends keyof OriginalObjectGeneric> = Simplify<Except<OriginalObjectGeneric, OptionalKeysGeneric> & {
27
- [PropKey in OptionalKeysGeneric]?: OriginalObjectGeneric[PropKey] | null | undefined;
28
- }>;
29
- /** Require only a subset of object properties. */
30
- export type RequiredBy<T, K extends keyof T> = Overwrite<T, Required<Pick<T, K>>>;
31
- export declare function makeWritable<T>(input: T): Writeable<T>;
32
- export declare function makeReadonly<T>(input: T): Readonly<T>;
33
- /**
34
- * Require only a subset of object properties and require that they be not null. This is
35
- * particularly useful in conjunction with the "exactOptionalPropertyTypes" tsconfig flag.
36
- */
37
- export type RequiredAndNotNullBy<T, K extends keyof T> = Omit<T, K> & Required<{
38
- [PropertyName in K]: NonNullable<T[PropertyName]>;
39
- }>;
40
- /** If type T = type U, then type Y. Else type N. */
41
- export type IfEquals<T, U, Y = unknown, N = never> = (<G>() => G extends T ? 1 : 2) extends <G>() => G extends U ? 1 : 2 ? Y : N;
42
- /**
43
- * This function returns another function that simply returns whatever input it's given. However, it
44
- * also checks that the input matches the original wrapNarrowTypeWithTypeCheck's generic, while
45
- * maintaining strict "const" like typing.
46
- *
47
- * Use like this: wrapNarrowTypeWithTypeCheck<EnforcedTypeHere>()(valueToEnforceTypeOn as const)
48
- *
49
- * Sometimes "as const" isn't required, usually it is for any object or array though.
50
- */
51
- export declare function wrapNarrowTypeWithTypeCheck<P>(): <T extends P>(input: T) => Readonly<T>;
52
- /**
53
- * This type helper is useful for forcing function generics to be explicitly provided, rather than
54
- * inferring them from the given inputs. See the test file for examples.
55
- */
56
- export type NoInfer<T> = [T][T extends any ? 0 : never];
57
- /**
58
- * This is a type helper that ensures the given input matches the given generic type. The generic is
59
- * setup in such a way that if it is omitted (which is typically allowed in TypeScript, resulting in
60
- * the generic being inferred from the inputs), there will actually be a type error. This forces
61
- * each usage of this function to explicitly specify the generic, thus giving us type safety for the
62
- * input.
63
- */
64
- export declare function ensureType<ExpectedType = never>(input: NoInfer<ExpectedType>): NoInfer<ExpectedType>;
65
- /** Picks only the public properties of a type. */
66
- export type Public<T> = {
67
- [P in keyof T]: T[P];
68
- };
69
- export type Digit = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9;
@@ -1,5 +0,0 @@
1
- /**
2
- * This is the version of UnionToIntersection from type-fest v4.3.3. In version 4.4.0 type-fest
3
- * changed this type helper and it broke how we're using it.
4
- */
5
- export type UnionToIntersection<Union> = (Union extends unknown ? (distributedUnion: Union) => void : never) extends (mergedIntersection: infer Intersection) => void ? Intersection : never;
@@ -1,44 +0,0 @@
1
- export * from './augments/ansi';
2
- export * from './augments/array/array';
3
- export * from './augments/array/remove-duplicates';
4
- export * from './augments/async';
5
- export * from './augments/boolean';
6
- export * from './augments/common-number';
7
- export * from './augments/common-string';
8
- export * from './augments/debounce';
9
- export * from './augments/environment';
10
- export * from './augments/error';
11
- export * from './augments/esm-path';
12
- export * from './augments/function';
13
- export * from './augments/json';
14
- export * from './augments/json-compatible';
15
- export * from './augments/object/any-object';
16
- export * from './augments/object/enum';
17
- export * from './augments/object/filter-object';
18
- export * from './augments/object/get-or-set';
19
- export * from './augments/object/has-key';
20
- export * from './augments/object/jsonify';
21
- export * from './augments/object/key-count';
22
- export * from './augments/object/map-object';
23
- export * from './augments/object/merge-deep';
24
- export * from './augments/object/merge-property-arrays';
25
- export * from './augments/object/object';
26
- export * from './augments/object/object-entries';
27
- export * from './augments/object/pick-deep';
28
- export * from './augments/object/selection-set';
29
- export * from './augments/object/typed-has-property';
30
- export * from './augments/promise/deferred-promise';
31
- export * from './augments/promise/promise';
32
- export * from './augments/promise/wait';
33
- export * from './augments/random';
34
- export * from './augments/regexp';
35
- export * from './augments/string/prefixes';
36
- export * from './augments/string/suffixes';
37
- export * from './augments/string/uuid';
38
- export * from './augments/time';
39
- export * from './augments/truncate-number';
40
- export * from './augments/tuple';
41
- export * from './augments/type';
42
- export * from './augments/type-recursion';
43
- export * from './augments/union';
44
- export * from './augments/wrap-in-try';