| 1 | /**
|
|---|
| 2 | * Combines two arrays, one of property names and one of corresponding values, into a single object.
|
|---|
| 3 | *
|
|---|
| 4 | * @template T - The type of values in the values array
|
|---|
| 5 | * @param {ArrayLike<PropertyKey>} props - An array of property names
|
|---|
| 6 | * @param {ArrayLike<T>} values - An array of values corresponding to the property names
|
|---|
| 7 | * @returns {Record<string, T>} A new object composed of the given property names and values
|
|---|
| 8 | *
|
|---|
| 9 | * @example
|
|---|
| 10 | * const props = ['a', 'b', 'c'];
|
|---|
| 11 | * const values = [1, 2, 3];
|
|---|
| 12 | * zipObject(props, values);
|
|---|
| 13 | * // => { a: 1, b: 2, c: 3 }
|
|---|
| 14 | */
|
|---|
| 15 | declare function zipObject<T>(props: ArrayLike<PropertyKey>, values: ArrayLike<T>): Record<string, T>;
|
|---|
| 16 | /**
|
|---|
| 17 | * Creates an object from an array of property names, with undefined values.
|
|---|
| 18 | *
|
|---|
| 19 | * @param {ArrayLike<PropertyKey>} [props] - An array of property names
|
|---|
| 20 | * @returns {Record<string, undefined>} A new object with the given property names and undefined values
|
|---|
| 21 | *
|
|---|
| 22 | * @example
|
|---|
| 23 | * const props = ['a', 'b', 'c'];
|
|---|
| 24 | * zipObject(props);
|
|---|
| 25 | * // => { a: undefined, b: undefined, c: undefined }
|
|---|
| 26 | */
|
|---|
| 27 | declare function zipObject(props?: ArrayLike<PropertyKey>): Record<string, undefined>;
|
|---|
| 28 |
|
|---|
| 29 | export { zipObject };
|
|---|