diff --git a/lib/node_modules/@stdlib/utils/map2d/docs/types/index.d.ts b/lib/node_modules/@stdlib/utils/map2d/docs/types/index.d.ts index e6082b953583..106e13eb87e4 100644 --- a/lib/node_modules/@stdlib/utils/map2d/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/utils/map2d/docs/types/index.d.ts @@ -49,7 +49,7 @@ type Unary = ( this: V, value: T ) => U; * @param indices - current array element indices * @returns result */ -type Binary = ( this: V, value: T, index: number ) => U; +type Binary = ( this: V, value: T, indices: Array ) => U; /** * Callback invoked for each array element. @@ -59,7 +59,7 @@ type Binary = ( this: V, value: T, index: number ) => U; * @param arr - array * @returns result */ -type Ternary = ( this: V, value: T, index: number, arr: Array2D ) => U; +type Ternary = ( this: V, value: T, indices: Array, arr: Array2D ) => U; /** * Callback invoked for each array element. diff --git a/lib/node_modules/@stdlib/utils/map2d/docs/types/test.ts b/lib/node_modules/@stdlib/utils/map2d/docs/types/test.ts index 56da641c3256..fcacb977a9a6 100644 --- a/lib/node_modules/@stdlib/utils/map2d/docs/types/test.ts +++ b/lib/node_modules/@stdlib/utils/map2d/docs/types/test.ts @@ -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 { + return v + indices[ 0 ]; +} + // TESTS // @@ -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... diff --git a/lib/node_modules/@stdlib/utils/map3d/docs/types/index.d.ts b/lib/node_modules/@stdlib/utils/map3d/docs/types/index.d.ts index e80208b624b5..ee78a7b1d92a 100644 --- a/lib/node_modules/@stdlib/utils/map3d/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/utils/map3d/docs/types/index.d.ts @@ -49,7 +49,7 @@ type Unary = ( this: V, value: T ) => U; * @param indices - current array element indices * @returns result */ -type Binary = ( this: V, value: T, index: number ) => U; +type Binary = ( this: V, value: T, indices: Array ) => U; /** * Callback invoked for each array element. @@ -59,7 +59,7 @@ type Binary = ( this: V, value: T, index: number ) => U; * @param arr - array * @returns result */ -type Ternary = ( this: V, value: T, index: number, arr: Array3D ) => U; +type Ternary = ( this: V, value: T, indices: Array, arr: Array3D ) => U; /** * Callback invoked for each array element. diff --git a/lib/node_modules/@stdlib/utils/map3d/docs/types/test.ts b/lib/node_modules/@stdlib/utils/map3d/docs/types/test.ts index 6491d207eb58..73873b588a5c 100644 --- a/lib/node_modules/@stdlib/utils/map3d/docs/types/test.ts +++ b/lib/node_modules/@stdlib/utils/map3d/docs/types/test.ts @@ -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 { + return v + indices[ 0 ]; +} + // TESTS // @@ -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... diff --git a/lib/node_modules/@stdlib/utils/map4d/docs/types/index.d.ts b/lib/node_modules/@stdlib/utils/map4d/docs/types/index.d.ts index 6242bf689522..7d3db2824a53 100644 --- a/lib/node_modules/@stdlib/utils/map4d/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/utils/map4d/docs/types/index.d.ts @@ -49,7 +49,7 @@ type Unary = ( this: V, value: T ) => U; * @param indices - current array element indices * @returns result */ -type Binary = ( this: V, value: T, index: number ) => U; +type Binary = ( this: V, value: T, indices: Array ) => U; /** * Callback invoked for each array element. @@ -59,7 +59,7 @@ type Binary = ( this: V, value: T, index: number ) => U; * @param arr - array * @returns result */ -type Ternary = ( this: V, value: T, index: number, arr: Array4D ) => U; +type Ternary = ( this: V, value: T, indices: Array, arr: Array4D ) => U; /** * Callback invoked for each array element. diff --git a/lib/node_modules/@stdlib/utils/map4d/docs/types/test.ts b/lib/node_modules/@stdlib/utils/map4d/docs/types/test.ts index fa886d790583..737b85ce07bb 100644 --- a/lib/node_modules/@stdlib/utils/map4d/docs/types/test.ts +++ b/lib/node_modules/@stdlib/utils/map4d/docs/types/test.ts @@ -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 { + return v + indices[ 0 ]; +} + // TESTS // @@ -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... diff --git a/lib/node_modules/@stdlib/utils/map5d/docs/types/index.d.ts b/lib/node_modules/@stdlib/utils/map5d/docs/types/index.d.ts index 2b5b882f2f80..335d08ed8ba4 100644 --- a/lib/node_modules/@stdlib/utils/map5d/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/utils/map5d/docs/types/index.d.ts @@ -49,7 +49,7 @@ type Unary = ( this: V, value: T ) => U; * @param indices - current array element indices * @returns result */ -type Binary = ( this: V, value: T, index: number ) => U; +type Binary = ( this: V, value: T, indices: Array ) => U; /** * Callback invoked for each array element. @@ -59,7 +59,7 @@ type Binary = ( this: V, value: T, index: number ) => U; * @param arr - array * @returns result */ -type Ternary = ( this: V, value: T, index: number, arr: Array5D ) => U; +type Ternary = ( this: V, value: T, indices: Array, arr: Array5D ) => U; /** * Callback invoked for each array element. diff --git a/lib/node_modules/@stdlib/utils/map5d/docs/types/test.ts b/lib/node_modules/@stdlib/utils/map5d/docs/types/test.ts index 194a01cd6abb..9e404d7042d6 100644 --- a/lib/node_modules/@stdlib/utils/map5d/docs/types/test.ts +++ b/lib/node_modules/@stdlib/utils/map5d/docs/types/test.ts @@ -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 { + return v + indices[ 0 ]; +} + // TESTS // @@ -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...