UNPKG

1.3 kBTypeScriptView Raw
1import { Length } from './Length';
2import { Pos } from '../Iteration/Pos';
3import { Next } from '../Iteration/Next';
4import { IterationOf } from '../Iteration/IterationOf';
5import { Iteration } from '../Iteration/Iteration';
6import { Cast } from '../Any/Cast';
7import { Record } from '../Object/Record';
8import { Key } from '../Any/Key';
9import { List } from './List';
10import { Naked } from './_Internal';
11import { Extends } from '../Any/Extends';
12import { PatchFlat } from '../Object/Patch';
13/**
14 * @hidden
15 */
16declare type __ZipObj<LKeys extends List<Key>, LFields extends List, O extends object = {}, I extends Iteration = IterationOf<0>> = {
17 0: __ZipObj<LKeys, LFields, PatchFlat<O, Record<LKeys[Pos<I>], LFields[Pos<I>]>>, Next<I>>;
18 1: O;
19}[Extends<Pos<I>, Length<LKeys>>];
20/**
21 * @hidden
22 */
23export declare type _ZipObj<LKeys extends List<Key>, LFields extends List> = __ZipObj<Naked<LKeys>, LFields> extends infer X ? Cast<X, object> : never;
24/**
25 * Create an [[Object]] from [[List]]s of keys & fields
26 * @param LKeys its keys
27 * @param LFields its fields
28 * @returns [[Object]]
29 * @example
30 * ```ts
31 * ```
32 */
33export declare type ZipObj<LKeys extends List<Key>, LFields extends List> = LKeys extends unknown ? LFields extends unknown ? _ZipObj<LKeys, LFields> : never : never;
34export {};