@stdlib/ndarray-base-assert-is-real-data-type 0.2.1 → 0.3.0

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
@@ -65,7 +65,7 @@ var isRealDataType = require( '@stdlib/ndarray-base-assert-is-real-data-type' );
65
65
 
66
66
  #### isRealDataType( value )
67
67
 
68
- Tests if an input `value` is a supported ndarray real-valued data type.
68
+ Tests if an input value is a supported ndarray real-valued data type.
69
69
 
70
70
  ```javascript
71
71
  var bool = isRealDataType( 'float32' );
@@ -187,7 +187,7 @@ See [LICENSE][stdlib-license].
187
187
 
188
188
  ## Copyright
189
189
 
190
- Copyright © 2016-2024. The Stdlib [Authors][stdlib-authors].
190
+ Copyright © 2016-2026. The Stdlib [Authors][stdlib-authors].
191
191
 
192
192
  </section>
193
193
 
@@ -200,8 +200,8 @@ Copyright &copy; 2016-2024. The Stdlib [Authors][stdlib-authors].
200
200
  [npm-image]: http://img.shields.io/npm/v/@stdlib/ndarray-base-assert-is-real-data-type.svg
201
201
  [npm-url]: https://npmjs.org/package/@stdlib/ndarray-base-assert-is-real-data-type
202
202
 
203
- [test-image]: https://github.com/stdlib-js/ndarray-base-assert-is-real-data-type/actions/workflows/test.yml/badge.svg?branch=v0.2.1
204
- [test-url]: https://github.com/stdlib-js/ndarray-base-assert-is-real-data-type/actions/workflows/test.yml?query=branch:v0.2.1
203
+ [test-image]: https://github.com/stdlib-js/ndarray-base-assert-is-real-data-type/actions/workflows/test.yml/badge.svg?branch=v0.3.0
204
+ [test-url]: https://github.com/stdlib-js/ndarray-base-assert-is-real-data-type/actions/workflows/test.yml?query=branch:v0.3.0
205
205
 
206
206
  [coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/ndarray-base-assert-is-real-data-type/main.svg
207
207
  [coverage-url]: https://codecov.io/github/stdlib-js/ndarray-base-assert-is-real-data-type?branch=main
@@ -213,8 +213,8 @@ Copyright &copy; 2016-2024. The Stdlib [Authors][stdlib-authors].
213
213
 
214
214
  -->
215
215
 
216
- [chat-image]: https://img.shields.io/gitter/room/stdlib-js/stdlib.svg
217
- [chat-url]: https://app.gitter.im/#/room/#stdlib-js_stdlib:gitter.im
216
+ [chat-image]: https://img.shields.io/badge/zulip-join_chat-brightgreen.svg
217
+ [chat-url]: https://stdlib.zulipchat.com
218
218
 
219
219
  [stdlib]: https://github.com/stdlib-js/stdlib
220
220
 
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- "use strict";var s=function(t,r){return function(){return r||t((r={exports:{}}).exports,r),r.exports}};var a=s(function(v,e){
2
- var i=require('@stdlib/array-base-assert-contains/dist').factory,u=require('@stdlib/ndarray-dtypes/dist'),c=i(u("real"));e.exports=c
1
+ "use strict";var i=function(e,r){return function(){return r||e((r={exports:{}}).exports,r),r.exports}};var a=i(function(v,t){
2
+ var s=require('@stdlib/array-base-assert-contains/dist').factory,n=require('@stdlib/ndarray-base-dtype-strings/dist'),u=s(n("real"));function c(e){return u(String(e))}t.exports=c
3
3
  });var o=a();module.exports=o;
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 dtypes = require( '@stdlib/ndarray-dtypes' );\n\n\n// MAIN //\n\n/**\n* Tests whether an input value is a supported ndarray real-valued data type.\n*\n* @name isRealDataType\n* @type {Function}\n* @param {*} v - value to test\n* @returns {boolean} boolean indicating whether an input value is a supported ndarray real-valued data type\n*\n* @example\n* var bool = isRealDataType( 'binary' );\n* // returns false\n*\n* bool = isRealDataType( 'float32' );\n* // returns true\n*\n* bool = isRealDataType( 'float64' );\n* // returns true\n*\n* bool = isRealDataType( 'complex128' );\n* // returns false\n*\n* bool = isRealDataType( 'generic' );\n* // returns false\n*\n* bool = isRealDataType( 'int16' );\n* // returns true\n*\n* bool = isRealDataType( 'int32' );\n* // returns true\n*\n* bool = isRealDataType( 'int8' );\n* // returns true\n*\n* bool = isRealDataType( 'uint16' );\n* // returns true\n*\n* bool = isRealDataType( 'uint32' );\n* // returns true\n*\n* bool = isRealDataType( 'uint8' );\n* // returns true\n*\n* bool = isRealDataType( 'uint8c' );\n* // returns true\n*\n* bool = isRealDataType( 'foo' );\n* // returns false\n*/\nvar isRealDataType = contains( dtypes( 'real' ) );\n\n\n// EXPORTS //\n\nmodule.exports = isRealDataType;\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* Test whether an input value is a supported ndarray real-valued data type.\n*\n* @module @stdlib/ndarray-base-assert-is-real-data-type\n*\n* @example\n* var isRealDataType = require( '@stdlib/ndarray-base-assert-is-real-data-type' );\n*\n* var bool = isRealDataType( 'binary' );\n* // returns false\n*\n* bool = isRealDataType( 'float32' );\n* // returns true\n*\n* bool = isRealDataType( 'float64' );\n* // returns true\n*\n* bool = isRealDataType( 'complex128' );\n* // returns false\n*\n* bool = isRealDataType( 'generic' );\n* // returns false\n*\n* bool = isRealDataType( 'int16' );\n* // returns true\n*\n* bool = isRealDataType( 'int32' );\n* // returns true\n*\n* bool = isRealDataType( 'int8' );\n* // returns true\n*\n* bool = isRealDataType( 'uint16' );\n* // returns true\n*\n* bool = isRealDataType( 'uint32' );\n* // returns true\n*\n* bool = isRealDataType( 'uint8' );\n* // returns true\n*\n* bool = isRealDataType( 'uint8c' );\n* // returns true\n*\n* bool = isRealDataType( 'foo' );\n* // returns false\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,EAAS,QAAS,wBAAyB,EAqD3CC,EAAiBF,EAAUC,EAAQ,MAAO,CAAE,EAKhDF,EAAO,QAAUG,ICXjB,IAAIC,EAAO,IAKX,OAAO,QAAUA",
6
- "names": ["require_main", "__commonJSMin", "exports", "module", "contains", "dtypes", "isRealDataType", "main"]
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 dtypes = require( '@stdlib/ndarray-base-dtype-strings' );\n\n\n// VARIABLES //\n\nvar isDataType = contains( dtypes( 'real' ) );\n\n\n// MAIN //\n\n/**\n* Tests whether an input value is a supported ndarray real-valued data type.\n*\n* @param {*} v - value to test\n* @returns {boolean} boolean indicating whether an input value is a supported ndarray real-valued data type\n*\n* @example\n* var bool = isRealDataType( 'binary' );\n* // returns false\n*\n* bool = isRealDataType( 'float32' );\n* // returns true\n*\n* bool = isRealDataType( 'float64' );\n* // returns true\n*\n* bool = isRealDataType( 'complex128' );\n* // returns false\n*\n* bool = isRealDataType( 'generic' );\n* // returns false\n*\n* bool = isRealDataType( 'int16' );\n* // returns true\n*\n* bool = isRealDataType( 'int32' );\n* // returns true\n*\n* bool = isRealDataType( 'int8' );\n* // returns true\n*\n* bool = isRealDataType( 'uint16' );\n* // returns true\n*\n* bool = isRealDataType( 'uint32' );\n* // returns true\n*\n* bool = isRealDataType( 'uint8' );\n* // returns true\n*\n* bool = isRealDataType( 'uint8c' );\n* // returns true\n*\n* bool = isRealDataType( 'foo' );\n* // returns false\n*/\nfunction isRealDataType( v ) {\n\treturn isDataType( String( v ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = isRealDataType;\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* Test whether an input value is a supported ndarray real-valued data type.\n*\n* @module @stdlib/ndarray-base-assert-is-real-data-type\n*\n* @example\n* var isRealDataType = require( '@stdlib/ndarray-base-assert-is-real-data-type' );\n*\n* var bool = isRealDataType( 'binary' );\n* // returns false\n*\n* bool = isRealDataType( 'float32' );\n* // returns true\n*\n* bool = isRealDataType( 'float64' );\n* // returns true\n*\n* bool = isRealDataType( 'complex128' );\n* // returns false\n*\n* bool = isRealDataType( 'generic' );\n* // returns false\n*\n* bool = isRealDataType( 'int16' );\n* // returns true\n*\n* bool = isRealDataType( 'int32' );\n* // returns true\n*\n* bool = isRealDataType( 'int8' );\n* // returns true\n*\n* bool = isRealDataType( 'uint16' );\n* // returns true\n*\n* bool = isRealDataType( 'uint32' );\n* // returns true\n*\n* bool = isRealDataType( 'uint8' );\n* // returns true\n*\n* bool = isRealDataType( 'uint8c' );\n* // returns true\n*\n* bool = isRealDataType( 'foo' );\n* // returns false\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,EAAS,QAAS,oCAAqC,EAKvDC,EAAaF,EAAUC,EAAQ,MAAO,CAAE,EAmD5C,SAASE,EAAgBC,EAAI,CAC5B,OAAOF,EAAY,OAAQE,CAAE,CAAE,CAChC,CAKAL,EAAO,QAAUI,IChBjB,IAAIE,EAAO,IAKX,OAAO,QAAUA",
6
+ "names": ["require_main", "__commonJSMin", "exports", "module", "contains", "dtypes", "isDataType", "isRealDataType", "v", "main"]
7
7
  }
package/lib/main.js CHANGED
@@ -21,7 +21,12 @@
21
21
  // MODULES //
22
22
 
23
23
  var contains = require( '@stdlib/array-base-assert-contains' ).factory;
24
- var dtypes = require( '@stdlib/ndarray-dtypes' );
24
+ var dtypes = require( '@stdlib/ndarray-base-dtype-strings' );
25
+
26
+
27
+ // VARIABLES //
28
+
29
+ var isDataType = contains( dtypes( 'real' ) );
25
30
 
26
31
 
27
32
  // MAIN //
@@ -29,8 +34,6 @@ var dtypes = require( '@stdlib/ndarray-dtypes' );
29
34
  /**
30
35
  * Tests whether an input value is a supported ndarray real-valued data type.
31
36
  *
32
- * @name isRealDataType
33
- * @type {Function}
34
37
  * @param {*} v - value to test
35
38
  * @returns {boolean} boolean indicating whether an input value is a supported ndarray real-valued data type
36
39
  *
@@ -74,7 +77,9 @@ var dtypes = require( '@stdlib/ndarray-dtypes' );
74
77
  * bool = isRealDataType( 'foo' );
75
78
  * // returns false
76
79
  */
77
- var isRealDataType = contains( dtypes( 'real' ) );
80
+ function isRealDataType( v ) {
81
+ return isDataType( String( v ) );
82
+ }
78
83
 
79
84
 
80
85
  // EXPORTS //
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stdlib/ndarray-base-assert-is-real-data-type",
3
- "version": "0.2.1",
3
+ "version": "0.3.0",
4
4
  "description": "Test if an input value is a supported ndarray real-valued data type.",
5
5
  "license": "Apache-2.0",
6
6
  "author": {
@@ -30,8 +30,8 @@
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/ndarray-dtypes": "^0.2.1"
33
+ "@stdlib/array-base-assert-contains": "^0.2.2",
34
+ "@stdlib/ndarray-base-dtype-strings": "^0.1.0"
35
35
  },
36
36
  "devDependencies": {},
37
37
  "engines": {
@@ -72,7 +72,6 @@
72
72
  "validation",
73
73
  "isvalid"
74
74
  ],
75
- "__stdlib__": {},
76
75
  "funding": {
77
76
  "type": "opencollective",
78
77
  "url": "https://opencollective.com/stdlib"