utilium 0.4.1 → 0.4.2

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/dist/types.d.ts CHANGED
@@ -181,4 +181,11 @@ export type LastOfUnion<T> = UnionToIntersection<T extends any ? () => T : never
181
181
  * @see https://stackoverflow.com/a/55128956/17637456
182
182
  */
183
183
  export type UnionToTuple<T, L = LastOfUnion<T>, N = [T] extends [never] ? true : false> = true extends N ? [] : Push<UnionToTuple<Exclude<T, L>>, L>;
184
+ /**
185
+ * Makes properties with keys assignable to K in T required
186
+ * @see https://stackoverflow.com/a/69328045/17637456
187
+ */
188
+ export type WithRequired<T, K extends keyof T> = T & {
189
+ [P in K]-?: T[P];
190
+ };
184
191
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "utilium",
3
- "version": "0.4.1",
3
+ "version": "0.4.2",
4
4
  "description": "Typescript utilies",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/src/types.ts CHANGED
@@ -220,3 +220,9 @@ export type LastOfUnion<T> = UnionToIntersection<T extends any ? () => T : never
220
220
  * @see https://stackoverflow.com/a/55128956/17637456
221
221
  */
222
222
  export type UnionToTuple<T, L = LastOfUnion<T>, N = [T] extends [never] ? true : false> = true extends N ? [] : Push<UnionToTuple<Exclude<T, L>>, L>;
223
+
224
+ /**
225
+ * Makes properties with keys assignable to K in T required
226
+ * @see https://stackoverflow.com/a/69328045/17637456
227
+ */
228
+ export type WithRequired<T, K extends keyof T> = T & { [P in K]-?: T[P] };