Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[lodash_v4.x.x] lodash.values generic parameters #3005

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1302,6 +1302,7 @@ declare module "lodash" {
updater?: ?Function,
customizer?: ?Function
): T;
values<K, V>(object?: ?{[K]: V}): Array<V>;
values(object?: ?Object): Array<any>;
valuesIn(object?: ?Object): Array<any>;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import toPairs from "lodash/toPairs";
import toPairsIn from "lodash/toPairsIn";
import unionBy from "lodash/unionBy";
import uniqBy from "lodash/uniqBy";
import values from "lodash/values";
import xorBy from "lodash/xorBy";
import zip from "lodash/zip";
import zipWith from "lodash/zipWith";
Expand Down Expand Up @@ -502,3 +503,9 @@ pairs = toPairsIn({ a: 12, b: 100 });
(omitBy(null, num => num % 2): {});
(omitBy(undefined, num => num % 2): {});
(omitBy({ [1]: 1, [2]: 2 }, num => num === 2): { [prop: number]: number });

/**
* _.values
*/
// $ExpectError values retains the type of value
(values(({ a: 2 }: {[string]: number })): Array<string>);