@augment-vir/common 28.2.3 → 28.2.4
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.
|
@@ -12,7 +12,7 @@ export type NestedKeys<ObjectGeneric extends object, Depth extends TsRecursionTr
|
|
|
12
12
|
keyof ObjectGeneric,
|
|
13
13
|
...(NestedKeys<UnionToIntersection<Extract<PropertyValueType<ObjectGeneric>, object>>, TsRecurse<Depth>> | [])
|
|
14
14
|
] : [keyof ObjectGeneric];
|
|
15
|
-
export type NestedValue<ObjectGeneric extends object, NestedKeysGeneric extends NestedSequentialKeys<ObjectGeneric
|
|
15
|
+
export type NestedValue<ObjectGeneric extends object, NestedKeysGeneric extends NestedSequentialKeys<ObjectGeneric>, Depth extends TsRecursionTracker = TsRecursionStart> = ObjectGeneric extends ReadonlyArray<any> ? NestedValue<Extract<ObjectGeneric[number], object>, NestedKeysGeneric, TsRecurse<Depth>>[] : NestedKeysGeneric extends readonly [infer FirstEntry, ...infer FollowingEntries] ? FirstEntry extends keyof ObjectGeneric ? FollowingEntries extends never[] ? ObjectGeneric[FirstEntry] : ObjectGeneric[FirstEntry] extends object ? FollowingEntries extends NestedSequentialKeys<ObjectGeneric[FirstEntry]> ? NestedValue<ObjectGeneric[FirstEntry], FollowingEntries, TsRecurse<Depth>> : never : never : never : never;
|
|
16
16
|
/** This mutates the {@link originalObject} input. */
|
|
17
17
|
export declare function setValueWithNestedKeys<const ObjectGeneric extends object, const KeysGeneric extends NestedSequentialKeys<ObjectGeneric>>(originalObject: ObjectGeneric, nestedKeys: Readonly<KeysGeneric>, value: Readonly<NestedValue<ObjectGeneric, KeysGeneric>>): void;
|
|
18
18
|
export declare function getValueFromNestedKeys<const ObjectGeneric extends object, const KeysGeneric extends NestedSequentialKeys<ObjectGeneric>>(originalObject: ObjectGeneric, nestedKeys: KeysGeneric): NestedValue<ObjectGeneric, KeysGeneric>;
|