Skip to content

Commit 564c06c

Browse files
committed
Auto-generated commit
1 parent 9422e8d commit 564c06c

File tree

29 files changed

+692
-35
lines changed

29 files changed

+692
-35
lines changed

CHANGELOG.md

Lines changed: 5 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-12-23)
7+
## Unreleased (2025-12-24)
88

99
<section class="features">
1010

@@ -3526,6 +3526,10 @@ A total of 559 issues were closed in this release:
35263526

35273527
<details>
35283528

3529+
- [`c216219`](https://github.com/stdlib-js/stdlib/commit/c2162190116f0953296c56c41b7480c8c050ab7e) - **docs:** fix JSDoc parameter type in `stats/base/ztest/one-sample/results` constructors _(by Philipp Burckhardt)_
3530+
- [`518e88e`](https://github.com/stdlib-js/stdlib/commit/518e88ef1c3de77e44a760fcabb1aa7ebd4ee72d) - **chore:** use literal since setter accepts strings directly _(by Philipp Burckhardt)_
3531+
- [`59455b6`](https://github.com/stdlib-js/stdlib/commit/59455b661612d4c4ed47c25d3077884b985742fc) - **docs:** add `toString`, `toJSON`, and `toDataView` declarations to Z-test results packages _(by Philipp Burckhardt)_
3532+
- [`0a437aa`](https://github.com/stdlib-js/stdlib/commit/0a437aad60abb626a22840c9bad66414b627749f) - **chore:** remove usage of unsupported option _(by Philipp Burckhardt)_
35293533
- [`c17e5f2`](https://github.com/stdlib-js/stdlib/commit/c17e5f26a44218e7cc295e5360f681c1d36fee13) - **feat:** add `stats/base/ndarray/stdev` [(#9248)](https://github.com/stdlib-js/stdlib/pull/9248) _(by Pratik, Athan Reines)_
35303534
- [`61046bb`](https://github.com/stdlib-js/stdlib/commit/61046bb1c95923825493592bf78808fa1b18abc5) - **test:** add missing TypeScript declaration tests _(by Philipp Burckhardt)_
35313535
- [`595918c`](https://github.com/stdlib-js/stdlib/commit/595918c57777524dd8533b80a429c7d331f87444) - **feat:** add `stats/strided/midrange` [(#9298)](https://github.com/stdlib-js/stdlib/pull/9298) _(by Sachin Pangal, Athan Reines)_

base/ztest/one-sample/results/factory/docs/repl.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
--------
1717
> var R = {{alias}}( 'float64' );
1818
> var r = new R();
19-
> r.toString( { 'format': 'linear' } )
19+
> r.toString()
2020
<string>
2121

2222
See Also

base/ztest/one-sample/results/factory/docs/types/index.d.ts

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,21 @@ interface Results<T> {
6868
sd?: number;
6969
}
7070

71+
/**
72+
* Interface describing options when serializing a results object to a string.
73+
*/
74+
interface ToStringOptions {
75+
/**
76+
* Number of digits to display after decimal points. Default: `4`.
77+
*/
78+
digits?: number;
79+
80+
/**
81+
* Boolean indicating whether to show the test decision. Default: `true`.
82+
*/
83+
decision?: boolean;
84+
}
85+
7186
/**
7287
* Interface describing a results data structure.
7388
*/
@@ -126,6 +141,28 @@ declare class ResultsStruct<T> {
126141
* Test method.
127142
*/
128143
method: string;
144+
145+
/**
146+
* Serializes a results object as a formatted string.
147+
*
148+
* @param options - options object
149+
* @returns serialized results
150+
*/
151+
toString( options?: ToStringOptions ): string;
152+
153+
/**
154+
* Serializes a results object as a JSON object.
155+
*
156+
* @returns serialized object
157+
*/
158+
toJSON(): object;
159+
160+
/**
161+
* Returns a DataView of a results object.
162+
*
163+
* @returns DataView
164+
*/
165+
toDataView(): DataView;
129166
}
130167

131168
/**

base/ztest/one-sample/results/factory/docs/types/test.ts

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ import resultsFactory = require( './index' );
5353
const r3 = new Results( new ArrayBuffer( 80 ), 8, 16 ); // $ExpectType ResultsStruct<Float64Array>
5454
}
5555

56-
// The returned constructor can be invoked without `new`...
56+
// The returned function can be invoked without `new`...
5757
{
5858
const Results = resultsFactory( 'float64' );
5959

@@ -171,3 +171,31 @@ import resultsFactory = require( './index' );
171171
new Results( new ArrayBuffer( 80 ), 8, {} ); // $ExpectError
172172
new Results( new ArrayBuffer( 80 ), 8, ( x: number ): number => x ); // $ExpectError
173173
}
174+
175+
// The results object has a `toString` method...
176+
{
177+
const Results = resultsFactory( 'float64' );
178+
const r = new Results( {} );
179+
180+
r.toString(); // $ExpectType string
181+
r.toString( {} ); // $ExpectType string
182+
r.toString( { 'digits': 4 } ); // $ExpectType string
183+
r.toString( { 'decision': true } ); // $ExpectType string
184+
r.toString( { 'digits': 4, 'decision': true } ); // $ExpectType string
185+
}
186+
187+
// The results object has a `toJSON` method...
188+
{
189+
const Results = resultsFactory( 'float64' );
190+
const r = new Results( {} );
191+
192+
r.toJSON(); // $ExpectType object
193+
}
194+
195+
// The results object has a `toDataView` method...
196+
{
197+
const Results = resultsFactory( 'float64' );
198+
const r = new Results( {} );
199+
200+
r.toDataView(); // $ExpectType DataView
201+
}

base/ztest/one-sample/results/float32/README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -282,9 +282,7 @@ var results = new Results({
282282
'alternative': 'two-sided'
283283
});
284284

285-
var str = results.toString({
286-
'format': 'linear'
287-
});
285+
var str = results.toString();
288286
console.log( str );
289287
```
290288

base/ztest/one-sample/results/float32/docs/repl.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
Examples
2222
--------
2323
> var r = new {{alias}}();
24-
> r.toString( { 'format': 'linear' } )
24+
> r.toString()
2525
<string>
2626

2727
See Also

base/ztest/one-sample/results/float32/docs/types/index.d.ts

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,21 @@ interface Results {
6868
sd?: number;
6969
}
7070

71+
/**
72+
* Interface describing options when serializing a results object to a string.
73+
*/
74+
interface ToStringOptions {
75+
/**
76+
* Number of digits to display after decimal points. Default: `4`.
77+
*/
78+
digits?: number;
79+
80+
/**
81+
* Boolean indicating whether to show the test decision. Default: `true`.
82+
*/
83+
decision?: boolean;
84+
}
85+
7186
/**
7287
* Interface describing a results data structure.
7388
*/
@@ -126,6 +141,28 @@ declare class ResultsStruct {
126141
* Test method.
127142
*/
128143
method: string;
144+
145+
/**
146+
* Serializes a results object as a formatted string.
147+
*
148+
* @param options - options object
149+
* @returns serialized results
150+
*/
151+
toString( options?: ToStringOptions ): string;
152+
153+
/**
154+
* Serializes a results object as a JSON object.
155+
*
156+
* @returns serialized object
157+
*/
158+
toJSON(): object;
159+
160+
/**
161+
* Returns a DataView of a results object.
162+
*
163+
* @returns DataView
164+
*/
165+
toDataView(): DataView;
129166
}
130167

131168
/**

base/ztest/one-sample/results/float32/docs/types/test.ts

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import Results = require( './index' );
2121

2222
// TESTS //
2323

24-
// The constructor returns a results object...
24+
// The function returns a results object...
2525
{
2626
// eslint-disable-next-line @typescript-eslint/no-unused-vars
2727
const r0 = new Results( {} ); // $ExpectType ResultsStruct
@@ -36,7 +36,7 @@ import Results = require( './index' );
3636
const r3 = new Results( new ArrayBuffer( 80 ), 8, 16 ); // $ExpectType ResultsStruct
3737
}
3838

39-
// The constructor can be invoked without `new`...
39+
// The function can be invoked without `new`...
4040
{
4141
// eslint-disable-next-line @typescript-eslint/no-unused-vars
4242
const r0 = Results( {} ); // $ExpectType ResultsStruct
@@ -115,3 +115,28 @@ import Results = require( './index' );
115115
new Results( new ArrayBuffer( 80 ), 8, {} ); // $ExpectError
116116
new Results( new ArrayBuffer( 80 ), 8, ( x: number ): number => x ); // $ExpectError
117117
}
118+
119+
// The results object has a `toString` method...
120+
{
121+
const r = new Results( {} );
122+
123+
r.toString(); // $ExpectType string
124+
r.toString( {} ); // $ExpectType string
125+
r.toString( { 'digits': 4 } ); // $ExpectType string
126+
r.toString( { 'decision': true } ); // $ExpectType string
127+
r.toString( { 'digits': 4, 'decision': true } ); // $ExpectType string
128+
}
129+
130+
// The results object has a `toJSON` method...
131+
{
132+
const r = new Results( {} );
133+
134+
r.toJSON(); // $ExpectType object
135+
}
136+
137+
// The results object has a `toDataView` method...
138+
{
139+
const r = new Results( {} );
140+
141+
r.toDataView(); // $ExpectType DataView
142+
}

base/ztest/one-sample/results/float32/examples/index.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,5 @@ var results = new Results({
3232
'alternative': 'two-sided'
3333
});
3434

35-
var str = results.toString({
36-
'format': 'linear'
37-
});
35+
var str = results.toString();
3836
console.log( str );

base/ztest/one-sample/results/float32/lib/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ var factory = require( './../../../../../../base/ztest/one-sample/results/factor
3131
* @name Results
3232
* @constructor
3333
* @type {Function}
34-
* @param {ArrayBuffer} [buffer] - underlying byte buffer
34+
* @param {(ArrayBuffer|Object)} [arg] - underlying byte buffer or data object
3535
* @param {NonNegativeInteger} [byteOffset] - byte offset
3636
* @param {NonNegativeInteger} [byteLength] - maximum byte length
3737
* @returns {Results} results object

0 commit comments

Comments
 (0)