@infra-blocks/types 0.29.0 → 0.30.0-alpha.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.
package/lib/cjs/keys.d.ts CHANGED
@@ -15,6 +15,12 @@ export type ExtendingKeys<T, U> = keyof {
15
15
  export type MapKeys<K, V> = {
16
16
  [k in keyof K]: V;
17
17
  };
18
+ /**
19
+ * Extracts the optional keys of a given type.
20
+ */
21
+ export type OptionalKeys<T> = keyof {
22
+ [Key in keyof T as Omit<T, Key> extends T ? Key : never]: T[Key];
23
+ };
18
24
  /**
19
25
  * A type utility useful to constrain types to have the same keys as M, without imposing
20
26
  * restrictions on the value.
package/lib/esm/keys.d.ts CHANGED
@@ -15,6 +15,12 @@ export type ExtendingKeys<T, U> = keyof {
15
15
  export type MapKeys<K, V> = {
16
16
  [k in keyof K]: V;
17
17
  };
18
+ /**
19
+ * Extracts the optional keys of a given type.
20
+ */
21
+ export type OptionalKeys<T> = keyof {
22
+ [Key in keyof T as Omit<T, Key> extends T ? Key : never]: T[Key];
23
+ };
18
24
  /**
19
25
  * A type utility useful to constrain types to have the same keys as M, without imposing
20
26
  * restrictions on the value.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@infra-blocks/types",
3
- "version": "0.29.0",
3
+ "version": "0.30.0-alpha.0",
4
4
  "description": "Typescript types utility package.",
5
5
  "keywords": [
6
6
  "type",