Skip to content

Commit 6f06646

Browse files
committed
Auto-generated commit
1 parent 8624d6c commit 6f06646

8 files changed

Lines changed: 36 additions & 11 deletions

File tree

CHANGELOG.md

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
<section class="release" id="unreleased">
66

7-
## Unreleased (2025-04-17)
7+
## Unreleased (2025-04-18)
88

99
<section class="packages">
1010

@@ -136,6 +136,16 @@
136136

137137
<!-- /.features -->
138138

139+
<section class="bug-fixes">
140+
141+
##### Bug Fixes
142+
143+
- [`6c571bf`](https://github.com/stdlib-js/stdlib/commit/6c571bf330e3fc293f6ef7c40fcc6bfefcd7f61d) - preserve output array type specificity
144+
145+
</section>
146+
147+
<!-- /.bug-fixes -->
148+
139149
</details>
140150

141151
</section>
@@ -194,6 +204,16 @@
194204

195205
<!-- /.features -->
196206

207+
<section class="bug-fixes">
208+
209+
##### Bug Fixes
210+
211+
- [`e051a2f`](https://github.com/stdlib-js/stdlib/commit/e051a2fbf9cb31b562972c20c361a71b6ad837f6) - improve type specificity
212+
213+
</section>
214+
215+
<!-- /.bug-fixes -->
216+
197217
</details>
198218

199219
</section>
@@ -9807,6 +9827,10 @@ A total of 30 people contributed to this release. Thank you to the following con
98079827
<details>
98089828

98099829
- [`3656652`](https://github.com/stdlib-js/stdlib/commit/36566524e333dabea3b4b47c00b154accc1c2c23) - **feat:** add `math/base/special/lucasf` [(#6223)](https://github.com/stdlib-js/stdlib/pull/6223) _(by Harsh, stdlib-bot, Karan Anand)_
9830+
- [`dd317a4`](https://github.com/stdlib-js/stdlib/commit/dd317a4963fb9c35e1967a4b96556c3b060675c5) - **docs:** fix copy _(by Athan Reines)_
9831+
- [`e051a2f`](https://github.com/stdlib-js/stdlib/commit/e051a2fbf9cb31b562972c20c361a71b6ad837f6) - **fix:** improve type specificity _(by Athan Reines)_
9832+
- [`f81d254`](https://github.com/stdlib-js/stdlib/commit/f81d254ca5fc52dede022955c37aa0c90893969a) - **docs:** fix example _(by Athan Reines)_
9833+
- [`6c571bf`](https://github.com/stdlib-js/stdlib/commit/6c571bf330e3fc293f6ef7c40fcc6bfefcd7f61d) - **fix:** preserve output array type specificity _(by Athan Reines)_
98109834
- [`da4436d`](https://github.com/stdlib-js/stdlib/commit/da4436d4372c05e78d6936e1738be14e640ef099) - **docs:** replace manual `for` loop in examples [(#6689)](https://github.com/stdlib-js/stdlib/pull/6689) _(by Harsh)_
98119835
- [`2aadeb5`](https://github.com/stdlib-js/stdlib/commit/2aadeb5422491aeab1afd3424f54048911b9cb31) - **bench:** update random value generation [(#6686)](https://github.com/stdlib-js/stdlib/pull/6686) _(by Harsh)_
98129836
- [`f7b18f2`](https://github.com/stdlib-js/stdlib/commit/f7b18f2f07eea6ac092fee7bc7c459fe96b4dd2c) - **bench:** update random value generation [(#6687)](https://github.com/stdlib-js/stdlib/pull/6687) _(by Harsh)_

array/special/abs/docs/types/index.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ interface Unary {
5757
* var out = abs( [ -1.0, -2.0, -3.0 ] );
5858
* // returns [ 1.0, 2.0, 3.0 ]
5959
*/
60-
( x: InputArray<number>, options?: Options ): OutputArray<number>;
60+
<T extends InputArray<number>>( x: T, options?: Options ): T;
6161

6262
/**
6363
* Computes the absolute value for each element in an input array and assigns results to a provided output array.
@@ -75,7 +75,7 @@ interface Unary {
7575
* var bool = ( out === y );
7676
* // returns true
7777
*/
78-
assign<V extends OutputArray<number>>( x: InputArray<number>, out: V ): V;
78+
assign<U extends OutputArray<number>>( x: InputArray<number>, out: U ): U;
7979
}
8080

8181
/**

array/special/abs/docs/types/test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ import abs = require( './index' );
2828

2929
// The function returns an array...
3030
{
31-
abs( [ 1.0, 2.0, 3.0, 4.0 ] ); // $ExpectType OutputArray<number>
32-
abs( [ 1.0, 2.0, 3.0, 4.0 ], {} ); // $ExpectType OutputArray<number>
31+
abs( [ 1.0, 2.0, 3.0, 4.0 ] ); // $ExpectType number[]
32+
abs( [ 1.0, 2.0, 3.0, 4.0 ], {} ); // $ExpectType number[]
3333
}
3434

3535
// The compiler throws an error if the function is provided a first argument which is not an array...

array/special/abs/lib/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
* // returns [ 1.0, 2.0, 3.0 ]
3939
*
4040
* var bool = ( out === y );
41+
* // returns true
4142
*/
4243

4344
// MODULES //

array/tools/unary-factory/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ var policy = 'same';
4343
var unary = factory( abs, dtypes, dtypes, policy );
4444
```
4545

46-
The constructor has the following parameters:
46+
The function has the following parameters:
4747

4848
- **fcn**: unary function to apply.
4949
- **idtypes**: list of supported input data types.

array/tools/unary-factory/docs/types/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ interface UnaryFunction<T, U> {
7474
*
7575
* var x = [ -1.0, -2.0, -3.0 ];
7676
*
77-
* var y = abs.apply( x );
77+
* var y = abs( x );
7878
* // returns [ 1.0, 2.0, 3.0 ]
7979
*/
8080
( x: InputArray<T>, options?: Options ): OutputArray<U>; // NOTE: we lose type specificity here, but retaining specificity would likely be difficult and/or tedious to completely enumerate, as the output array data type is dependent on how `x` interacts with output data type policy and whether that policy has been overridden by `options.dtype`. In principle, as well, based on the policy, it is possible to know more exactly which `InputArray` types are actually allowed.

array/tools/unary/docs/types/index.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ declare class UnaryFunction<T, U> {
103103
* var y = abs.apply( x );
104104
* // returns [ 1.0, 2.0, 3.0 ]
105105
*/
106-
apply( x: InputArray<T>, options?: Options ): OutputArray<U>;
106+
apply( x: InputArray<T>, options?: Options ): OutputArray<U>; // NOTE: we lose type specificity here, but retaining specificity would likely be difficult and/or tedious to completely enumerate, as the output array data type is dependent on how `x` interacts with output data type policy and whether that policy has been overridden by `options.dtype`. In principle, as well, based on the policy, it is possible to know more exactly which `InputArray` types are actually allowed.
107107

108108
/**
109109
* Applies a unary function to each element in a provided input array and assigns results to a provided output array.
@@ -131,7 +131,7 @@ declare class UnaryFunction<T, U> {
131131
* var bool = ( out === y );
132132
* // returns true
133133
*/
134-
assign( x: InputArray<T>, out: OutputArray<U> ): OutputArray<U>;
134+
assign<V extends OutputArray<U> = OutputArray<U>>( x: InputArray<T>, out: V ): V;
135135
}
136136

137137
/**

array/tools/unary/docs/types/test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,11 +239,11 @@ import Unary = require( './index' );
239239
const x = zeros( 10, 'float64' );
240240

241241
const f1 = new Unary<number, number>( abs, dtypes, dtypes, 'same' );
242-
f1.assign( x, x ); // $ExpectType OutputArray<number>
242+
f1.assign( x, x ); // $ExpectType Float64Array
243243

244244
const unary = Unary;
245245
const f2 = unary<number, number>( abs, dtypes, dtypes, 'same' );
246-
f2.assign( x, x ); // $ExpectType OutputArray<number>
246+
f2.assign( x, x ); // $ExpectType Float64Array
247247
}
248248

249249
// The compiler throws an error if the `assign` method is provided a first argument which is not an array-like object...

0 commit comments

Comments
 (0)