@travetto/runtime 8.0.0-alpha.21 → 8.0.0-alpha.23
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/package.json +3 -3
- 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.
|
|
3
|
+
"version": "8.0.0-alpha.23",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Runtime for travetto applications.",
|
|
6
6
|
"keywords": [
|
|
@@ -26,12 +26,12 @@
|
|
|
26
26
|
"directory": "module/runtime"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@travetto/manifest": "^8.0.0-alpha.
|
|
29
|
+
"@travetto/manifest": "^8.0.0-alpha.12",
|
|
30
30
|
"@types/debug": "^4.1.13",
|
|
31
31
|
"debug": "^4.4.3"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
|
-
"@travetto/transformer": "^8.0.0-alpha.
|
|
34
|
+
"@travetto/transformer": "^8.0.0-alpha.18",
|
|
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
|
-
|
|
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
|
-
?
|
|
43
|
+
? KeyPathsInner<T[K][number], PrimitiveType, `${K}${SEP}`, SEP>
|
|
44
44
|
: T[K] extends object
|
|
45
|
-
?
|
|
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>;
|