main
Last change
on this file since d24f17c was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago |
Initial commit
|
-
Property mode
set to
100644
|
File size:
1010 bytes
|
Rev | Line | |
---|
[d24f17c] | 1 | import { Key } from '../../Any/Key';
|
---|
| 2 | import { Merge as OMerge } from '../Merge';
|
---|
| 3 | import { List } from '../../List/List';
|
---|
| 4 | import { BuiltIn } from '../../Misc/BuiltIn';
|
---|
| 5 | import { Tail } from '../../List/Tail';
|
---|
| 6 | import { Depth } from '../_Internal';
|
---|
| 7 | /**
|
---|
| 8 | * @hidden
|
---|
| 9 | */
|
---|
| 10 | declare type MergeAt<O, Path extends List<Key>, O1, depth extends Depth> = O extends BuiltIn ? O : Path extends [] ? O extends List ? OMerge<O, O1 & {}, depth> : O extends object ? OMerge<O, O1 & {}, depth> : O : {
|
---|
| 11 | [K in keyof O]: K extends Path[0] ? MergeAt<O[K], Tail<Path>, O1, depth> : O[K];
|
---|
| 12 | };
|
---|
| 13 | /**
|
---|
| 14 | * Complete the fields of `O` at `Path` with the ones of `O1`
|
---|
| 15 | * @param O to complete
|
---|
| 16 | * @param Path to be followed
|
---|
| 17 | * @param O1 to copy from
|
---|
| 18 | * @param depth (?=`'flat'`) 'deep' to do it deeply
|
---|
| 19 | * @returns [[Object]]
|
---|
| 20 | * @example
|
---|
| 21 | * ```ts
|
---|
| 22 | * ```
|
---|
| 23 | */
|
---|
| 24 | export declare type Merge<O extends object, Path extends List<Key>, O1 extends object, depth extends Depth = 'flat'> = Path extends unknown ? MergeAt<O, Path, O1, depth> : never;
|
---|
| 25 | export {};
|
---|
Note:
See
TracBrowser
for help on using the repository browser.