@stdlib/array-nans 0.2.1 → 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 CHANGED
@@ -1 +1 @@
1
- Copyright (c) 2016-2024 The Stdlib Authors.
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-2024. The Stdlib [Authors][stdlib-authors].
185
+ Copyright © 2016-2026. The Stdlib [Authors][stdlib-authors].
186
186
 
187
187
  </section>
188
188
 
@@ -195,8 +195,8 @@ Copyright &copy; 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.1
199
- [test-url]: https://github.com/stdlib-js/array-nans/actions/workflows/test.yml?query=branch:v0.2.1
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 &copy; 2016-2024. The Stdlib [Authors][stdlib-authors].
208
208
 
209
209
  -->
210
210
 
211
- [chat-image]: https://img.shields.io/gitter/room/stdlib-js/stdlib.svg
212
- [chat-url]: https://app.gitter.im/#/room/#stdlib-js_stdlib:gitter.im
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,yBAA0B,EAChDC,EAAY,QAAS,yBAA0B,EAC/CC,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",
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.1",
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": {
@@ -30,14 +30,14 @@
30
30
  "url": "https://github.com/stdlib-js/stdlib/issues"
31
31
  },
32
32
  "dependencies": {
33
- "@stdlib/array-base-assert-contains": "^0.2.1",
34
- "@stdlib/array-defaults": "^0.2.1",
35
- "@stdlib/array-dtypes": "^0.2.1",
36
- "@stdlib/array-full": "^0.2.1",
37
- "@stdlib/complex-float32": "^0.2.1",
38
- "@stdlib/complex-float64": "^0.2.1",
39
- "@stdlib/string-format": "^0.2.1",
40
- "@stdlib/error-tools-fmtprodmsg": "^0.2.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"
41
41
  },
42
42
  "devDependencies": {},
43
43
  "engines": {