ramda: add number key type to zipObj (#35717)

* ramda: add number key type to zipObj

* Add tests for zipObj

* Remove trailing whitespace

* Remove trailing whitespace
This commit is contained in:
Alex 2019-05-29 00:14:52 +05:00 committed by Sheetal Nandi
parent 4673dba6fe
commit 37b081e89f
2 changed files with 4 additions and 0 deletions

View File

@ -3131,6 +3131,8 @@ declare namespace R {
// TODO: Dictionary<T> as a return value is to specific, any seems to loose
zipObj<T>(keys: ReadonlyArray<string>, values: ReadonlyArray<T>): { [index: string]: T };
zipObj(keys: ReadonlyArray<string>): <T>(values: ReadonlyArray<T>) => { [index: string]: T };
zipObj<T>(keys: ReadonlyArray<number>, values: ReadonlyArray<T>): { [index: number]: T };
zipObj(keys: ReadonlyArray<number>): <T>(values: ReadonlyArray<T>) => { [index: number]: T };
/**
* Creates a new list out of the two supplied by applying the function to each

View File

@ -1582,6 +1582,8 @@ type Pair = KeyValuePair<string, number>;
() => {
R.zipObj(["a", "b", "c"], [1, 2, 3]); // => {a: 1, b: 2, c: 3}
R.zipObj(["a", "b", "c"])([1, 2, 3]); // => {a: 1, b: 2, c: 3}
R.zipObj([1, 2, 3], ['a', 'b', 'c']); // => {1: 'a', 2: 'b', 3: 'c'}
R.zipObj([1, 2, 3])(['a', 'b', 'c']); // => {1: 'a', 2: 'b', 3: 'c'}
};
() => {