Skip to content

Commit b45ab4c

Browse files
committed
fix: add missing this parameter
1 parent 438c577 commit b45ab4c

File tree

1 file changed

+13
-13
lines changed
  • lib/node_modules/@stdlib/utils/bifurcate-by/docs/types

1 file changed

+13
-13
lines changed

lib/node_modules/@stdlib/utils/bifurcate-by/docs/types/index.d.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,17 @@ import { Collection } from '@stdlib/types/array';
2525
/**
2626
* Interface defining base function options.
2727
*/
28-
interface BaseOptions<T> {
28+
interface BaseOptions<T, U> {
2929
/**
3030
* Execution context.
3131
*/
32-
thisArg?: ThisParameterType<Predicate<T>>;
32+
thisArg?: ThisParameterType<Predicate<T, U>>;
3333
}
3434

3535
/**
3636
* Interface defining function options when returning indices.
3737
*/
38-
interface IndicesOptions<T> extends BaseOptions<T> {
38+
interface IndicesOptions<T, U> extends BaseOptions<T, U> {
3939
/**
4040
* Specifies that indices should be returned.
4141
*/
@@ -45,7 +45,7 @@ interface IndicesOptions<T> extends BaseOptions<T> {
4545
/**
4646
* Interface defining function options when returning values.
4747
*/
48-
interface ValuesOptions<T> extends BaseOptions<T> {
48+
interface ValuesOptions<T, U> extends BaseOptions<T, U> {
4949
/**
5050
* Specifies that values should be returned.
5151
*/
@@ -55,7 +55,7 @@ interface ValuesOptions<T> extends BaseOptions<T> {
5555
/**
5656
* Interface defining function options when returning indices and values.
5757
*/
58-
interface IndicesAndValuesOptions<T> extends BaseOptions<T> {
58+
interface IndicesAndValuesOptions<T, U> extends BaseOptions<T, U> {
5959
/**
6060
* Specifies that indices and values should be returned.
6161
*/
@@ -67,15 +67,15 @@ interface IndicesAndValuesOptions<T> extends BaseOptions<T> {
6767
*
6868
* @returns boolean indicating whether an element in a collection should be placed in the first or second group
6969
*/
70-
type Nullary = () => boolean;
70+
type Nullary<U> = ( this: U ) => boolean;
7171

7272
/**
7373
* Returns a boolean indicating which group an element in an collection belongs to.
7474
*
7575
* @param value - collection value
7676
* @returns boolean indicating whether an element in a collection should be placed in the first or second group
7777
*/
78-
type Unary<T> = ( value: T ) => boolean;
78+
type Unary<T, U> = ( this: U, value: T ) => boolean;
7979

8080
/**
8181
* Returns a boolean indicating which group an element in an collection belongs to.
@@ -84,7 +84,7 @@ type Unary<T> = ( value: T ) => boolean;
8484
* @param index - collection index
8585
* @returns boolean indicating whether an element in a collection should be placed in the first or second group
8686
*/
87-
type Binary<T> = ( value: T, index: number ) => boolean;
87+
type Binary<T, U> = ( this: U, value: T, index: number ) => boolean;
8888

8989
/**
9090
* Returns a boolean indicating which group an element in an collection belongs to.
@@ -93,7 +93,7 @@ type Binary<T> = ( value: T, index: number ) => boolean;
9393
* @param index - collection index
9494
* @returns boolean indicating whether an element in a collection should be placed in the first or second group
9595
*/
96-
type Predicate<T> = Nullary | Unary<T> | Binary<T>;
96+
type Predicate<T, U> = Nullary<U> | Unary<T, U> | Binary<T, U>;
9797

9898
/**
9999
* Splits values into two groups according to a predicate function.
@@ -122,7 +122,7 @@ type Predicate<T> = Nullary | Unary<T> | Binary<T>;
122122
* var out = bifurcateBy( arr, predicate );
123123
* // returns [ [ 'beep', 'boop', 'bar' ], [ 'foo' ] ]
124124
*/
125-
declare function bifurcateBy<T = unknown>( collection: Collection<T>, predicate: Predicate<T> ): [ Array<T>, Array<T> ];
125+
declare function bifurcateBy<T = unknown, U = unknown>( collection: Collection<T>, predicate: Predicate<T, U> ): [ Array<T>, Array<T> ]; // tslint:disable-line:no-unnecessary-generics
126126

127127
/**
128128
* Splits values into two groups according to a predicate function.
@@ -157,7 +157,7 @@ declare function bifurcateBy<T = unknown>( collection: Collection<T>, predicate:
157157
* var out = bifurcateBy( arr, opts, predicate );
158158
* // returns [ [ 0, 1, 3 ], [ 2 ] ]
159159
*/
160-
declare function bifurcateBy<T = unknown>( collection: Collection<T>, options: IndicesOptions<T>, predicate: Predicate<T> ): [ Array<number>, Array<number> ];
160+
declare function bifurcateBy<T = unknown, U = unknown>( collection: Collection<T>, options: IndicesOptions<T, U>, predicate: Predicate<T, U> ): [ Array<number>, Array<number> ];
161161

162162
/**
163163
* Splits values into two groups according to a predicate function.
@@ -192,7 +192,7 @@ declare function bifurcateBy<T = unknown>( collection: Collection<T>, options: I
192192
* var out = bifurcateBy( arr, opts, predicate );
193193
* // returns [ [ 'beep', 'boop', 'bar' ], [ 'foo' ] ]
194194
*/
195-
declare function bifurcateBy<T = unknown>( collection: Collection<T>, options: ValuesOptions<T> | BaseOptions<T>, predicate: Predicate<T> ): [ Array<T>, Array<T> ];
195+
declare function bifurcateBy<T = unknown, U = unknown>( collection: Collection<T>, options: ValuesOptions<T, U> | BaseOptions<T, U>, predicate: Predicate<T, U> ): [ Array<T>, Array<T> ];
196196

197197
/**
198198
* Splits values into two groups according to a predicate function.
@@ -227,7 +227,7 @@ declare function bifurcateBy<T = unknown>( collection: Collection<T>, options: V
227227
* var out = bifurcateBy( arr, opts, predicate );
228228
* // returns [ [ [ 0, 'beep' ], [ 1, 'boop' ], [ 3, 'bar' ] ], [ [ 2, 'foo' ] ] ]
229229
*/
230-
declare function bifurcateBy<T = unknown>( collection: Collection<T>, options: IndicesAndValuesOptions<T>, predicate: Predicate<T> ): [ Array<[ number, T ]>, Array<[ number, T ]> ];
230+
declare function bifurcateBy<T = unknown, U = unknown>( collection: Collection<T>, options: IndicesAndValuesOptions<T, U>, predicate: Predicate<T, U> ): [ Array<[ number, T ]>, Array<[ number, T ]> ];
231231

232232

233233
// EXPORTS //

0 commit comments

Comments
 (0)