Skip to content

Commit 2a20257

Browse files
committed
docs: update docs
--- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: passed - task: lint_license_headers status: passed ---
1 parent dc33f20 commit 2a20257

File tree

2 files changed

+22
-16
lines changed

2 files changed

+22
-16
lines changed

lib/node_modules/@stdlib/stats/base/nanmin-by/docs/types/index.d.ts

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* @license Apache-2.0
33
*
4-
* Copyright (c) 2025 The Stdlib Authors.
4+
* Copyright (c) 2020 The Stdlib Authors.
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
77
* you may not use this file except in compliance with the License.
@@ -21,6 +21,7 @@
2121
/// <reference types="@stdlib/types"/>
2222

2323
import { NumericArray, Collection, AccessorArrayLike } from '@stdlib/types/array';
24+
2425
/**
2526
* Input array.
2627
*/
@@ -55,7 +56,7 @@ type Binary<T, U> = ( this: U, value: T, aidx: number ) => number | void;
5556
*
5657
* @param value - array element
5758
* @param aidx - array index
58-
* @param sidx - strided index (offsetX + aidx*strideX)
59+
* @param sidx - strided index (offset + aidx*stride)
5960
* @returns accessed value
6061
*/
6162
type Ternary<T, U> = ( this: U, value: T, aidx: number, sidx: number ) => number | void;
@@ -65,7 +66,7 @@ type Ternary<T, U> = ( this: U, value: T, aidx: number, sidx: number ) => number
6566
*
6667
* @param value - array element
6768
* @param aidx - array index
68-
* @param sidx - strided index (offsetX + aidx*strideX)
69+
* @param sidx - strided index (offset + aidx*stride)
6970
* @param array - input array
7071
* @returns accessed value
7172
*/
@@ -87,7 +88,7 @@ type Callback<T, U> = Nullary<U> | Unary<T, U> | Binary<T, U> | Ternary<T, U> |
8788
*/
8889
interface Routine {
8990
/**
90-
* Calculates the minimum value of a strided array via a callback function, ignoring `NaN` values.
91+
* Computes the minimum value of a strided array via a callback function, ignoring `NaN` values.
9192
*
9293
* ## Notes
9394
*
@@ -121,10 +122,10 @@ interface Routine {
121122
* var v = nanminBy( x.length, x, 1, accessor );
122123
* // returns -10.0
123124
*/
124-
<T = unknown, U = unknown>( N: number, x: InputArray, stride: number, clbk: Callback<T, U>, thisArg?: ThisParameterType<Callback<T, U>> ): number;
125+
<T = unknown, U = unknown>( N: number, x: InputArray, strideX: number, clbk: Callback<T, U>, thisArg?: ThisParameterType<Callback<T, U>> ): number;
125126

126127
/**
127-
* Calculates the minimum value of a strided array via a callback function, ignoring `NaN` values and using alternative indexing semantics.
128+
* Computes the minimum value of a strided array via a callback function, ignoring `NaN` values and using alternative indexing semantics.
128129
*
129130
* ## Notes
130131
*
@@ -163,15 +164,15 @@ interface Routine {
163164
}
164165

165166
/**
166-
* Calculates the minimum value of a strided array via a callback function, ignoring `NaN` values.
167+
* Computes the minimum value of a strided array via a callback function, ignoring `NaN` values.
167168
*
168169
* ## Notes
169170
*
170171
* - The callback function is provided four arguments:
171172
*
172173
* - `value`: array element
173174
* - `aidx`: array index
174-
* - `sidx`: strided index (offsetX + aidx*strideX)
175+
* - `sidx`: strided index (offset + aidx*stride)
175176
* - `array`: input array
176177
*
177178
* - The callback function should return a numeric value.

lib/node_modules/@stdlib/stats/base/nanmin-by/docs/types/test.ts

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* @license Apache-2.0
33
*
4-
* Copyright (c) 2025 The Stdlib Authors.
4+
* Copyright (c) 2020 The Stdlib Authors.
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
77
* you may not use this file except in compliance with the License.
@@ -16,9 +16,8 @@
1616
* limitations under the License.
1717
*/
1818

19-
import toAccessorArray from '@stdlib/array/base/to-accessor-array';
20-
import nanminBy = require( './index' );
2119
import AccessorArray = require( '@stdlib/array/base/accessor' );
20+
import nanminBy = require( './index' );
2221

2322
const accessor = (): number => {
2423
return 5.0;
@@ -31,8 +30,11 @@ const accessor = (): number => {
3130
{
3231
const x = new Float64Array( 10 );
3332

34-
nanminBy( x.length, toAccessorArray( x ), 1, accessor ); // $ExpectType number
35-
nanminBy( x.length, toAccessorArray( x ), 1, accessor, {} ); // $ExpectType number
33+
nanminBy( x.length, x, 1, accessor ); // $ExpectType number
34+
nanminBy( x.length, new AccessorArray( x ), 1, accessor ); // $ExpectType number
35+
36+
nanminBy( x.length, x, 1, accessor, {} ); // $ExpectType number
37+
nanminBy( x.length, new AccessorArray( x ), 1, accessor, {} ); // $ExpectType number
3638
}
3739

3840
// The compiler throws an error if the function is provided a first argument which is not a number...
@@ -72,7 +74,7 @@ const accessor = (): number => {
7274
nanminBy( x.length, x, undefined, accessor ); // $ExpectError
7375
nanminBy( x.length, x, [], accessor ); // $ExpectError
7476
nanminBy( x.length, x, {}, accessor ); // $ExpectError
75-
nanminBy( x.length, x, ( x: number, accessor ): number => x, accessor ); // $ExpectError
77+
nanminBy( x.length, x, ( x: number ): number => x, accessor ); // $ExpectError
7678
}
7779

7880
// The compiler throws an error if the function is provided a fourth argument which is not a function...
@@ -103,8 +105,11 @@ const accessor = (): number => {
103105
{
104106
const x = new Float64Array( 10 );
105107

106-
nanminBy.ndarray( x.length, toAccessorArray( x ), 1, 0, accessor ); // $ExpectType number
107-
nanminBy.ndarray( x.length, toAccessorArray( x ), 1, 0, accessor, {} ); // $ExpectType number
108+
nanminBy.ndarray( x.length, x, 1, 0, accessor ); // $ExpectType number
109+
nanminBy.ndarray( x.length, new AccessorArray( x ), 1, 0, accessor ); // $ExpectType number
110+
111+
nanminBy.ndarray( x.length, x, 1, 0, accessor, {} ); // $ExpectType number
112+
nanminBy.ndarray( x.length, new AccessorArray( x ), 1, 0, accessor, {} ); // $ExpectType number
108113
}
109114

110115
// The compiler throws an error if the `ndarray` method is provided a first argument which is not a number...

0 commit comments

Comments
 (0)