From 40689d0811eb7a28121b5368416ee77a5c93f7aa Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 6 May 2026 12:20:48 +0000 Subject: [PATCH 1/3] fix: correct benchmark input wrapping in `ndarray/base/output-order` The benchmark double-wrapped the input list and used a `Layout` type assertion that diverges from the declared `Order` return type. Pass the inner list of ndarrays directly, add the missing argument-spacing in `array()` calls, and align the type-test annotation with the declaration. --- .../ndarray/base/output-order/benchmark/benchmark.js | 8 ++++---- .../@stdlib/ndarray/base/output-order/docs/types/test.ts | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/node_modules/@stdlib/ndarray/base/output-order/benchmark/benchmark.js b/lib/node_modules/@stdlib/ndarray/base/output-order/benchmark/benchmark.js index 14cb949eba43..927d3022c4ae 100644 --- a/lib/node_modules/@stdlib/ndarray/base/output-order/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/ndarray/base/output-order/benchmark/benchmark.js @@ -51,14 +51,14 @@ bench( pkg, function benchmark( b ) { var i; arr = [ - [ array( 'row-major' ), array( 'row-major') ], - [ array( 'row-major' ), array( 'column-major') ], - [ array( 'column-major' ), array( 'column-major') ] + [ array( 'row-major' ), array( 'row-major' ) ], + [ array( 'row-major' ), array( 'column-major' ) ], + [ array( 'column-major' ), array( 'column-major' ) ] ]; b.tic(); for ( i = 0; i < b.iterations; i++ ) { - out = outputOrder( [ arr[ i%arr.length ] ] ); + out = outputOrder( arr[ i%arr.length ] ); if ( typeof out !== 'string' ) { b.fail( 'should return a string' ); } diff --git a/lib/node_modules/@stdlib/ndarray/base/output-order/docs/types/test.ts b/lib/node_modules/@stdlib/ndarray/base/output-order/docs/types/test.ts index 73fba6a973e3..0c2dce4e00ea 100644 --- a/lib/node_modules/@stdlib/ndarray/base/output-order/docs/types/test.ts +++ b/lib/node_modules/@stdlib/ndarray/base/output-order/docs/types/test.ts @@ -26,7 +26,7 @@ import outputOrder = require( './index' ); { const x = zeros( [ 2, 2 ] ); const y = zeros( [ 2, 2 ] ); - outputOrder( [ x, y ] ); // $ExpectType Layout + outputOrder( [ x, y ] ); // $ExpectType Order } // The compiler throws an error if the function is provided a first argument which is not an array-like object of ndarrays... From 59c709d9366aa260769a073e1caf8ff271cfd56d Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 6 May 2026 12:20:52 +0000 Subject: [PATCH 2/3] style: align `ndarray/base/consensus-order` test.ts with declared types Rename the import alias `consensusLayout` to the canonical `consensusOrder` and update the `$ExpectType` annotation from `Layout` to `Order` so the type test matches the function declaration. --- .../base/consensus-order/docs/types/test.ts | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/node_modules/@stdlib/ndarray/base/consensus-order/docs/types/test.ts b/lib/node_modules/@stdlib/ndarray/base/consensus-order/docs/types/test.ts index f8333b4bcbcd..dedf4093da91 100644 --- a/lib/node_modules/@stdlib/ndarray/base/consensus-order/docs/types/test.ts +++ b/lib/node_modules/@stdlib/ndarray/base/consensus-order/docs/types/test.ts @@ -16,7 +16,7 @@ * limitations under the License. */ -import consensusLayout = require( './index' ); +import consensusOrder = require( './index' ); // TESTS // @@ -26,17 +26,17 @@ import consensusLayout = require( './index' ); const sx = [ 2, 1 ]; const sy = [ 2, 1 ]; const sz = [ 4, 2 ]; - consensusLayout( [ sx, sy, sz ] ); // $ExpectType Layout + consensusOrder( [ sx, sy, sz ] ); // $ExpectType Order } // The compiler throws an error if the function is provided a first argument which is not an array-like object of numbers... { - consensusLayout( true ); // $ExpectError - consensusLayout( false ); // $ExpectError - consensusLayout( '5' ); // $ExpectError - consensusLayout( 123 ); // $ExpectError - consensusLayout( {} ); // $ExpectError - consensusLayout( ( x: number ): number => x ); // $ExpectError + consensusOrder( true ); // $ExpectError + consensusOrder( false ); // $ExpectError + consensusOrder( '5' ); // $ExpectError + consensusOrder( 123 ); // $ExpectError + consensusOrder( {} ); // $ExpectError + consensusOrder( ( x: number ): number => x ); // $ExpectError } // The compiler throws an error if the function is provided an unsupported number of arguments... @@ -44,6 +44,6 @@ import consensusLayout = require( './index' ); const sx = [ 2, 1 ]; const sy = [ 2, 1 ]; const sz = [ 4, 2 ]; - consensusLayout(); // $ExpectError - consensusLayout( [ sx, sy, sz ], [] ); // $ExpectError + consensusOrder(); // $ExpectError + consensusOrder( [ sx, sy, sz ], [] ); // $ExpectError } From c0b6e7936829f80764859b5c38e8a1d571ebb0c3 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 6 May 2026 12:30:55 +0000 Subject: [PATCH 3/3] fix: revert `$ExpectType Order` to `Layout` in `ndarray/base` test.ts `eslint-plugin-expect-type` resolves transparent type aliases when reporting the inferred return type. Because `Order = Layout` in `@stdlib/types/ndarray`, the plugin always reports `Layout` and the `$ExpectType Order` annotation fails the lint check. --- .../@stdlib/ndarray/base/consensus-order/docs/types/test.ts | 2 +- .../@stdlib/ndarray/base/output-order/docs/types/test.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/node_modules/@stdlib/ndarray/base/consensus-order/docs/types/test.ts b/lib/node_modules/@stdlib/ndarray/base/consensus-order/docs/types/test.ts index dedf4093da91..55ef11ffdfac 100644 --- a/lib/node_modules/@stdlib/ndarray/base/consensus-order/docs/types/test.ts +++ b/lib/node_modules/@stdlib/ndarray/base/consensus-order/docs/types/test.ts @@ -26,7 +26,7 @@ import consensusOrder = require( './index' ); const sx = [ 2, 1 ]; const sy = [ 2, 1 ]; const sz = [ 4, 2 ]; - consensusOrder( [ sx, sy, sz ] ); // $ExpectType Order + consensusOrder( [ sx, sy, sz ] ); // $ExpectType Layout } // The compiler throws an error if the function is provided a first argument which is not an array-like object of numbers... diff --git a/lib/node_modules/@stdlib/ndarray/base/output-order/docs/types/test.ts b/lib/node_modules/@stdlib/ndarray/base/output-order/docs/types/test.ts index 0c2dce4e00ea..73fba6a973e3 100644 --- a/lib/node_modules/@stdlib/ndarray/base/output-order/docs/types/test.ts +++ b/lib/node_modules/@stdlib/ndarray/base/output-order/docs/types/test.ts @@ -26,7 +26,7 @@ import outputOrder = require( './index' ); { const x = zeros( [ 2, 2 ] ); const y = zeros( [ 2, 2 ] ); - outputOrder( [ x, y ] ); // $ExpectType Order + outputOrder( [ x, y ] ); // $ExpectType Layout } // The compiler throws an error if the function is provided a first argument which is not an array-like object of ndarrays...