Skip to content

Commit c5f9ff4

Browse files
committed
Auto-generated commit
1 parent 56289e3 commit c5f9ff4

5 files changed

Lines changed: 17 additions & 72 deletions

File tree

.github/.keepalive

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2023-11-01T01:23:08.892Z

.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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
"devDependencies": {
5050
"@stdlib/assert-is-nonnegative-integer": "^0.1.0",
5151
"@stdlib/bench": "^0.1.0",
52-
"@stdlib/math-base-special-floor": "^0.1.0",
52+
"@stdlib/math-base-special-floor": "^0.1.1",
5353
"@stdlib/random-base-discrete-uniform": "^0.1.0",
5454
"@stdlib/random-base-randu": "^0.1.0",
5555
"tape": "git+https://github.com/kgryte/tape.git#fix/globby",

test/dist/test.js

Lines changed: 4 additions & 69 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,78 +21,13 @@
2121
// MODULES //
2222

2323
var tape = require( 'tape' );
24-
var ind = 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 ind, 'function', 'main export is a function' );
31+
t.strictEqual( main !== void 0, true, 'main export is defined' );
3232
t.end();
3333
});
34-
35-
tape( 'when the `mode` is equal to "clamp", the function clamps an index to the interval [0,max]', function test( t ) {
36-
t.strictEqual( ind( 2, 10, 'clamp' ), 2, 'returns expected value' );
37-
t.strictEqual( ind( -5, 10, 'clamp' ), 0, 'returns expected value' );
38-
t.strictEqual( ind( 15, 10, 'clamp' ), 10, 'returns expected value' );
39-
t.end();
40-
});
41-
42-
tape( 'when the `mode` is equal to "wrap", the function wraps an index on the interval [0,max]', function test( t ) {
43-
var expected;
44-
var values;
45-
var i;
46-
47-
values = [ -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 ]; // eslint-disable-line max-len
48-
expected = [ 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5 ]; // eslint-disable-line max-len
49-
50-
for ( i = 0; i < values.length; i++ ) {
51-
t.strictEqual( ind( values[ i ], 9, 'wrap' ), expected[ i ], 'returns expected value. idx: '+values[ i ]+'. expected: '+expected[ i ]+'.' );
52-
}
53-
t.end();
54-
});
55-
56-
tape( 'when the `mode` is equal to "wrap", the function wraps an index on the interval [0,max]', function test( t ) {
57-
t.strictEqual( ind( 2, 10, 'wrap' ), 2, 'returns expected value' );
58-
t.strictEqual( ind( 12, 10, 'wrap' ), 1, 'returns expected value' );
59-
t.strictEqual( ind( -2, 10, 'wrap' ), 9, 'returns expected value' );
60-
t.strictEqual( ind( 21, 10, 'wrap' ), 10, 'returns expected value' );
61-
t.strictEqual( ind( 22, 10, 'wrap' ), 0, 'returns expected value' );
62-
t.strictEqual( ind( 26, 10, 'wrap' ), 4, 'returns expected value' );
63-
t.strictEqual( ind( -21, 10, 'wrap' ), 1, 'returns expected value' );
64-
t.strictEqual( ind( -22, 10, 'wrap' ), 0, 'returns expected value' );
65-
t.strictEqual( ind( -26, 10, 'wrap' ), 7, 'returns expected value' );
66-
t.end();
67-
});
68-
69-
tape( 'when the `mode` is equal to `throw`, the function returns the index when on the interval [0,max]', function test( t ) {
70-
var max;
71-
var i;
72-
73-
max = 10;
74-
for ( i = 0; i < max+1; i++ ) {
75-
t.strictEqual( ind( i, max, 'throw' ), i, 'returns expected value' );
76-
}
77-
t.end();
78-
});
79-
80-
tape( 'when the `mode` is equal to `throw`, the function throws an error when a provided index is outside the interval [0,max]', function test( t ) {
81-
var max;
82-
var i;
83-
84-
max = 10;
85-
for ( i = -100; i < 0; i++ ) {
86-
t.throws( badValue( i ), RangeError, 'throws an range error when provided '+i );
87-
}
88-
for ( i = max+1; i < 100; i++ ) {
89-
t.throws( badValue( i ), RangeError, 'throws an range error when provided '+i );
90-
}
91-
t.end();
92-
93-
function badValue( value ) {
94-
return function badValue() {
95-
ind( value, max, 'throw' );
96-
};
97-
}
98-
});

0 commit comments

Comments
 (0)