Skip to content

Commit

Permalink
Fixes for underscore.d.ts
Browse files Browse the repository at this point in the history
* the type of elements in the array returned by pluck have no correlation to the type of elements in the source array - they actually relate to the values of the provided property name
* bind wasn't working for a function typed as "Function".  In our use case, we call _.throttle() then use the result in _.bind().
* the hash function passed into memoize may take multiple arguments
  • Loading branch information
derekcicerone committed Oct 10, 2013
1 parent 6e7284f commit 7405a33
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions underscore/underscore.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ declare module _ {
**/
export function pluck<T extends {}>(
list: Collection<T>,
propertyName: string): T[];
propertyName: string): any[];

/**
* Returns the maximum value in list.
Expand Down Expand Up @@ -839,7 +839,7 @@ declare module _ {
start: number,
stop: number,
step?: number): number[];

/**
* @see _.range
* @param stop Stop here.
Expand All @@ -861,7 +861,7 @@ declare module _ {
* @return `fn` with `this` bound to `object`.
**/
export function bind(
func: (...as: any[]) => any,
func: Function,
context: any,
...arguments: any[]): () => any;

Expand Down Expand Up @@ -900,7 +900,7 @@ declare module _ {
**/
export function memoize(
fn: Function,
hashFn?: (n: any) => string): Function;
hashFn?: (...args: any[]) => string): Function;

/**
* Much like setTimeout, invokes function after wait milliseconds. If you pass the optional arguments,
Expand Down Expand Up @@ -1624,7 +1624,7 @@ declare class _<T> {
* @see _.shuffle
**/
shuffle(): T[];

/**
* Wrapped type `any[]`.
* @see _.sample
Expand Down

0 comments on commit 7405a33

Please sign in to comment.