Skip to content

Commit ca53628

Browse files
committed
Auto-generated commit
1 parent 3c41218 commit ca53628

File tree

4 files changed

+16
-7
lines changed

4 files changed

+16
-7
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -817,6 +817,7 @@ A total of 45 issues were closed in this release:
817817

818818
<details>
819819

820+
- [`3c6b016`](https://github.com/stdlib-js/stdlib/commit/3c6b01628169badc19aed4201cb66a5265c5d378) - **refactor:** improve type specificity _(by Athan Reines)_
820821
- [`2bc2d8b`](https://github.com/stdlib-js/stdlib/commit/2bc2d8b3568550581f6574843480eccd40c7589a) - **test:** use accessors to resolve ndarray meta data _(by Athan Reines)_
821822
- [`29648e3`](https://github.com/stdlib-js/stdlib/commit/29648e3c22b94656db3d56f822718f5860dfba9d) - **refactor:** improve type specificity _(by Athan Reines)_
822823
- [`b9709d8`](https://github.com/stdlib-js/stdlib/commit/b9709d8608a4cbfc6e5af6f293e5263708ae3430) - **test:** use accessors to resolve ndarray meta data _(by Athan Reines)_

base/remove-singleton-dimensions/docs/types/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ import { ndarray } from '@stdlib/types/ndarray';
4444
* var y = removeSingletonDimensions( x, false );
4545
* // returns <ndarray>[ [ 1, 2 ], [ 3, 4 ] ]
4646
*/
47-
declare function removeSingletonDimensions( x: ndarray, writable: boolean ): ndarray;
47+
declare function removeSingletonDimensions<T extends ndarray = ndarray>( x: T, writable: boolean ): T;
4848

4949

5050
// EXPORTS //

base/remove-singleton-dimensions/docs/types/test.ts

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,21 @@
1616
* limitations under the License.
1717
*/
1818

19-
import array = require( './../../../../array' );
19+
/* eslint-disable space-in-parens */
20+
21+
import zeros = require( './../../../../zeros' );
2022
import removeSingletonDimensions = require( './index' );
2123

2224

2325
// TESTS //
2426

2527
// The function returns an ndarray...
2628
{
27-
const x = array( [ [ 1, 2 ], [ 3, 4 ] ] );
29+
const x = zeros( [ 2, 2 ], {
30+
'dtype': 'float64'
31+
});
2832

29-
removeSingletonDimensions( x, false ); // $ExpectType ndarray
33+
removeSingletonDimensions( x, false ); // $ExpectType float64ndarray
3034
}
3135

3236
// The compiler throws an error if the function is not provided a first argument which is an ndarray...
@@ -43,7 +47,9 @@ import removeSingletonDimensions = require( './index' );
4347

4448
// The compiler throws an error if the function is not provided a second argument which is a boolean...
4549
{
46-
const x = array( [ [ 1, 2 ], [ 3, 4 ] ] );
50+
const x = zeros( [ 2, 2 ], {
51+
'dtype': 'float64'
52+
});
4753

4854
removeSingletonDimensions( x, '5' ); // $ExpectError
4955
removeSingletonDimensions( x, 5 ); // $ExpectError
@@ -55,7 +61,9 @@ import removeSingletonDimensions = require( './index' );
5561

5662
// The compiler throws an error if the function is provided an unsupported number of arguments...
5763
{
58-
const x = array( [ [ 1, 2 ], [ 3, 4 ] ] );
64+
const x = zeros( [ 2, 2 ], {
65+
'dtype': 'float64'
66+
});
5967

6068
removeSingletonDimensions(); // $ExpectError
6169
removeSingletonDimensions( x ); // $ExpectError

base/remove-singleton-dimensions/test/test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ tape( 'the function removes singleton dimensions (base)', function test( t ) {
160160
y = removeSingletonDimensions( x, false );
161161

162162
t.notEqual( y, x, 'returns expected value' );
163-
t.deepEqual( y.shape, [ 2, 2 ], 'returns expected value' );
163+
t.deepEqual( getShape( y ), [ 2, 2 ], 'returns expected value' );
164164
t.strictEqual( getData( y ), getData( x ), 'returns expected value' );
165165

166166
t.end();

0 commit comments

Comments
 (0)