1
1
/*
2
2
* @license Apache-2.0
3
3
*
4
- * Copyright (c) 2025 The Stdlib Authors.
4
+ * Copyright (c) 2020 The Stdlib Authors.
5
5
*
6
6
* Licensed under the Apache License, Version 2.0 (the "License");
7
7
* you may not use this file except in compliance with the License.
16
16
* limitations under the License.
17
17
*/
18
18
19
- import toAccessorArray from '@stdlib/array/base/to-accessor-array' ;
20
- import nanminBy = require( './index' ) ;
21
19
import AccessorArray = require( '@stdlib/array/base/accessor' ) ;
20
+ import nanminBy = require( './index' ) ;
22
21
23
22
const accessor = ( ) : number => {
24
23
return 5.0 ;
@@ -31,8 +30,11 @@ const accessor = (): number => {
31
30
{
32
31
const x = new Float64Array ( 10 ) ;
33
32
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
36
38
}
37
39
38
40
// 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 => {
72
74
nanminBy ( x . length , x , undefined , accessor ) ; // $ExpectError
73
75
nanminBy ( x . length , x , [ ] , accessor ) ; // $ExpectError
74
76
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
76
78
}
77
79
78
80
// 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 => {
103
105
{
104
106
const x = new Float64Array ( 10 ) ;
105
107
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
108
113
}
109
114
110
115
// The compiler throws an error if the `ndarray` method is provided a first argument which is not a number...
0 commit comments