@stdlib/array-nans 0.2.0 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/NOTICE +1 -1
- package/README.md +5 -5
- package/dist/index.js +1 -1
- package/dist/index.js.map +2 -2
- package/lib/main.js +2 -2
- package/package.json +12 -40
package/NOTICE
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Copyright (c) 2016-
|
|
1
|
+
Copyright (c) 2016-2026 The Stdlib Authors.
|
package/README.md
CHANGED
|
@@ -182,7 +182,7 @@ See [LICENSE][stdlib-license].
|
|
|
182
182
|
|
|
183
183
|
## Copyright
|
|
184
184
|
|
|
185
|
-
Copyright © 2016-
|
|
185
|
+
Copyright © 2016-2026. The Stdlib [Authors][stdlib-authors].
|
|
186
186
|
|
|
187
187
|
</section>
|
|
188
188
|
|
|
@@ -195,8 +195,8 @@ Copyright © 2016-2024. The Stdlib [Authors][stdlib-authors].
|
|
|
195
195
|
[npm-image]: http://img.shields.io/npm/v/@stdlib/array-nans.svg
|
|
196
196
|
[npm-url]: https://npmjs.org/package/@stdlib/array-nans
|
|
197
197
|
|
|
198
|
-
[test-image]: https://github.com/stdlib-js/array-nans/actions/workflows/test.yml/badge.svg?branch=v0.2.
|
|
199
|
-
[test-url]: https://github.com/stdlib-js/array-nans/actions/workflows/test.yml?query=branch:v0.2.
|
|
198
|
+
[test-image]: https://github.com/stdlib-js/array-nans/actions/workflows/test.yml/badge.svg?branch=v0.2.2
|
|
199
|
+
[test-url]: https://github.com/stdlib-js/array-nans/actions/workflows/test.yml?query=branch:v0.2.2
|
|
200
200
|
|
|
201
201
|
[coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/array-nans/main.svg
|
|
202
202
|
[coverage-url]: https://codecov.io/github/stdlib-js/array-nans?branch=main
|
|
@@ -208,8 +208,8 @@ Copyright © 2016-2024. The Stdlib [Authors][stdlib-authors].
|
|
|
208
208
|
|
|
209
209
|
-->
|
|
210
210
|
|
|
211
|
-
[chat-image]: https://img.shields.io/
|
|
212
|
-
[chat-url]: https://
|
|
211
|
+
[chat-image]: https://img.shields.io/badge/zulip-join_chat-brightgreen.svg
|
|
212
|
+
[chat-url]: https://stdlib.zulipchat.com
|
|
213
213
|
|
|
214
214
|
[stdlib]: https://github.com/stdlib-js/stdlib
|
|
215
215
|
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";var o=function(a,e){return function(){return e||a((e={exports:{}}).exports,e),e.exports}};var n=o(function(_,t){
|
|
2
|
-
var u=require('@stdlib/array-base-assert-contains/dist').factory,l=require('@stdlib/complex-float64/dist'),s=require('@stdlib/complex-float32/dist'),v=require('@stdlib/array-full/dist'),f=require('@stdlib/array-defaults/dist'),p=require('@stdlib/array-dtypes/dist'),m=require('@stdlib/error-tools-fmtprodmsg/dist'),g=new l(NaN,NaN),N=new s(NaN,NaN),i=p("floating_point_and_generic"),c=u(i),d=f.get("dtypes.real_floating_point");function q(a){var e,r;if(arguments.length>1){if(e=arguments[1],!c(e))throw new TypeError(m('1ZnDQ',i.join('", "'),e))}else e=d;return e==="complex128"?r=g:e==="complex64"?r=N:r=NaN,v(a,r,e)}t.exports=q
|
|
2
|
+
var u=require('@stdlib/array-base-assert-contains/dist').factory,l=require('@stdlib/complex-float64-ctor/dist'),s=require('@stdlib/complex-float32-ctor/dist'),v=require('@stdlib/array-full/dist'),f=require('@stdlib/array-defaults/dist'),p=require('@stdlib/array-dtypes/dist'),m=require('@stdlib/error-tools-fmtprodmsg/dist'),g=new l(NaN,NaN),N=new s(NaN,NaN),i=p("floating_point_and_generic"),c=u(i),d=f.get("dtypes.real_floating_point");function q(a){var e,r;if(arguments.length>1){if(e=arguments[1],!c(e))throw new TypeError(m('1ZnDQ',i.join('", "'),e))}else e=d;return e==="complex128"?r=g:e==="complex64"?r=N:r=NaN,v(a,r,e)}t.exports=q
|
|
3
3
|
});var x=n();module.exports=x;
|
|
4
4
|
/** @license Apache-2.0 */
|
|
5
5
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../lib/main.js", "../lib/index.js"],
|
|
4
|
-
"sourcesContent": ["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 contains = require( '@stdlib/array-base-assert-contains' ).factory;\nvar Complex128 = require( '@stdlib/complex-float64' );\nvar Complex64 = require( '@stdlib/complex-float32' );\nvar full = require( '@stdlib/array-full' );\nvar defaults = require( '@stdlib/array-defaults' );\nvar dtypes = require( '@stdlib/array-dtypes' );\nvar format = require( '@stdlib/string-format' );\n\n\n// VARIABLES //\n\nvar Z128 = new Complex128( NaN, NaN );\nvar Z64 = new Complex64( NaN, NaN );\nvar DTYPES = dtypes( 'floating_point_and_generic' );\nvar isValidDType = contains( DTYPES );\nvar DEFAULT_DTYPE = defaults.get( 'dtypes.real_floating_point' );\n\n\n// MAIN //\n\n/**\n* Creates an array filled with NaNs and having a specified length.\n*\n* @param {NonNegativeInteger} length - array length\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 supported data type\n* @returns {(TypedArray|Array|ComplexArray)} array or typed array\n*\n* @example\n* var arr = nans( 2 );\n* // returns <Float64Array>[ NaN, NaN ]\n*\n* @example\n* var arr = nans( 2, 'float32' );\n* // returns <Float32Array>[ NaN, NaN ]\n*/\nfunction nans( length ) {\n\tvar dtype;\n\tvar value;\n\n\tif ( arguments.length > 1 ) {\n\t\tdtype = arguments[ 1 ];\n\t\tif ( !isValidDType( dtype ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be one of the following: \"%s\". Value: `%s`.', DTYPES.join( '\", \"' ), dtype ) );\n\t\t}\n\t} else {\n\t\tdtype = DEFAULT_DTYPE;\n\t}\n\tif ( dtype === 'complex128' ) {\n\t\tvalue = Z128;\n\t} else if ( dtype === 'complex64' ) {\n\t\tvalue = Z64;\n\t} else {\n\t\tvalue = NaN;\n\t}\n\treturn full( length, value, dtype );\n}\n\n\n// EXPORTS //\n\nmodule.exports = nans;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Create an array filled with NaNs and having a specified length.\n*\n* @module @stdlib/array-nans\n*\n* @example\n* var nans = require( '@stdlib/array-nans' );\n*\n* var arr = nans( 2 );\n* // returns <Float64Array>[ NaN, NaN ]\n*\n* @example\n* var nans = require( '@stdlib/array-nans' );\n*\n* var arr = nans( 2, 'float32' );\n* // returns <Float32Array>[ NaN, NaN ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n"],
|
|
5
|
-
"mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAW,QAAS,oCAAqC,EAAE,QAC3DC,EAAa,QAAS,
|
|
4
|
+
"sourcesContent": ["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 contains = require( '@stdlib/array-base-assert-contains' ).factory;\nvar Complex128 = require( '@stdlib/complex-float64-ctor' );\nvar Complex64 = require( '@stdlib/complex-float32-ctor' );\nvar full = require( '@stdlib/array-full' );\nvar defaults = require( '@stdlib/array-defaults' );\nvar dtypes = require( '@stdlib/array-dtypes' );\nvar format = require( '@stdlib/string-format' );\n\n\n// VARIABLES //\n\nvar Z128 = new Complex128( NaN, NaN );\nvar Z64 = new Complex64( NaN, NaN );\nvar DTYPES = dtypes( 'floating_point_and_generic' );\nvar isValidDType = contains( DTYPES );\nvar DEFAULT_DTYPE = defaults.get( 'dtypes.real_floating_point' );\n\n\n// MAIN //\n\n/**\n* Creates an array filled with NaNs and having a specified length.\n*\n* @param {NonNegativeInteger} length - array length\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 supported data type\n* @returns {(TypedArray|Array|ComplexArray)} array or typed array\n*\n* @example\n* var arr = nans( 2 );\n* // returns <Float64Array>[ NaN, NaN ]\n*\n* @example\n* var arr = nans( 2, 'float32' );\n* // returns <Float32Array>[ NaN, NaN ]\n*/\nfunction nans( length ) {\n\tvar dtype;\n\tvar value;\n\n\tif ( arguments.length > 1 ) {\n\t\tdtype = arguments[ 1 ];\n\t\tif ( !isValidDType( dtype ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be one of the following: \"%s\". Value: `%s`.', DTYPES.join( '\", \"' ), dtype ) );\n\t\t}\n\t} else {\n\t\tdtype = DEFAULT_DTYPE;\n\t}\n\tif ( dtype === 'complex128' ) {\n\t\tvalue = Z128;\n\t} else if ( dtype === 'complex64' ) {\n\t\tvalue = Z64;\n\t} else {\n\t\tvalue = NaN;\n\t}\n\treturn full( length, value, dtype );\n}\n\n\n// EXPORTS //\n\nmodule.exports = nans;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Create an array filled with NaNs and having a specified length.\n*\n* @module @stdlib/array-nans\n*\n* @example\n* var nans = require( '@stdlib/array-nans' );\n*\n* var arr = nans( 2 );\n* // returns <Float64Array>[ NaN, NaN ]\n*\n* @example\n* var nans = require( '@stdlib/array-nans' );\n*\n* var arr = nans( 2, 'float32' );\n* // returns <Float32Array>[ NaN, NaN ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n"],
|
|
5
|
+
"mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAW,QAAS,oCAAqC,EAAE,QAC3DC,EAAa,QAAS,8BAA+B,EACrDC,EAAY,QAAS,8BAA+B,EACpDC,EAAO,QAAS,oBAAqB,EACrCC,EAAW,QAAS,wBAAyB,EAC7CC,EAAS,QAAS,sBAAuB,EACzCC,EAAS,QAAS,uBAAwB,EAK1CC,EAAO,IAAIN,EAAY,IAAK,GAAI,EAChCO,EAAM,IAAIN,EAAW,IAAK,GAAI,EAC9BO,EAASJ,EAAQ,4BAA6B,EAC9CK,EAAeV,EAAUS,CAAO,EAChCE,EAAgBP,EAAS,IAAK,4BAA6B,EAsB/D,SAASQ,EAAMC,EAAS,CACvB,IAAIC,EACAC,EAEJ,GAAK,UAAU,OAAS,GAEvB,GADAD,EAAQ,UAAW,CAAE,EAChB,CAACJ,EAAcI,CAAM,EACzB,MAAM,IAAI,UAAWR,EAAQ,qFAAsFG,EAAO,KAAM,MAAO,EAAGK,CAAM,CAAE,OAGnJA,EAAQH,EAET,OAAKG,IAAU,aACdC,EAAQR,EACGO,IAAU,YACrBC,EAAQP,EAERO,EAAQ,IAEFZ,EAAMU,EAAQE,EAAOD,CAAM,CACnC,CAKAf,EAAO,QAAUa,IC5CjB,IAAII,EAAO,IAKX,OAAO,QAAUA",
|
|
6
6
|
"names": ["require_main", "__commonJSMin", "exports", "module", "contains", "Complex128", "Complex64", "full", "defaults", "dtypes", "format", "Z128", "Z64", "DTYPES", "isValidDType", "DEFAULT_DTYPE", "nans", "length", "dtype", "value", "main"]
|
|
7
7
|
}
|
package/lib/main.js
CHANGED
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
// MODULES //
|
|
22
22
|
|
|
23
23
|
var contains = require( '@stdlib/array-base-assert-contains' ).factory;
|
|
24
|
-
var Complex128 = require( '@stdlib/complex-float64' );
|
|
25
|
-
var Complex64 = require( '@stdlib/complex-float32' );
|
|
24
|
+
var Complex128 = require( '@stdlib/complex-float64-ctor' );
|
|
25
|
+
var Complex64 = require( '@stdlib/complex-float32-ctor' );
|
|
26
26
|
var full = require( '@stdlib/array-full' );
|
|
27
27
|
var defaults = require( '@stdlib/array-defaults' );
|
|
28
28
|
var dtypes = require( '@stdlib/array-dtypes' );
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stdlib/array-nans",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "Create an array filled with NaNs and having a specified length.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": {
|
|
@@ -15,19 +15,12 @@
|
|
|
15
15
|
],
|
|
16
16
|
"main": "./lib",
|
|
17
17
|
"directories": {
|
|
18
|
-
"benchmark": "./benchmark",
|
|
19
18
|
"doc": "./docs",
|
|
20
|
-
"example": "./examples",
|
|
21
19
|
"lib": "./lib",
|
|
22
|
-
"
|
|
20
|
+
"dist": "./dist"
|
|
23
21
|
},
|
|
24
22
|
"types": "./docs/types",
|
|
25
|
-
"scripts": {
|
|
26
|
-
"test": "make test",
|
|
27
|
-
"test-cov": "make test-cov",
|
|
28
|
-
"examples": "make examples",
|
|
29
|
-
"benchmark": "make benchmark"
|
|
30
|
-
},
|
|
23
|
+
"scripts": {},
|
|
31
24
|
"homepage": "https://stdlib.io",
|
|
32
25
|
"repository": {
|
|
33
26
|
"type": "git",
|
|
@@ -37,37 +30,16 @@
|
|
|
37
30
|
"url": "https://github.com/stdlib-js/stdlib/issues"
|
|
38
31
|
},
|
|
39
32
|
"dependencies": {
|
|
40
|
-
"@stdlib/array-base-assert-contains": "^0.2.
|
|
41
|
-
"@stdlib/array-defaults": "^0.
|
|
42
|
-
"@stdlib/array-dtypes": "^0.
|
|
43
|
-
"@stdlib/array-full": "^0.
|
|
44
|
-
"@stdlib/complex-float32": "^0.
|
|
45
|
-
"@stdlib/complex-float64": "^0.2
|
|
46
|
-
"@stdlib/string-format": "^0.2.
|
|
47
|
-
"@stdlib/
|
|
48
|
-
"@stdlib/error-tools-fmtprodmsg": "^0.2.0"
|
|
49
|
-
},
|
|
50
|
-
"devDependencies": {
|
|
51
|
-
"@stdlib/array-complex128": "^0.1.0",
|
|
52
|
-
"@stdlib/array-complex64": "^0.1.0",
|
|
53
|
-
"@stdlib/array-float32": "^0.2.0",
|
|
54
|
-
"@stdlib/array-float64": "^0.2.0",
|
|
55
|
-
"@stdlib/array-typed-float-dtypes": "^0.2.0",
|
|
56
|
-
"@stdlib/assert-instance-of": "^0.2.0",
|
|
57
|
-
"@stdlib/assert-is-array": "^0.2.0",
|
|
58
|
-
"@stdlib/assert-is-typed-array": "^0.2.0",
|
|
59
|
-
"@stdlib/assert-is-typed-array-like": "^0.2.0",
|
|
60
|
-
"@stdlib/math-base-assert-is-nan": "^0.2.0",
|
|
61
|
-
"@stdlib/math-base-assert-is-nanf": "^0.2.0",
|
|
62
|
-
"@stdlib/math-base-special-pow": "^0.2.0",
|
|
63
|
-
"@stdlib/strided-base-reinterpret-complex128": "^0.2.0",
|
|
64
|
-
"@stdlib/strided-base-reinterpret-complex64": "^0.2.0",
|
|
65
|
-
"tape": "git+https://github.com/kgryte/tape.git#fix/globby",
|
|
66
|
-
"istanbul": "^0.4.1",
|
|
67
|
-
"tap-min": "git+https://github.com/Planeshifter/tap-min.git",
|
|
68
|
-
"@stdlib/bench-harness": "^0.2.0",
|
|
69
|
-
"@stdlib/bench": "^0.3.1"
|
|
33
|
+
"@stdlib/array-base-assert-contains": "^0.2.3",
|
|
34
|
+
"@stdlib/array-defaults": "^0.4.1",
|
|
35
|
+
"@stdlib/array-dtypes": "^0.4.1",
|
|
36
|
+
"@stdlib/array-full": "^0.3.0",
|
|
37
|
+
"@stdlib/complex-float32-ctor": "^0.1.1",
|
|
38
|
+
"@stdlib/complex-float64-ctor": "^0.1.2",
|
|
39
|
+
"@stdlib/string-format": "^0.2.3",
|
|
40
|
+
"@stdlib/error-tools-fmtprodmsg": "^0.2.3"
|
|
70
41
|
},
|
|
42
|
+
"devDependencies": {},
|
|
71
43
|
"engines": {
|
|
72
44
|
"node": ">=0.10.0",
|
|
73
45
|
"npm": ">2.7.0"
|