-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js.map
7 lines (7 loc) · 4.05 KB
/
index.js.map
1
2
3
4
5
6
7
{
"version": 3,
"sources": ["../lib/main.js", "../lib/index.js"],
"sourcesContent": ["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNonNegativeInteger = require( '@stdlib/assert-is-nonnegative-integer' ).isPrimitive;\nvar base = require( '@stdlib/array-base-one-to' );\nvar zeros = require( '@stdlib/array-zeros' );\nvar defaults = require( '@stdlib/array-defaults' );\nvar format = require( '@stdlib/string-format' );\n\n\n// VARIABLES //\n\nvar DEFAULT_DTYPE = defaults.get( 'dtypes.default' );\n\n\n// MAIN //\n\n/**\n* Generates a linearly spaced numeric array whose elements increment by 1 starting from one.\n*\n* @param {NonNegativeInteger} n - number of elements\n* @param {string} [dtype=\"float64\"] - data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} second argument must be a recognized data type\n* @returns {(TypedArray|Array|ComplexArray)} array or typed array\n*\n* @example\n* var arr = oneTo( 2 );\n* // returns <Float64Array>[ 1.0, 2.0 ]\n*\n* @example\n* var arr = oneTo( 2, 'float32' );\n* // returns <Float32Array>[ 1.0, 2.0 ]\n*/\nfunction oneTo( n ) {\n\tvar dtype;\n\tif ( !isNonNegativeInteger( n ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', n ) );\n\t}\n\tif ( arguments.length > 1 ) {\n\t\tdtype = arguments[ 1 ];\n\t\tif ( dtype === 'generic' ) {\n\t\t\treturn base( n );\n\t\t}\n\t} else {\n\t\tdtype = DEFAULT_DTYPE;\n\t}\n\treturn base.assign( zeros( n, dtype ), 1, 0 ); // defer dtype validation to `zeros`\n}\n\n\n// EXPORTS //\n\nmodule.exports = oneTo;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Generate a linearly spaced numeric array whose elements increment by 1 starting from one.\n*\n* @module @stdlib/array-one-to\n*\n* @example\n* var oneTo = require( '@stdlib/array-one-to' );\n*\n* var arr = oneTo( 2 );\n* // returns <Float64Array>[ 1.0, 2.0 ]\n*\n* @example\n* var oneTo = require( '@stdlib/array-one-to' );\n*\n* var arr = oneTo( 2, 'float32' );\n* // returns <Float32Array>[ 1.0, 2.0 ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n"],
"mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAuB,QAAS,uCAAwC,EAAE,YAC1EC,EAAO,QAAS,2BAA4B,EAC5CC,EAAQ,QAAS,qBAAsB,EACvCC,EAAW,QAAS,wBAAyB,EAC7CC,EAAS,QAAS,uBAAwB,EAK1CC,EAAgBF,EAAS,IAAK,gBAAiB,EAsBnD,SAASG,EAAOC,EAAI,CACnB,IAAIC,EACJ,GAAK,CAACR,EAAsBO,CAAE,EAC7B,MAAM,IAAI,UAAWH,EAAQ,+EAAgFG,CAAE,CAAE,EAElH,GAAK,UAAU,OAAS,GAEvB,GADAC,EAAQ,UAAW,CAAE,EAChBA,IAAU,UACd,OAAOP,EAAMM,CAAE,OAGhBC,EAAQH,EAET,OAAOJ,EAAK,OAAQC,EAAOK,EAAGC,CAAM,EAAG,EAAG,CAAE,CAC7C,CAKAT,EAAO,QAAUO,IChCjB,IAAIG,EAAO,IAKX,OAAO,QAAUA",
"names": ["require_main", "__commonJSMin", "exports", "module", "isNonNegativeInteger", "base", "zeros", "defaults", "format", "DEFAULT_DTYPE", "oneTo", "n", "dtype", "main"]
}