Skip to content

Commit

Permalink
fix: use keys can only be strings
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Faust committed Jan 11, 2019
1 parent 5904ad0 commit 6504d0a
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,10 @@ export function sortByDesc(values: any, iteratees: any) {
}

export function orderBy(values: Iterable<{}>, iteratees: string[], orders: string[]) {
const columns = fast.map(iteratees, (_: string, i: number) => ({ [orders[i]]: iteratees[i] }));

return sort(values).by(columns);
return sort(values).by(fast.map(iteratees, (_: string, i: number) => ({ [orders[i]]: iteratees[i] })));
}

export function pick(values: Iterable<{}>, key: string | number) {
export function pick(values: Iterable<{}>, key: string) {
return fast.map(values, (i: number) => i[key]);
}

Expand Down

0 comments on commit 6504d0a

Please sign in to comment.