stdlib-js / array

Compare b1dbe12 ... +1 ... e58f193

Coverage Reach
complex128/lib/main.js complex128/lib/from_iterator_map.js complex128/lib/from_iterator.js complex128/lib/from_array.js complex128/lib/index.js complex64/lib/main.js complex64/lib/from_iterator_map.js complex64/lib/from_iterator.js complex64/lib/from_array.js complex64/lib/index.js linspace/lib/assign.js linspace/lib/main.js linspace/lib/accessors_complex.js linspace/lib/generic_complex.js linspace/lib/typed_complex.js linspace/lib/accessors_real.js linspace/lib/typed_real.js linspace/lib/generic_real.js linspace/lib/validate.js linspace/lib/index.js pool/lib/factory.js pool/lib/validate.js pool/lib/pool.js pool/lib/index.js pool/lib/main.js base/copy/lib/main.js base/copy/lib/index.js base/arraylike2object/lib/main.js base/arraylike2object/lib/getter.js base/arraylike2object/lib/getter.accessor.js base/arraylike2object/lib/setter.js base/arraylike2object/lib/setter.accessor.js base/arraylike2object/lib/index.js base/logspace/lib/main.js base/logspace/lib/index.js base/linspace/lib/main.js base/linspace/lib/index.js base/incrspace/lib/main.js base/incrspace/lib/index.js base/lib/index.js base/unitspace/lib/main.js base/unitspace/lib/index.js base/zero-to/lib/main.js base/zero-to/lib/index.js base/filled-by/lib/main.js base/filled-by/lib/index.js base/filled/lib/main.js base/filled/lib/index.js base/ones/lib/main.js base/ones/lib/index.js base/zeros/lib/main.js base/zeros/lib/index.js filled-by/lib/main.js filled-by/lib/index.js filled/lib/main.js filled/lib/index.js to-circular-iterator/lib/main.js to-circular-iterator/lib/index.js to-view-iterator/lib/main.js to-view-iterator/lib/index.js to-view-iterator-right/lib/main.js to-view-iterator-right/lib/index.js datespace/lib/main.js datespace/lib/index.js lib/index.js to-strided-iterator/lib/main.js to-strided-iterator/lib/index.js to-sparse-iterator-right/lib/main.js to-sparse-iterator-right/lib/index.js to-sparse-iterator/lib/main.js to-sparse-iterator/lib/index.js from-iterator/lib/main.js from-iterator/lib/index.js min-dtype/lib/main.js min-dtype/lib/index.js same-kind-casts/lib/main.js same-kind-casts/lib/index.js safe-casts/lib/main.js safe-casts/lib/index.js to-iterator-right/lib/main.js to-iterator-right/lib/index.js convert/lib/main.js convert/lib/index.js to-json/lib/main.js to-json/lib/type.js to-json/lib/ctors.js to-json/lib/index.js to-iterator/lib/main.js to-iterator/lib/index.js promotion-rules/lib/main.js promotion-rules/lib/index.js dtype/lib/main.js dtype/lib/ctors.js dtype/lib/ctor2dtype.js dtype/lib/dtypes.js dtype/lib/index.js shape/lib/main.js shape/lib/index.js typed/lib/main.js typed/lib/index.js reviver/lib/ctors.js reviver/lib/main.js reviver/lib/index.js typed-complex/lib/main.js typed-complex/lib/index.js typed-real/lib/main.js typed-real/lib/index.js full/lib/main.js full/lib/index.js incrspace/lib/main.js incrspace/lib/index.js full-like/lib/main.js full-like/lib/index.js ones-like/lib/main.js ones-like/lib/index.js next-dtype/lib/main.js next-dtype/lib/index.js zeros/lib/main.js zeros/lib/index.js ones/lib/main.js ones/lib/index.js typed-ctors/lib/ctors.js typed-ctors/lib/main.js typed-ctors/lib/index.js ctors/lib/ctors.js ctors/lib/main.js ctors/lib/index.js logspace/lib/main.js logspace/lib/index.js typed-real-ctors/lib/ctors.js typed-real-ctors/lib/main.js typed-real-ctors/lib/index.js typed-integer-ctors/lib/ctors.js typed-integer-ctors/lib/main.js typed-integer-ctors/lib/index.js uint32/lib/index.js uint32/lib/polyfill.js uint32/lib/main.js uint16/lib/index.js uint16/lib/polyfill.js uint16/lib/main.js zeros-like/lib/main.js zeros-like/lib/index.js int16/lib/index.js int16/lib/polyfill.js int16/lib/main.js int32/lib/index.js int32/lib/polyfill.js int32/lib/main.js dataview/lib/index.js dataview/lib/polyfill.js dataview/lib/main.js uint8c/lib/index.js uint8c/lib/polyfill.js uint8c/lib/main.js float32/lib/index.js float32/lib/polyfill.js float32/lib/main.js buffer/lib/index.js buffer/lib/polyfill.js buffer/lib/main.js uint8/lib/index.js uint8/lib/polyfill.js uint8/lib/main.js int8/lib/index.js int8/lib/polyfill.js int8/lib/main.js float64/lib/index.js float64/lib/polyfill.js float64/lib/main.js shared-buffer/lib/index.js shared-buffer/lib/polyfill.js shared-buffer/lib/main.js typed-unsigned-integer-ctors/lib/ctors.js typed-unsigned-integer-ctors/lib/main.js typed-unsigned-integer-ctors/lib/index.js typed-float-ctors/lib/ctors.js typed-float-ctors/lib/main.js typed-float-ctors/lib/index.js typed-signed-integer-ctors/lib/ctors.js typed-signed-integer-ctors/lib/main.js typed-signed-integer-ctors/lib/index.js convert-same/lib/main.js convert-same/lib/index.js typed-complex-ctors/lib/ctors.js typed-complex-ctors/lib/main.js typed-complex-ctors/lib/index.js typed-real-float-ctors/lib/ctors.js typed-real-float-ctors/lib/main.js typed-real-float-ctors/lib/index.js typed-dtypes/lib/main.js typed-dtypes/lib/index.js typed-complex-dtypes/lib/main.js typed-complex-dtypes/lib/index.js typed-real-float-dtypes/lib/main.js typed-real-float-dtypes/lib/index.js typed-integer-dtypes/lib/main.js typed-integer-dtypes/lib/index.js typed-real-dtypes/lib/main.js typed-real-dtypes/lib/index.js typed-float-dtypes/lib/main.js typed-float-dtypes/lib/index.js dtypes/lib/main.js dtypes/lib/index.js typed-signed-integer-dtypes/lib/main.js typed-signed-integer-dtypes/lib/index.js typed-unsigned-integer-dtypes/lib/main.js typed-unsigned-integer-dtypes/lib/index.js

Flags

Flags have been temporarily removed from this view while the flagging feature is refactored for better performance and user experience.

You can still use flags when viewing individual files. Flag-level thresholds will also remain on pull and merge requests in your repository provider.

More information can be found in our documentation.


@@ -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;

Learn more Showing 2 files with coverage changes found.

New file base/zero-to/lib/index.js
New
Loading file...
New file base/zero-to/lib/main.js
New
Loading file...
Files Coverage
index.js 100.00%
main.js 100.00%
Folder Totals (2 files) 100.00%
Project Totals (208 files) 99.95%
Loading