Skip to content

Commit 1cd3feb

Browse files
committed
Auto-generated commit
1 parent e7b6141 commit 1cd3feb

File tree

4 files changed

+6
-15
lines changed

4 files changed

+6
-15
lines changed

.github/workflows/test_coverage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,5 +72,5 @@ jobs:
7272
env:
7373
webhook_url: ${{ secrets.STDLIB_COVERAGE_URL }}
7474
webhook_secret: ${{ secrets.STDLIB_WEBHOOK_SECRET }}
75-
data: '{ "coverage": ${{ steps.extract-coverage.outputs.coverage }}, "run_id": "${{ github.run_id }}" }'
75+
data: '${{ steps.extract-coverage.outputs.coverage }}'
7676
if: ${{ false }}

lib/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@
3232

3333
// MODULES //
3434

35-
var incrspace = require( './incrspace.js' );
35+
var main = require( './main.js' );
3636

3737

3838
// EXPORTS //
3939

40-
module.exports = incrspace;
40+
module.exports = main;

lib/incrspace.js renamed to lib/main.js

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ var ceil = require( '@stdlib/math-base-special-ceil' );
2424
var isNumber = require( '@stdlib/assert-is-number' ).isPrimitive;
2525
var isnan = require( '@stdlib/math-base-assert-is-nan' );
2626
var MAX_LENGTH = require( '@stdlib/constants-uint32-max' );
27+
var gen = require( '@stdlib/array-base-incrspace' );
2728

2829

2930
// MAIN //
@@ -45,10 +46,8 @@ var MAX_LENGTH = require( '@stdlib/constants-uint32-max' );
4546
* // returns [ 0, 2, 4, 6, 8, 10 ]
4647
*/
4748
function incrspace( x1, x2, increment ) {
48-
var arr;
4949
var len;
5050
var inc;
51-
var i;
5251
if ( !isNumber( x1 ) || isnan( x1 ) ) {
5352
throw new TypeError( 'invalid argument. Start must be numeric. Value: `' + x1 + '`.' );
5453
}
@@ -64,19 +63,10 @@ function incrspace( x1, x2, increment ) {
6463
}
6564
}
6665
len = ceil( ( x2-x1 ) / inc );
67-
6866
if ( len > MAX_LENGTH ) {
6967
throw new RangeError( 'invalid arguments. Generated array exceeds maximum array length.' );
7068
}
71-
if ( len <= 1 ) {
72-
return [ x1 ];
73-
}
74-
arr = [];
75-
arr.push( x1 );
76-
for ( i = 1; i < len; i++ ) {
77-
arr.push( x1 + (inc*i) );
78-
}
79-
return arr;
69+
return gen( x1, x2, inc );
8070
}
8171

8272

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
"url": "https://github.com/stdlib-js/stdlib/issues"
3838
},
3939
"dependencies": {
40+
"@stdlib/array-base-incrspace": "^0.0.x",
4041
"@stdlib/assert-is-number": "^0.0.x",
4142
"@stdlib/constants-uint32-max": "^0.0.x",
4243
"@stdlib/math-base-assert-is-nan": "^0.0.x",

0 commit comments

Comments
 (0)