10000 Auto-generated commit · stdlib-js/array-ones@9fd234f · GitHub
[go: up one dir, main page]

Skip to content

Commit 9fd234f

Browse files
committed
Auto-generated commit
1 parent d5e610a commit 9fd234f

File tree

5 files changed

+29
-310
lines changed

5 files changed

+29
-310
lines changed

.github/.keepalive

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2023-11-01T06:06:57.359Z

.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

CONTRIBUTORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,4 @@ Stephannie Jiménez Gacha <steff456@hotmail.com>
3737
Yernar Yergaziyev <yernar.yergaziyev@erg.kz>
3838
orimiles5 <97595296+orimiles5@users.noreply.github.com>
3939
rei2hu <reimu@reimu.ws>
40+
Robert Gislason <gztown2216@yahoo.com>

package.json

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -38,31 +38,31 @@
3838
},
3939
"dependencies": {
4040
"@stdlib/array-full": "^0.1.0",
41-
"@stdlib/complex-float32": "^0.1.0",
42-
"@stdlib/complex-float64": "^0.1.0",
41+
"@stdlib/complex-float32": "^0.1.1",
42+
"@stdlib/complex-float64": "^0.1.1",
4343
"@stdlib/types": "^0.1.0"
4444
},
4545
"devDependencies": {
4646
"@stdlib/array-complex128": "^0.1.0",
4747
"@stdlib/array-complex64": "^0.1.0",
4848
"@stdlib/array-dtypes": "^0.1.0",
49-
"@stdlib/array-float32": "^0.1.0",
50-
"@stdlib/array-float64": "^0.1.0",
51-
"@stdlib/array-int16": "^0.1.0",
52-
"@stdlib/array-int32": "^0.1.0",
53-
"@stdlib/array-int8": "^0.1.0",
54-
"@stdlib/array-uint16": "^0.1.0",
55-
"@stdlib/array-uint32": "^0.1.0",
56-
"@stdlib/array-uint8": "^0.1.0",
57-
"@stdlib/array-uint8c": "^0.1.0",
49+
"@stdlib/array-float32": "^0.1.1",
50+
"@stdlib/array-float64": "^0.1.1",
51+
"@stdlib/array-int16": "^0.1.1",
52+
"@stdlib/array-int32": "^0.1.1",
53+
"@stdlib/array-int8": "^0.1.1",
54+
"@stdlib/array-uint16": "^0.1.1",
55+
"@stdlib/array-uint32": "^0.1.1",
56+
"@stdlib/array-uint8": "^0.1.1",
57+
"@stdlib/array-uint8c": "^0.1.1",
5858
"@stdlib/assert-instance-of": "^0.1.1",
5959
"@stdlib/assert-is-array": "^0.1.1",
6060
"@stdlib/assert-is-typed-array": "^0.1.0",
6161
"@stdlib/assert-is-typed-array-like": "^0.1.0",
6262
"@stdlib/bench": "^0.1.0",
6363
"@stdlib/math-base-special-pow": "^0.1.0",
64-
"@stdlib/strided-base-reinterpret-complex128": "^0.1.0",
65-
"@stdlib/strided-base-reinterpret-complex64": "^0.1.0",
64+
"@stdlib/strided-base-reinterpret-complex128": "^0.1.1",
65+
"@stdlib/strided-base-reinterpret-complex64": "^0.1.1",
6666
"tape": "git+https://github.com/kgryte/tape.git#fix/globby",
6767
"istanbul": "^0.4.1",
6868
"tap-min": "git+https://github.com/Planeshifter/tap-min.git"

test/dist/test.js

Lines changed: 4 additions & 295 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* @license Apache-2.0
33
*
4-
* Copyright (c) 2022 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,304 +21,13 @@
2121
// MODULES //
2222

2323
var tape = require( 'tape' );
24-
var Float64Array = require( '@stdlib/array-float64' );
25-
var Float32Array = require( '@stdlib/array-float32' );
26-
var Int32Array = require( '@stdlib/array-int32' );
27-
var Uint32Array = require( '@stdlib/array-uint32' );
28-
var Int16Array = require( '@stdlib/array-int16' );
29-
var Uint16Array = require( '@stdlib/array-uint16' );
30-
var Int8Array = require( '@stdlib/array-int8' );
31-
var Uint8Array = require( '@stdlib/array-uint8' );
32-
var Uint8ClampedArray = require( '@stdlib/array-uint8c' );
33-
var Complex64Array = require( '@stdlib/array-complex64' );
34-
var Complex128Array = require( '@stdlib/array-complex128' );
35-
var reinterpret64 = require( '@stdlib/strided-base-reinterpret-complex64' );
36-
var reinterpret128 = require( '@stdlib/strided-base-reinterpret-complex128' );
37-
var instanceOf = require( '@stdlib/assert-instance-of' );
38-
var ones = require( './../../dist' );
24+
var main = require( './../../dist' );
3925

4026

4127
// TESTS //
4228

43-
tape( 'main export is a function', function test( t ) {
29+
tape( 'main export is defined', function test( t ) {
4430
t.ok( true, __filename );
45-
t.strictEqual( typeof ones, 'function', 'main export is a function' );
46-
t.end();
47-
});
48-
49-
tape( 'the function throws an error if provided a value other than a nonnegative integer for the first argument', function test( t ) {
50-
var values;
51-
var i;
52-
53-
values = [
54-
'5',
55-
-3,
56-
3.14,
57-
NaN,
58-
true,
59-
false,
60-
null,
61-
void 0,
62-
[],
63-
{},
64-
function noop() {}
65-
];
66-
67-
for ( i = 0; i < values.length; i++ ) {
68-
t.throws( badValue( values[i] ), TypeError, 'throws an error when provided '+values[i] );
69-
}
70-
t.end();
71-
72-
function badValue( value ) {
73-
return function badValue() {
74-
ones( value );
75-
};
76-
}
77-
});
78-
79-
tape( 'the function throws an error if provided a value other than a nonnegative integer for the first argument (dtype)', function test( t ) {
80-
var values;
81-
var i;
82-
83-
values = [
84-
'5',
85-
-3,
86-
3.14,
87-
NaN,
88-
true,
89-
false,
90-
null,
91-
void 0,
92-
[],
93-
{},
94-
function noop() {}
95-
];
96-
97-
for ( i = 0; i < values.length; i++ ) {
98-
t.throws( badValue( values[i] ), TypeError, 'throws an error when provided '+values[i] );
99-
}
100-
t.end();
101-
102-
function badValue( value ) {
103-
return function badValue() {
104-
ones( value, 'float32' );
105-
};
106-
}
107-
});
108-
109-
tape( 'the function throws an error if provided an unrecognized data type', function test( t ) {
110-
var values;
111-
var i;
112-
113-
values = [
114-
'5',
115-
'beep',
116-
'ones',
117-
'Int32',
118-
'Uint32',
119-
'Int16',
120-
'Uint16',
121-
'Int8',
122-
'Uint8',
123-
'Uint8c',
124-
'uint8_clamped',
125-
'Float64',
126-
'Float32',
127-
'FLOAT64',
128-
'FLOAT32',
129-
'GENERIC'
130-
];
131-
132-
for ( i = 0; i < values.length; i++ ) {
133-
t.throws( badValue( values[i] ), TypeError, 'throws an error when provided '+values[i] );
134-
}
135-
t.end();
136-
137-
function badValue( value ) {
138-
return function badValue() {
139-
ones( 10, value );
140-
};
141-
}
142-
});
143-
144-
tape( 'the function returns a filled array (default)', function test( t ) {
145-
var expected;
146-
var arr;
147-
148-
expected = new Float64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0 ] );
149-
150-
arr = ones( 5 );
151-
t.strictEqual( instanceOf( arr, Float64Array ), true, 'returns expected value' );
152-
t.strictEqual( arr.length, expected.length, 'returns expected value' );
153-
t.deepEqual( arr, expected, 'returns expected value' );
154-
155-
t.end();
156-
});
157-
158-
tape( 'the function returns a filled array (dtype=float64)', function test( t ) {
159-
var expected;
160-
var arr;
161-
162-
expected = new Float64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0 ] );
163-
164-
arr = ones( 5, 'float64' );
165-
t.strictEqual( instanceOf( arr, Float64Array ), true, 'returns expected value' );
166-
t.strictEqual( arr.length, expected.length, 'returns expected value' );
167-
t.deepEqual( arr, expected, 'returns expected value' );
168-
169-
t.end();
170-
});
171-
172-
tape( 'the function returns a filled array (dtype=float32)', function test( t ) {
173-
var expected;
174-
var arr;
175-
176-
expected = new Float32Array( [ 1.0, 1.0, 1.0, 1.0, 1.0 ] );
177-
178-
arr = ones( 5, 'float32' );
179-
t.strictEqual( instanceOf( arr, Float32Array ), true, 'returns expected value' );
180-
t.strictEqual( arr.length, expected.length, 'returns expected value' );
181-
t.deepEqual( arr, expected, 'returns expected value' );
182-
183-
t.end();
184-
});
185-
186-
tape( 'the function returns a filled array (dtype=complex128)', function test( t ) {
187-
var expected;
188-
var arr;
189-
190-
expected = new Float64Array( [ 1.0, 0.0, 1.0, 0.0 ] );
191-
192-
arr = ones( 2, 'complex128' );
193-
t.strictEqual( instanceOf( arr, Complex128Array ), true, 'returns expected value' );
194-
t.strictEqual( arr.length, expected.length/2, 'returns expected value' );
195-
t.deepEqual( reinterpret128( arr, 0 ), expected, 'returns expected value' );
196-
197-
t.end();
198-
});
199-
200-
tape( 'the function returns a filled array (dtype=complex64)', function test( t ) {
201-
var expected;
202-
var arr;
203-
204-
expected = new Float32Array( [ 1.0, 0.0, 1.0, 0.0 ] );
205-
206-
arr = ones( 2, 'complex64' );
207-
t.strictEqual( instanceOf( arr, Complex64Array ), true, 'returns expected value' );
208-
t.strictEqual( arr.length, expected.length/2, 'returns expected value' );
209-
t.deepEqual( reinterpret64( arr, 0 ), expected, 'returns expected value' );
210-
211-
t.end();
212-
});
213-
214-
tape( 'the function returns a filled array (dtype=int32)', function test( t ) {
215-
var expected;
216-
var arr;
217-
218-
expected = new Int32Array( [ 1, 1, 1, 1, 1 ] );
219-
220-
arr = ones( 5, 'int32' );
221-
t.strictEqual( instanceOf( arr, Int32Array ), true, 'returns expected value' );
222-
t.strictEqual( arr.length, expected.length, 'returns expected value' );
223-
t.deepEqual( arr, expected, 'returns expected value' );
224-
225-
t.end();
226-
});
227-
228-
tape( 'the function returns a filled array (dtype=uint32)', function test( t ) {
229-
var expected;
230-
var arr;
231-
232-
expected = new Uint32Array( [ 1, 1, 1, 1, 1 ] );
233-
234-
arr = ones( 5, 'uint32' );
235-
t.strictEqual( instanceOf( arr, Uint32Array ), true, 'returns expected value' );
236-
t.strictEqual( arr.length, expected.length, 'returns expected value' );
237-
t.deepEqual( arr, expected, 'returns expected value' );
238-
239-
t.end();
240-
});
241-
242-
tape( 'the function returns a filled array (dtype=int16)', function test( t ) {
243-
var expected;
244-
var arr;
245-
246-
expected = new Int16Array( [ 1, 1, 1, 1, 1 ] );
247-
248-
arr = ones( 5, 'int16' );
249-
t.strictEqual( instanceOf( arr, Int16Array ), true, 'returns expected value' );
250-
t.strictEqual( arr.length, expected.length, 'returns expected value' );
251-
t.deepEqual( arr, expected, 'returns expected value' );
252-
253-
t.end();
254-
});
255-
256-
tape( 'the function returns a filled array (dtype=uint16)', function test( t ) {
257-
var expected;
258-
var arr;
259-
260-
expected = new Uint16Array( [ 1, 1, 1, 1, 1 ] );
261-
262-
arr = ones( 5, 'uint16' );
263-
t.strictEqual( instanceOf( arr, Uint16Array ), true, 'returns expected value' );
264-
t.strictEqual( arr.length, expected.length, 'returns expected value' );
265-
t.deepEqual( arr, expected, 'returns expected value' );
266-
267-
t.end();
268-
});
269-
270-
tape( 'the function returns a filled array (dtype=int8)', function test( t ) {
271-
var expected;
272-
var arr;
273-
274-
expected = new Int8Array( [ 1, 1, 1, 1, 1 ] );
275-
276-
arr = ones( 5, 'int8' );
277-
t.strictEqual( instanceOf( arr, Int8Array ), true, 'returns expected value' );
278-
t.strictEqual( arr.length, expected.length, 'returns expected value' );
279-
t.deepEqual( arr, expected, 'returns expected value' );
280-
281-
t.end();
282-
});
283-
284-
tape( 'the function returns a filled array (dtype=uint8)', function test( t ) {
285-
var expected;
286-
var arr;
287-
288-
expected = new Uint8Array( [ 1, 1, 1, 1, 1 ] );
289-
290-
arr = ones( 5, 'uint8' );
291-
t.strictEqual( instanceOf( arr, Uint8Array ), true, 'returns expected value' );
292-
t.strictEqual( arr.length, expected.length, 'returns expected value' );
293-
t.deepEqual( arr, expected, 'returns expected value' );
294-
295-
t.end();
296-
});
297-
298-
tape( 'the function returns a filled array (dtype=uint8c)', function test( t ) {
299-
var expected;
300-
var arr;
301-
302-
expected = new Uint8ClampedArray( [ 1, 1, 1, 1, 1 ] );
303-
304-
arr = ones( 5, 'uint8c' );
305-
t.strictEqual( instanceOf( arr, Uint8ClampedArray ), true, 'returns expected value' );
306-
t.strictEqual( arr.length, expected.length, 'returns expected value' );
307-
t.deepEqual( arr, expected, 'returns expected value' );
308-
309-
t.end();
310-
});
311-
312-
tape( 'the function returns a filled array (dtype=generic)', function test( t ) {
313-
var expected;
314-
var arr;
315-
316-
expected = [ 1, 1, 1, 1, 1 ];
317-
318-
arr = ones( 5, 'generic' );
319-
t.strictEqual( instanceOf( arr, Array ), true, 'returns expected value' );
320-
t.strictEqual( arr.length, expected.length, 'returns expected value' );
321-
t.deepEqual( arr, expected, 'returns expected value' );
322-
31+
t.strictEqual( main !== void 0, true, 'main export is defined' );
32332
t.end();
32433
});

0 commit comments

Comments
 (0)
0