@travetto/runtime 8.0.0-alpha.21 → 8.0.0-alpha.22

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 +2 -2
  2. package/src/types.ts +5 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@travetto/runtime",
3
- "version": "8.0.0-alpha.21",
3
+ "version": "8.0.0-alpha.22",
4
4
  "type": "module",
5
5
  "description": "Runtime for travetto applications.",
6
6
  "keywords": [
@@ -31,7 +31,7 @@
31
31
  "debug": "^4.4.3"
32
32
  },
33
33
  "peerDependencies": {
34
- "@travetto/transformer": "^8.0.0-alpha.15",
34
+ "@travetto/transformer": "^8.0.0-alpha.17",
35
35
  "temporal-polyfill-lite": "^0.4.0"
36
36
  },
37
37
  "peerDependenciesMeta": {
package/src/types.ts CHANGED
@@ -33,20 +33,22 @@ export type ValidFields<T, I> = {
33
33
 
34
34
  export type RetainIntrinsicFields<T> = Pick<T, ValidFields<T, IntrinsicType>>;
35
35
 
36
- export type KeyPaths<T, PrimitiveType = IntrinsicType | IntrinsicType[], PREFIX extends string = '', SEP extends string = '.'> = {
36
+ type KeyPathsInner<T, PrimitiveType = IntrinsicType | IntrinsicType[], PREFIX extends string = '', SEP extends string = '.'> = {
37
37
  [K in keyof T]: K extends string
38
38
  ? T[K] extends IntrinsicType[] | IntrinsicType | undefined
39
39
  ? T[K] extends PrimitiveType
40
40
  ? `${PREFIX}${K}`
41
41
  : never
42
42
  : T[K] extends Any[]
43
- ? KeyPaths<T[K][number], PrimitiveType, `${K}${SEP}`, SEP>
43
+ ? KeyPathsInner<T[K][number], PrimitiveType, `${K}${SEP}`, SEP>
44
44
  : T[K] extends object
45
- ? KeyPaths<T[K], PrimitiveType, `${K}${SEP}`, SEP>
45
+ ? KeyPathsInner<T[K], PrimitiveType, `${K}${SEP}`, SEP>
46
46
  : never
47
47
  : never;
48
48
  }[keyof T];
49
49
 
50
+ export type KeyPaths<T, PrimitiveType = IntrinsicType | IntrinsicType[]> = KeyPathsInner<Required<T>, PrimitiveType>;
51
+
50
52
  export const TypedObject: {
51
53
  keys<T = unknown, K extends keyof T = keyof T & string>(value: T): K[];
52
54
  fromEntries<K extends string | symbol, V>(items: ([K, V] | readonly [K, V])[]): Record<K, V>;