@nu-art/ts-common 0.203.7 → 0.203.8

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 (2) hide show
  1. package/package.json +1 -1
  2. package/utils/types.d.ts +9 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nu-art/ts-common",
3
- "version": "0.203.7",
3
+ "version": "0.203.8",
4
4
  "description": "js and ts infra",
5
5
  "keywords": [
6
6
  "TacB0sS",
package/utils/types.d.ts CHANGED
@@ -223,3 +223,12 @@ export type Exact<T> = {
223
223
  } & {
224
224
  [K: string]: never;
225
225
  };
226
+ /**
227
+ * Makes an optional property of another type mandatory.
228
+ *
229
+ * @typeParam T - The original type.
230
+ * @typeParam K - The key that should be mandatory.
231
+ * */
232
+ export type WithRequired<T, K extends keyof T> = T & {
233
+ [P in K]-?: T[P];
234
+ };