diff --git a/src/array.ts b/src/array.ts index 9aa8a6e..f79b219 100644 --- a/src/array.ts +++ b/src/array.ts @@ -366,7 +366,7 @@ export function shuffle(value: T[]) { /** * Returns a tuple separating the items that pass the given truth test. */ -export function partition(value: T[], callback: Function) { +export function partition(value: T[], callback: (item: T, index?: number) => boolean) { const tuple = [[], []] as [T[], T[]] value.forEach((item, index) => { diff --git a/src/objects/Arrayable.ts b/src/objects/Arrayable.ts index 79ef863..1cbc9d9 100644 --- a/src/objects/Arrayable.ts +++ b/src/objects/Arrayable.ts @@ -312,7 +312,7 @@ class Arrayable extends Array { /** * Returns a tuple separating the items that pass the given truth test. */ - partition(callback: Function) { + partition(callback: (item: T) => boolean) { const partitioned = this.constructor.from(Arr.partition(this, callback)) return partitioned.map(item => this.constructor.from(item)) }