Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit ea70574

Browse filesBrowse files
committed
Auto-generated commit
1 parent 7fee715 commit ea70574
Copy full SHA for ea70574

File tree

3 files changed

+9
-101
lines changed
Filter options

3 files changed

+9
-101
lines changed

‎dist/index.js

Copy file name to clipboardExpand all lines: dist/index.js
+1-1Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json

Copy file name to clipboardExpand all lines: package.json
+4-3Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
"@stdlib/buffer-alloc-unsafe": "^0.1.0",
4949
"@stdlib/constants-float64-pinf": "^0.1.1",
5050
"@stdlib/math-base-assert-is-integer": "^0.1.1",
51-
"@stdlib/math-base-special-abs": "^0.1.0",
51+
"@stdlib/math-base-special-abs": "^0.1.1",
5252
"@stdlib/ndarray-base-assert-is-allowed-data-type-cast": "^0.1.0",
5353
"@stdlib/ndarray-base-assert-is-casting-mode": "^0.1.1",
5454
"@stdlib/ndarray-base-assert-is-data-type": "^0.1.0",
@@ -59,7 +59,7 @@
5959
"@stdlib/ndarray-base-numel": "^0.1.1",
6060
"@stdlib/ndarray-base-shape2strides": "^0.1.1",
6161
"@stdlib/ndarray-base-strides2offset": "^0.1.1",
62-
"@stdlib/ndarray-base-strides2order": "^0.1.0",
62+
"@stdlib/ndarray-base-strides2order": "^0.1.1",
6363
"@stdlib/ndarray-ctor": "^0.1.0",
6464
"@stdlib/ndarray-data-buffer": "github:stdlib-js/ndarray-data-buffer#main",
6565
"@stdlib/ndarray-defaults": "^0.1.1",
@@ -106,7 +106,8 @@
106106
"multidimensional",
107107
"dimensions",
108108
"dims",
109-
"numpy.array"
109+
"numpy.array",
110+
"numpy.asarray"
110111
],
111112
"__stdlib__": {},
112113
"funding": {

‎test/dist/test.js

Copy file name to clipboard
+4-97Lines changed: 4 additions & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* @license Apache-2.0
33
*
4-
* Copyright (c) 2018 The Stdlib Authors.
4+
* Copyright (c) 2023 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,106 +21,13 @@
2121
// MODULES //
2222

2323
var tape = require( 'tape' );
24-
var ndarray = require( './../../dist' );
24+
var main = require( './../../dist' );
2525

2626

2727
// TESTS //
2828

29-
tape( 'main export is a function', function test( t ) {
29+
tape( 'main export is defined', function test( t ) {
3030
t.ok( true, __filename );
31-
t.strictEqual( typeof ndarray, 'function', 'main export is a function' );
31+
t.strictEqual( main !== void 0, true, 'main export is defined' );
3232
t.end();
3333
});
34-
35-
tape( 'the function throws an error if provided an options argument which is not an object', function test( t ) {
36-
var values;
37-
var i;
38-
39-
values = [
40-
'5',
41-
5,
42-
NaN,
43-
true,
44-
false,
45-
null,
46-
void 0,
47-
function noop() {}
48-
];
49-
50-
for ( i = 0; i < values.length; i++ ) {
51-
t.throws( badValue( values[i] ), TypeError, 'throws an error when provided '+values[ i ] );
52-
}
53-
t.end();
54-
55-
function badValue( value ) {
56-
return function badValue() {
57-
ndarray( value );
58-
};
59-
}
60-
});
61-
62-
tape( 'the function throws an error if not provided either a `shape` or `buffer` option', function test( t ) {
63-
t.throws( badValue( {} ), Error, 'throws an error when not provided either a `shape` or `buffer` option' );
64-
t.end();
65-
66-
function badValue( value ) {
67-
return function badValue() {
68-
ndarray( value );
69-
};
70-
}
71-
});
72-
73-
tape( 'the function throws an error if provided an invalid option', function test( t ) {
74-
var values;
75-
var i;
76-
77-
values = [
78-
'5',
79-
'beep',
80-
'boop',
81-
'foo',
82-
'bar',
83-
5,
84-
NaN,
85-
true,
86-
false,
87-
null,
88-
void 0,
89-
[],
90-
{},
91-
function noop() {}
92-
];
93-
94-
for ( i = 0; i < values.length; i++ ) {
95-
t.throws( badValue( values[i] ), TypeError, 'throws an error when provided '+values[ i ] );
96-
}
97-
t.end();
98-
99-
function badValue( value ) {
100-
return function badValue() {
101-
var opts = {
102-
'shape': [ 3, 2 ],
103-
'dtype': value
104-
};
105-
ndarray( opts );
106-
};
107-
}
108-
});
109-
110-
tape( 'the function throws an error if provided a `shape` option which is incompatible with a provided buffer', function test( t ) {
111-
var opts = {
112-
'dtype': 'generic',
113-
'shape': [ 3, 3 ],
114-
'buffer': [ 1, 2, 3, 4, 5, 6 ]
115-
};
116-
t.throws( badValue( opts ), Error, 'throws an error when provided incompatible `shape` and `buffer` options' );
117-
t.end();
118-
119-
function badValue( value ) {
120-
return function badValue() {
121-
ndarray( value );
122-
};
123-
}
124-
});
125-
126-
// TODO: tests

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.