Skip to content

Commit 0494de9

Browse files
committed
Auto-generated commit
1 parent 7f09633 commit 0494de9

File tree

3 files changed

+29
-60
lines changed

3 files changed

+29
-60
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@
3636

3737
<details>
3838

39+
- [`bcfac3b`](https://github.com/stdlib-js/stdlib/commit/bcfac3b4e64b90de693948adfffe3658f9b99e99) - **docs:** update example _(by Athan Reines)_
40+
- [`dc302b7`](https://github.com/stdlib-js/stdlib/commit/dc302b712bee9871320887a4473c707512dc9196) - **test:** fix broken tests _(by Athan Reines)_
3941
- [`9168604`](https://github.com/stdlib-js/stdlib/commit/9168604c1138d438bee5c6856026cc36de35e705) - **refactor:** improve type specificity _(by Athan Reines)_
4042
- [`49952f7`](https://github.com/stdlib-js/stdlib/commit/49952f7b2fbfdad1b20108aab89a34aeab73da48) - **refactor:** improve type specificity _(by Athan Reines)_
4143
- [`d47c5ea`](https://github.com/stdlib-js/stdlib/commit/d47c5eab74c76573c9479de1bc7addf8a97483cb) - **docs:** update example _(by Athan Reines)_

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ var oy = 0;
9797

9898
// Create the input and output ndarray-like objects:
9999
var x = {
100-
'ref': null,
101100
'dtype': 'float64',
102101
'data': xbuf,
103102
'shape': shape,

docs/types/test.ts

Lines changed: 27 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -16,38 +16,9 @@
1616
* limitations under the License.
1717
*/
1818

19-
/// <reference types="@stdlib/types"/>
20-
21-
import { ndarray } from '@stdlib/types/ndarray';
19+
import zeros = require( '@stdlib/ndarray-zeros' );
2220
import map = require( './index' );
2321

24-
/**
25-
* Mock function to create an ndarray-like object.
26-
*
27-
* @returns ndarray-like object
28-
*/
29-
function array(): ndarray {
30-
const obj: ndarray = {
31-
'byteLength': 80,
32-
'BYTES_PER_ELEMENT': 8,
33-
'data': new Float64Array( 10 ),
34-
'dtype': 'float64',
35-
'flags': {
36-
'ROW_MAJOR_CONTIGUOUS': true,
37-
'COLUMN_MAJOR_CONTIGUOUS': false
38-
},
39-
'length': 10,
40-
'ndims': 1,
41-
'offset': 0,
42-
'order': 'row-major',
43-
'shape': [ 10 ],
44-
'strides': [ 1 ],
45-
'get': (): number => 0,
46-
'set': (): ndarray => obj
47-
};
48-
return obj;
49-
}
50-
5122
/**
5223
* Evaluates the identity function.
5324
*
@@ -62,12 +33,11 @@ function identity( x: number ): number {
6233

6334
// The function returns `undefined`...
6435
{
65-
const x = array();
66-
const y = array();
67-
const arrays = [ x, y ];
36+
const x = zeros( [ 2, 2 ] );
37+
const y = zeros( [ 2, 2 ] );
6838

69-
map( arrays, identity ); // $ExpectType void
70-
map( arrays, identity, {} ); // $ExpectType void
39+
map( [ x, y ], identity ); // $ExpectType void
40+
map( [ x, y ], identity, {} ); // $ExpectType void
7141
}
7242

7343
// The compiler throws an error if the function is provided a first argument which is not an array-like object containing ndarray-like objects...
@@ -93,36 +63,34 @@ function identity( x: number ): number {
9363

9464
// The compiler throws an error if the function is provided a second argument which is not a callback function...
9565
{
96-
const x = array();
97-
const y = array();
98-
const arrays = [ x, y ];
66+
const x = zeros( [ 2, 2 ] );
67+
const y = zeros( [ 2, 2 ] );
9968

100-
map( arrays, '10' ); // $ExpectError
101-
map( arrays, 5 ); // $ExpectError
102-
map( arrays, true ); // $ExpectError
103-
map( arrays, false ); // $ExpectError
104-
map( arrays, null ); // $ExpectError
105-
map( arrays, undefined ); // $ExpectError
106-
map( arrays, [] ); // $ExpectError
107-
map( arrays, {} ); // $ExpectError
69+
map( [ x, y ], '10' ); // $ExpectError
70+
map( [ x, y ], 5 ); // $ExpectError
71+
map( [ x, y ], true ); // $ExpectError
72+
map( [ x, y ], false ); // $ExpectError
73+
map( [ x, y ], null ); // $ExpectError
74+
map( [ x, y ], undefined ); // $ExpectError
75+
map( [ x, y ], [] ); // $ExpectError
76+
map( [ x, y ], {} ); // $ExpectError
10877

109-
map( arrays, '10', {} ); // $ExpectError
110-
map( arrays, 5, {} ); // $ExpectError
111-
map( arrays, true, {} ); // $ExpectError
112-
map( arrays, false, {} ); // $ExpectError
113-
map( arrays, null, {} ); // $ExpectError
114-
map( arrays, undefined, {} ); // $ExpectError
115-
map( arrays, [], {} ); // $ExpectError
116-
map( arrays, {}, {} ); // $ExpectError
78+
map( [ x, y ], '10', {} ); // $ExpectError
79+
map( [ x, y ], 5, {} ); // $ExpectError
80+
map( [ x, y ], true, {} ); // $ExpectError
81+
map( [ x, y ], false, {} ); // $ExpectError
82+
map( [ x, y ], null, {} ); // $ExpectError
83+
map( [ x, y ], undefined, {} ); // $ExpectError
84+
map( [ x, y ], [], {} ); // $ExpectError
85+
map( [ x, y ], {}, {} ); // $ExpectError
11786
}
11887

11988
// The compiler throws an error if the function is provided an unsupported number of arguments...
12089
{
121-
const x = array();
122-
const y = array();
123-
const arrays = [ x, y ];
90+
const x = zeros( [ 2, 2 ] );
91+
const y = zeros( [ 2, 2 ] );
12492

12593
map(); // $ExpectError
126-
map( arrays ); // $ExpectError{
127-
map( arrays, identity, {}, {} ); // $ExpectError
94+
map( [ x, y ] ); // $ExpectError{
95+
map( [ x, y ], identity, {}, {} ); // $ExpectError
12896
}

0 commit comments

Comments
 (0)