utilium 0.5.5 → 0.5.6

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
@@ -188,4 +188,8 @@ export type UnionToTuple<T, L = LastOfUnion<T>, N = [T] extends [never] ? true :
188
188
  export type WithRequired<T, K extends keyof T> = T & {
189
189
  [P in K]-?: T[P];
190
190
  };
191
+ /**
192
+ * Makes properties with keys assignable to K in T optional
193
+ */
194
+ export type WithOptional<T, K extends keyof T> = Pick<Partial<T>, K> & Omit<T, K>;
191
195
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "utilium",
3
- "version": "0.5.5",
3
+ "version": "0.5.6",
4
4
  "description": "Typescript utilies",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/src/types.ts CHANGED
@@ -227,3 +227,8 @@ export type UnionToTuple<T, L = LastOfUnion<T>, N = [T] extends [never] ? true :
227
227
  * @see https://stackoverflow.com/a/69328045/17637456
228
228
  */
229
229
  export type WithRequired<T, K extends keyof T> = T & { [P in K]-?: T[P] };
230
+
231
+ /**
232
+ * Makes properties with keys assignable to K in T optional
233
+ */
234
+ export type WithOptional<T, K extends keyof T> = Pick<Partial<T>, K> & Omit<T, K>;