Skip to content

Commit 58d9976

Browse files
committed
Release v0.1.0
1 parent 5325983 commit 58d9976

File tree

5 files changed

+17
-128
lines changed

5 files changed

+17
-128
lines changed

.github/workflows/publish.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,11 @@ jobs:
182182
fi
183183
# Trim leading and trailing whitespace:
184184
dep=$(echo "$dep" | xargs)
185-
version="^$(npm view $dep version)"
185+
version="$(npm view $dep version)"
186+
if [[ -z "$version" ]]; then
187+
continue
188+
fi
189+
version="^$version"
186190
jq -r --arg dep "$dep" --arg version "$version" '.dependencies[$dep] = $version' package.json > package.json.tmp
187191
mv package.json.tmp package.json
188192
done
@@ -192,7 +196,11 @@ jobs:
192196
fi
193197
# Trim leading and trailing whitespace:
194198
dep=$(echo "$dep" | xargs)
195-
version="^$(npm view $dep version)"
199+
version="$(npm view $dep version)"
200+
if [[ -z "$version" ]]; then
201+
continue
202+
fi
203+
version="^$version"
196204
jq -r --arg dep "$dep" --arg version "$version" '.devDependencies[$dep] = $version' package.json > package.json.tmp
197205
mv package.json.tmp package.json
198206
done

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,8 +204,8 @@ Copyright © 2016-2023. The Stdlib [Authors][stdlib-authors].
204204
[npm-image]: http://img.shields.io/npm/v/@stdlib/ndarray-shape.svg
205205
[npm-url]: https://npmjs.org/package/@stdlib/ndarray-shape
206206

207-
[test-image]: https://github.com/stdlib-js/ndarray-shape/actions/workflows/test.yml/badge.svg?branch=main
208-
[test-url]: https://github.com/stdlib-js/ndarray-shape/actions/workflows/test.yml?query=branch:main
207+
[test-image]: https://github.com/stdlib-js/ndarray-shape/actions/workflows/test.yml/badge.svg?branch=v0.1.0
208+
[test-url]: https://github.com/stdlib-js/ndarray-shape/actions/workflows/test.yml?query=branch:v0.1.0
209209

210210
[coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/ndarray-shape/main.svg
211211
[coverage-url]: https://codecov.io/github/stdlib-js/ndarray-shape?branch=main

dist/index.js

Lines 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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@stdlib/ndarray-shape",
3-
"version": "0.0.0",
3+
"version": "0.1.0",
44
"description": "Return the shape of a provided ndarray.",
55
"license": "Apache-2.0",
66
"author": {

test/dist/test.js

Lines changed: 3 additions & 122 deletions
Original file line numberDiff line numberDiff line change
@@ -21,132 +21,13 @@
2121
// MODULES //
2222

2323
var tape = require( 'tape' );
24-
var zeros = require( '@stdlib/ndarray-zeros' );
25-
var shape = require( './../../dist' );
24+
var main = require( './../../dist' );
2625

2726

2827
// TESTS //
2928

30-
tape( 'main export is a function', function test( t ) {
29+
tape( 'main export is defined', function test( t ) {
3130
t.ok( true, __filename );
32-
t.strictEqual( typeof shape, 'function', 'main export is a function' );
33-
t.end();
34-
});
35-
36-
tape( 'the function throws an error if not provided a minimal ndarray-like object', function test( t ) {
37-
var values;
38-
var i;
39-
40-
values = [
41-
'5',
42-
5,
43-
NaN,
44-
true,
45-
false,
46-
null,
47-
void 0,
48-
{},
49-
function noop() {},
50-
{
51-
'shape': 3.14
52-
},
53-
{
54-
'shape': -1
55-
},
56-
{
57-
'shape': null
58-
},
59-
{
60-
'shape': {}
61-
},
62-
{
63-
'shape': [ 3.14 ]
64-
},
65-
{
66-
'shape': [ -1 ]
67-
}
68-
];
69-
for ( i = 0; i < values.length; i++ ) {
70-
t.throws( badValue( values[ i ] ), TypeError, 'throws an error when provided ' + values[ i ] );
71-
}
72-
t.end();
73-
74-
function badValue( value ) {
75-
return function badValue() {
76-
shape( value );
77-
};
78-
}
79-
});
80-
81-
tape( 'if provided a zero-dimensional ndarray, the function returns an empty array', function test( t ) {
82-
t.deepEqual( shape( zeros( [] ) ), [], 'returns expected value' );
83-
t.end();
84-
});
85-
86-
tape( 'the function returns the shape of an ndarray', function test( t ) {
87-
var expected;
88-
var values;
89-
var out;
90-
var i;
91-
92-
values = [
93-
zeros( [ 3, 3, 3 ] ),
94-
zeros( [ 1, 1 ] ),
95-
zeros( [ 3, 3, 0, 3 ] ),
96-
zeros( [ 1, 2, 3, 4 ] ),
97-
zeros( [ 5 ] )
98-
];
99-
100-
expected = [
101-
values[ 0 ].shape,
102-
values[ 1 ].shape,
103-
values[ 2 ].shape,
104-
values[ 3 ].shape,
105-
values[ 4 ].shape
106-
];
107-
108-
for ( i = 0; i < values.length; i++ ) {
109-
out = shape( values[ i ] );
110-
t.deepEqual( out, expected[ i ], 'returns expected value for shape '+values[ i ].shape.join( 'x' ) );
111-
}
112-
t.end();
113-
});
114-
115-
tape( 'the function accepts minimal ndarray-like objects (shape)', function test( t ) {
116-
var expected;
117-
var values;
118-
var out;
119-
var i;
120-
121-
values = [
122-
{
123-
'shape': [ 3, 3, 3 ]
124-
},
125-
{
126-
'shape': [ 1, 1 ]
127-
},
128-
{
129-
'shape': [ 3, 3, 0, 3 ]
130-
},
131-
{
132-
'shape': [ 1, 2, 3, 4 ]
133-
},
134-
{
135-
'shape': [ 5 ]
136-
}
137-
];
138-
139-
expected = [
140-
values[ 0 ].shape,
141-
values[ 1 ].shape,
142-
values[ 2 ].shape,
143-
values[ 3 ].shape,
144-
values[ 4 ].shape
145-
];
146-
147-
for ( i = 0; i < values.length; i++ ) {
148-
out = shape( values[ i ] );
149-
t.deepEqual( out, expected[ i ], 'returns expected value for shape '+values[ i ].shape.join( 'x' ) );
150-
}
31+
t.strictEqual( main !== void 0, true, 'main export is defined' );
15132
t.end();
15233
});

0 commit comments

Comments
 (0)