Skip to content

Commit 72357fb

Browse files
committed
fix: add missing this parameter
1 parent 71f0dcb commit 72357fb

2 files changed

Lines changed: 12 additions & 12 deletions

File tree

lib/node_modules/@stdlib/utils/inmap-right/docs/types/index.d.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@ import { Collection } from '@stdlib/types/array';
2727
*
2828
* @returns updated element
2929
*/
30-
type Nullary<T> = () => T;
30+
type Nullary<T, U> = ( this: U ) => T;
3131

3232
/**
3333
*Returns an updated collection element.
3434
*
3535
* @param value - collection value
3636
* @returns updated element
3737
*/
38-
type Unary<T> = ( value: T ) => T;
38+
type Unary<T, U> = ( this: U, value: T ) => T;
3939

4040
/**
4141
* Returns an updated collection element.
@@ -44,7 +44,7 @@ type Unary<T> = ( value: T ) => T;
4444
* @param index - collection index
4545
* @returns updated element
4646
*/
47-
type Binary<T> = ( value: T, index: number ) => T;
47+
type Binary<T, U> = ( this: U, value: T, index: number ) => T;
4848

4949
/**
5050
* Returns an updated collection element.
@@ -54,7 +54,7 @@ type Binary<T> = ( value: T, index: number ) => T;
5454
* @param collection - input collection
5555
* @returns updated element
5656
*/
57-
type Ternary<T> = ( value: T, index: number, collection: Collection<T> ) => T;
57+
type Ternary<T, U> = ( this: U, value: T, index: number, collection: Collection<T> ) => T;
5858

5959
/**
6060
* Returns an updated collection element.
@@ -64,7 +64,7 @@ type Ternary<T> = ( value: T, index: number, collection: Collection<T> ) => T;
6464
* @param collection - input collection
6565
* @returns updated element
6666
*/
67-
type Callback<T> = Nullary<T> | Unary<T> | Binary<T> | Ternary<T>;
67+
type Callback<T, U> = Nullary<T, U> | Unary<T, U> | Binary<T, U> | Ternary<T, U>;
6868

6969
/**
7070
* Invokes a function once for each element in a collection and updates the collection in-place, iterating from right to left.
@@ -92,7 +92,7 @@ type Callback<T> = Nullary<T> | Unary<T> | Binary<T> | Ternary<T>;
9292
* var bool = ( out === arr );
9393
* // returns true
9494
*/
95-
declare function inmapRight<T = unknown>( collection: Collection<T>, fcn: Callback<T>, thisArg?: ThisParameterType<Callback<T>> ): Collection<T>;
95+
declare function inmapRight<T = unknown, U = unknown>( collection: Collection<T>, fcn: Callback<T, U>, thisArg?: ThisParameterType<Callback<T, U>> ): Collection<T>;
9696

9797

9898
// EXPORTS //

lib/node_modules/@stdlib/utils/inmap/docs/types/index.d.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@ import { Collection } from '@stdlib/types/array';
2727
*
2828
* @returns updated element
2929
*/
30-
type Nullary<T> = () => T;
30+
type Nullary<T, U> = ( this: U ) => T;
3131

3232
/**
3333
*Returns an updated collection element.
3434
*
3535
* @param value - collection value
3636
* @returns updated element
3737
*/
38-
type Unary<T> = ( value: T ) => T;
38+
type Unary<T, U> = ( this: U, value: T ) => T;
3939

4040
/**
4141
* Returns an updated collection element.
@@ -44,7 +44,7 @@ type Unary<T> = ( value: T ) => T;
4444
* @param index - collection index
4545
* @returns updated element
4646
*/
47-
type Binary<T> = ( value: T, index: number ) => T;
47+
type Binary<T, U> = ( this: U, value: T, index: number ) => T;
4848

4949
/**
5050
* Returns an updated collection element.
@@ -54,7 +54,7 @@ type Binary<T> = ( value: T, index: number ) => T;
5454
* @param collection - input collection
5555
* @returns updated element
5656
*/
57-
type Ternary<T> = ( value: T, index: number, collection: Collection<T> ) => T;
57+
type Ternary<T, U> = ( this: U, value: T, index: number, collection: Collection<T> ) => T;
5858

5959
/**
6060
* Returns an updated collection element.
@@ -64,7 +64,7 @@ type Ternary<T> = ( value: T, index: number, collection: Collection<T> ) => T;
6464
* @param collection - input collection
6565
* @returns updated element
6666
*/
67-
type Callback<T> = Nullary<T> | Unary<T> | Binary<T> | Ternary<T>;
67+
type Callback<T, U> = Nullary<T, U> | Unary<T, U> | Binary<T, U> | Ternary<T, U>;
6868

6969
/**
7070
* Invokes a function once for each element in a collection and updates the collection in-place.
@@ -91,7 +91,7 @@ type Callback<T> = Nullary<T> | Unary<T> | Binary<T> | Ternary<T>;
9191
* var bool = ( out === arr );
9292
* // returns true
9393
*/
94-
declare function inmap<T = unknown>( collection: Collection<T>, fcn: Callback<T>, thisArg?: ThisParameterType<Callback<T>> ): Collection<T>;
94+
declare function inmap<T = unknown, U = unknown>( collection: Collection<T>, fcn: Callback<T, U>, thisArg?: ThisParameterType<Callback<T, U>> ): Collection<T>;
9595

9696

9797
// EXPORTS //

0 commit comments

Comments
 (0)