Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions lib/node_modules/@stdlib/utils/map2d/docs/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ type Unary<T, U, V> = ( this: V, value: T ) => U;
* @param indices - current array element indices
* @returns result
*/
type Binary<T, U, V> = ( this: V, value: T, index: number ) => U;
type Binary<T, U, V> = ( this: V, value: T, indices: Array<number> ) => U;

/**
* Callback invoked for each array element.
Expand All @@ -59,7 +59,7 @@ type Binary<T, U, V> = ( this: V, value: T, index: number ) => U;
* @param arr - array
* @returns result
*/
type Ternary<T, U, V> = ( this: V, value: T, index: number, arr: Array2D<T> ) => U;
type Ternary<T, U, V> = ( this: V, value: T, indices: Array<number>, arr: Array2D<T> ) => U;

/**
* Callback invoked for each array element.
Expand Down
12 changes: 12 additions & 0 deletions lib/node_modules/@stdlib/utils/map2d/docs/types/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,17 @@ function clbk( v: number ): number {
return v;
}

/**
* Callback function.
*
* @param v - argument
* @param indices - element indices
* @returns result
*/
function clbki( v: number, indices: Array<number> ): number {
return v + indices[ 0 ];
}


// TESTS //

Expand All @@ -40,6 +51,7 @@ function clbk( v: number ): number {

map2d( arr, clbk ); // $ExpectType number[][]
map2d( arr, clbk, {} ); // $ExpectType number[][]
map2d( arr, clbki ); // $ExpectType number[][]
}

// The compiler throws an error if the function is provided a first argument other than an array of arrays...
Expand Down
4 changes: 2 additions & 2 deletions lib/node_modules/@stdlib/utils/map3d/docs/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ type Unary<T, U, V> = ( this: V, value: T ) => U;
* @param indices - current array element indices
* @returns result
*/
type Binary<T, U, V> = ( this: V, value: T, index: number ) => U;
type Binary<T, U, V> = ( this: V, value: T, indices: Array<number> ) => U;

/**
* Callback invoked for each array element.
Expand All @@ -59,7 +59,7 @@ type Binary<T, U, V> = ( this: V, value: T, index: number ) => U;
* @param arr - array
* @returns result
*/
type Ternary<T, U, V> = ( this: V, value: T, index: number, arr: Array3D<T> ) => U;
type Ternary<T, U, V> = ( this: V, value: T, indices: Array<number>, arr: Array3D<T> ) => U;

/**
* Callback invoked for each array element.
Expand Down
12 changes: 12 additions & 0 deletions lib/node_modules/@stdlib/utils/map3d/docs/types/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,17 @@ function clbk( v: number ): number {
return v;
}

/**
* Callback function.
*
* @param v - argument
* @param indices - element indices
* @returns result
*/
function clbki( v: number, indices: Array<number> ): number {
return v + indices[ 0 ];
}


// TESTS //

Expand All @@ -40,6 +51,7 @@ function clbk( v: number ): number {

map3d( arr, clbk ); // $ExpectType number[][][]
map3d( arr, clbk, {} ); // $ExpectType number[][][]
map3d( arr, clbki ); // $ExpectType number[][][]
}

// The compiler throws an error if the function is provided a first argument other than a three-dimensional nested array...
Expand Down
4 changes: 2 additions & 2 deletions lib/node_modules/@stdlib/utils/map4d/docs/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ type Unary<T, U, V> = ( this: V, value: T ) => U;
* @param indices - current array element indices
* @returns result
*/
type Binary<T, U, V> = ( this: V, value: T, index: number ) => U;
type Binary<T, U, V> = ( this: V, value: T, indices: Array<number> ) => U;

/**
* Callback invoked for each array element.
Expand All @@ -59,7 +59,7 @@ type Binary<T, U, V> = ( this: V, value: T, index: number ) => U;
* @param arr - array
* @returns result
*/
type Ternary<T, U, V> = ( this: V, value: T, index: number, arr: Array4D<T> ) => U;
type Ternary<T, U, V> = ( this: V, value: T, indices: Array<number>, arr: Array4D<T> ) => U;

/**
* Callback invoked for each array element.
Expand Down
12 changes: 12 additions & 0 deletions lib/node_modules/@stdlib/utils/map4d/docs/types/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,17 @@ function clbk( v: number ): number {
return v;
}

/**
* Callback function.
*
* @param v - argument
* @param indices - element indices
* @returns result
*/
function clbki( v: number, indices: Array<number> ): number {
return v + indices[ 0 ];
}


// TESTS //

Expand All @@ -40,6 +51,7 @@ function clbk( v: number ): number {

map4d( arr, clbk ); // $ExpectType number[][][][]
map4d( arr, clbk, {} ); // $ExpectType number[][][][]
map4d( arr, clbki ); // $ExpectType number[][][][]
}

// The compiler throws an error if the function is provided a first argument other than a four-dimensional nested array...
Expand Down
4 changes: 2 additions & 2 deletions lib/node_modules/@stdlib/utils/map5d/docs/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ type Unary<T, U, V> = ( this: V, value: T ) => U;
* @param indices - current array element indices
* @returns result
*/
type Binary<T, U, V> = ( this: V, value: T, index: number ) => U;
type Binary<T, U, V> = ( this: V, value: T, indices: Array<number> ) => U;

/**
* Callback invoked for each array element.
Expand All @@ -59,7 +59,7 @@ type Binary<T, U, V> = ( this: V, value: T, index: number ) => U;
* @param arr - array
* @returns result
*/
type Ternary<T, U, V> = ( this: V, value: T, index: number, arr: Array5D<T> ) => U;
type Ternary<T, U, V> = ( this: V, value: T, indices: Array<number>, arr: Array5D<T> ) => U;

/**
* Callback invoked for each array element.
Expand Down
12 changes: 12 additions & 0 deletions lib/node_modules/@stdlib/utils/map5d/docs/types/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,17 @@ function clbk( v: number ): number {
return v;
}

/**
* Callback function.
*
* @param v - argument
* @param indices - element indices
* @returns result
*/
function clbki( v: number, indices: Array<number> ): number {
return v + indices[ 0 ];
}


// TESTS //

Expand All @@ -40,6 +51,7 @@ function clbk( v: number ): number {

map5d( arr, clbk ); // $ExpectType number[][][][][]
map5d( arr, clbk, {} ); // $ExpectType number[][][][][]
map5d( arr, clbki ); // $ExpectType number[][][][][]
}

// The compiler throws an error if the function is provided a first argument other than a five-dimensional nested array...
Expand Down