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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes typescript definition for "when" and "unless" methods #318

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ declare module 'collect.js' {
/**
* The prepend method adds an item to the beginning of the collection.
*/
prepend<K, V>(value: V, key?: K): this;
prepend<K, V>(value: V, key?: K): Collection<Item>;

/**
* The pull method removes and returns an item from the collection by its key.
Expand Down Expand Up @@ -452,7 +452,7 @@ declare module 'collect.js' {
/**
* The unless method will execute the given callback when the first argument given to the method evaluates to false.
*/
unless(value: boolean, fn: (this: any) => any, defaultFn: (this: any) => any): void;
unless(condition: boolean, fn: (collection: Collection<Item>) => Collection<Item>, defaultFn?: (collection: Collection<Item>) => Collection<Item>): Collection<Item>;

/**
* The unwrap method will unwrap the given collection.
Expand All @@ -467,7 +467,7 @@ declare module 'collect.js' {
/**
* The when method will execute the given callback when the first argument given to the method evaluates to true.
*/
when(condition: boolean, fn: (this: any) => any, defaultFn: (this: any) => any): void;
when(condition: boolean, fn: (collection: Collection<Item>) => Collection<Item>, defaultFn?: (collection: Collection<Item>) => Collection<Item>): Collection<Item>;

/**
* The where method filters the collection by a given key / value pair.
Expand Down