stdlib-js / array

@@ -117,6 +117,15 @@
Loading
117 117
*/
118 118
setReadOnly( ns, 'unitspace', require( './../../base/unitspace' ) );
119 119
120 +
/**
121 +
* @name zeroTo
122 +
* @memberof ns
123 +
* @readonly
124 +
* @type {Function}
125 +
* @see {@link module:@stdlib/array/base/zero-to}
126 +
*/
127 +
setReadOnly( ns, 'zeroTo', require( './../../base/zero-to' ) );
128 +
120 129
/**
121 130
* @name zeros
122 131
* @memberof ns

@@ -0,0 +1,40 @@
Loading
1 +
/**
2 +
* @license Apache-2.0
3 +
*
4 +
* Copyright (c) 2022 The Stdlib Authors.
5 +
*
6 +
* Licensed under the Apache License, Version 2.0 (the "License");
7 +
* you may not use this file except in compliance with the License.
8 +
* You may obtain a copy of the License at
9 +
*
10 +
*    http://www.apache.org/licenses/LICENSE-2.0
11 +
*
12 +
* Unless required by applicable law or agreed to in writing, software
13 +
* distributed under the License is distributed on an "AS IS" BASIS,
14 +
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 +
* See the License for the specific language governing permissions and
16 +
* limitations under the License.
17 +
*/
18 +
19 +
'use strict';
20 +
21 +
/**
22 +
* Generate a linearly spaced numeric array whose elements increment by 1 starting from zero.
23 +
*
24 +
* @module @stdlib/array/base/zero-to
25 +
*
26 +
* @example
27 +
* var zeroTo = require( '@stdlib/array/base/zero-to' );
28 +
*
29 +
* var arr = zeroTo( 6 );
30 +
* // returns [ 0, 1, 2, 3, 4, 5 ]
31 +
*/
32 +
33 +
// MODULES //
34 +
35 +
var main = require( './main.js' );
36 +
37 +
38 +
// EXPORTS //
39 +
40 +
module.exports = main;

@@ -0,0 +1,50 @@
Loading
1 +
/**
2 +
* @license Apache-2.0
3 +
*
4 +
* Copyright (c) 2022 The Stdlib Authors.
5 +
*
6 +
* Licensed under the Apache License, Version 2.0 (the "License");
7 +
* you may not use this file except in compliance with the License.
8 +
* You may obtain a copy of the License at
9 +
*
10 +
*    http://www.apache.org/licenses/LICENSE-2.0
11 +
*
12 +
* Unless required by applicable law or agreed to in writing, software
13 +
* distributed under the License is distributed on an "AS IS" BASIS,
14 +
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 +
* See the License for the specific language governing permissions and
16 +
* limitations under the License.
17 +
*/
18 +
19 +
'use strict';
20 +
21 +
// MAIN //
22 +
23 +
/**
24 +
* Generates a linearly spaced numeric array whose elements increment by 1 starting from zero.
25 +
*
26 +
* @param {number} n - number of elements
27 +
* @returns {Array<number>} linearly spaced numeric array
28 +
*
29 +
* @example
30 +
* var arr = zeroTo( 6 );
31 +
* // returns [ 0, 1, 2, 3, 4, 5 ]
32 +
*/
33 +
function zeroTo( n ) {
34 +
	var arr;
35 +
	var i;
36 +
37 +
	arr = [];
38 +
	if ( n <= 0 ) {
39 +
		return arr;
40 +
	}
41 +
	for ( i = 0; i < n; i++ ) {
42 +
		arr.push( i );
43 +
	}
44 +
	return arr;
45 +
}
46 +
47 +
48 +
// EXPORTS //
49 +
50 +
module.exports = zeroTo;
Files Coverage
base 100.00%
buffer/lib 100.00%
complex128/lib 100.00%
complex64/lib 100.00%
convert-same/lib 100.00%
convert/lib 100.00%
ctors/lib 100.00%
dataview/lib 100.00%
datespace/lib 100.00%
dtype/lib 100.00%
dtypes/lib 100.00%
filled-by/lib 100.00%
filled/lib 100.00%
float32/lib 100.00%
float64/lib 100.00%
from-iterator/lib 100.00%
full-like/lib 100.00%
full/lib 100.00%
incrspace/lib 100.00%
int16/lib 100.00%
int32/lib 100.00%
int8/lib 100.00%
linspace/lib 100.00%
logspace/lib 100.00%
min-dtype/lib 100.00%
next-dtype/lib 100.00%
ones-like/lib 100.00%
ones/lib 100.00%
pool/lib 98.92%
promotion-rules/lib 100.00%
reviver/lib 100.00%
safe-casts/lib 100.00%
same-kind-casts/lib 100.00%
shape/lib 100.00%
shared-buffer/lib 100.00%
to-circular-iterator/lib 100.00%
to-iterator-right/lib 100.00%
to-iterator/lib 100.00%
to-json/lib 100.00%
to-sparse-iterator-right/lib 100.00%
to-sparse-iterator/lib 100.00%
to-strided-iterator/lib 100.00%
to-view-iterator-right/lib 100.00%
to-view-iterator/lib 100.00%
typed-complex-ctors/lib 100.00%
typed-complex-dtypes/lib 100.00%
typed-complex/lib 100.00%
typed-ctors/lib 100.00%
typed-dtypes/lib 100.00%
typed-float-ctors/lib 100.00%
typed-float-dtypes/lib 100.00%
typed-integer-ctors/lib 100.00%
typed-integer-dtypes/lib 100.00%
typed-real-ctors/lib 100.00%
typed-real-dtypes/lib 100.00%
typed-real-float-ctors/lib 100.00%
typed-real-float-dtypes/lib 100.00%
typed-real/lib 100.00%
typed-signed-integer-ctors/lib 100.00%
typed-signed-integer-dtypes/lib 100.00%
typed-unsigned-integer-ctors/lib 100.00%
typed-unsigned-integer-dtypes/lib 100.00%
typed/lib 100.00%
uint16/lib 100.00%
uint32/lib 100.00%
uint8/lib 100.00%
uint8c/lib 100.00%
zeros-like/lib 100.00%
zeros/lib 100.00%
lib/index.js 100.00%
Project Totals (208 files) 99.95%
3608166489
unittests

No yaml found.

Create your codecov.yml to customize your Codecov experience

Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading