@stdlib/ndarray-base-assert-is-same-kind-data-type-cast 0.1.0 → 0.2.1
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 +13 -18
- package/SECURITY.md +5 -0
- package/package.json +6 -20
- package/CITATION.cff +0 -30
package/NOTICE
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Copyright (c) 2016-
|
|
1
|
+
Copyright (c) 2016-2024 The Stdlib Authors.
|
package/README.md
CHANGED
|
@@ -96,25 +96,17 @@ bool = isSameKindCast( 'uint16', 'int16' );
|
|
|
96
96
|
<!-- eslint no-undef: "error" -->
|
|
97
97
|
|
|
98
98
|
```javascript
|
|
99
|
+
var cartesianSquare = require( '@stdlib/array-cartesian-square' );
|
|
99
100
|
var dtypes = require( '@stdlib/ndarray-dtypes' );
|
|
100
101
|
var isSameKindCast = require( '@stdlib/ndarray-base-assert-is-same-kind-data-type-cast' );
|
|
101
102
|
|
|
102
|
-
|
|
103
|
-
var
|
|
104
|
-
|
|
103
|
+
// Generate a list of dtype pairs:
|
|
104
|
+
var dt = cartesianSquare( dtypes() );
|
|
105
|
+
|
|
106
|
+
// For each data type pair, determine whether one can cast from one data type to another...
|
|
105
107
|
var i;
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
// Get a list of supported ndarray data types:
|
|
109
|
-
DTYPES = dtypes();
|
|
110
|
-
|
|
111
|
-
// For each data type, determine whether one can cast to another data type...
|
|
112
|
-
for ( i = 0; i < DTYPES.length; i++ ) {
|
|
113
|
-
dt = DTYPES[ i ];
|
|
114
|
-
for ( j = 0; j < DTYPES.length; j++ ) {
|
|
115
|
-
bool = isSameKindCast( dt, DTYPES[ j ] );
|
|
116
|
-
console.log( '%s => %s. Allowed cast? %s.', dt, DTYPES[ j ], bool );
|
|
117
|
-
}
|
|
108
|
+
for ( i = 0; i < dt.length; i++ ) {
|
|
109
|
+
console.log( '%s. Allowed cast? %s.', dt[i].join( ' => ' ), isSameKindCast.apply( null, dt[i] ) );
|
|
118
110
|
}
|
|
119
111
|
```
|
|
120
112
|
|
|
@@ -164,7 +156,7 @@ See [LICENSE][stdlib-license].
|
|
|
164
156
|
|
|
165
157
|
## Copyright
|
|
166
158
|
|
|
167
|
-
Copyright © 2016-
|
|
159
|
+
Copyright © 2016-2024. The Stdlib [Authors][stdlib-authors].
|
|
168
160
|
|
|
169
161
|
</section>
|
|
170
162
|
|
|
@@ -177,8 +169,8 @@ Copyright © 2016-2023. The Stdlib [Authors][stdlib-authors].
|
|
|
177
169
|
[npm-image]: http://img.shields.io/npm/v/@stdlib/ndarray-base-assert-is-same-kind-data-type-cast.svg
|
|
178
170
|
[npm-url]: https://npmjs.org/package/@stdlib/ndarray-base-assert-is-same-kind-data-type-cast
|
|
179
171
|
|
|
180
|
-
[test-image]: https://github.com/stdlib-js/ndarray-base-assert-is-same-kind-data-type-cast/actions/workflows/test.yml/badge.svg?branch=v0.1
|
|
181
|
-
[test-url]: https://github.com/stdlib-js/ndarray-base-assert-is-same-kind-data-type-cast/actions/workflows/test.yml?query=branch:v0.1
|
|
172
|
+
[test-image]: https://github.com/stdlib-js/ndarray-base-assert-is-same-kind-data-type-cast/actions/workflows/test.yml/badge.svg?branch=v0.2.1
|
|
173
|
+
[test-url]: https://github.com/stdlib-js/ndarray-base-assert-is-same-kind-data-type-cast/actions/workflows/test.yml?query=branch:v0.2.1
|
|
182
174
|
|
|
183
175
|
[coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/ndarray-base-assert-is-same-kind-data-type-cast/main.svg
|
|
184
176
|
[coverage-url]: https://codecov.io/github/stdlib-js/ndarray-base-assert-is-same-kind-data-type-cast?branch=main
|
|
@@ -201,8 +193,11 @@ Copyright © 2016-2023. The Stdlib [Authors][stdlib-authors].
|
|
|
201
193
|
[es-module]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules
|
|
202
194
|
|
|
203
195
|
[deno-url]: https://github.com/stdlib-js/ndarray-base-assert-is-same-kind-data-type-cast/tree/deno
|
|
196
|
+
[deno-readme]: https://github.com/stdlib-js/ndarray-base-assert-is-same-kind-data-type-cast/blob/deno/README.md
|
|
204
197
|
[umd-url]: https://github.com/stdlib-js/ndarray-base-assert-is-same-kind-data-type-cast/tree/umd
|
|
198
|
+
[umd-readme]: https://github.com/stdlib-js/ndarray-base-assert-is-same-kind-data-type-cast/blob/umd/README.md
|
|
205
199
|
[esm-url]: https://github.com/stdlib-js/ndarray-base-assert-is-same-kind-data-type-cast/tree/esm
|
|
200
|
+
[esm-readme]: https://github.com/stdlib-js/ndarray-base-assert-is-same-kind-data-type-cast/blob/esm/README.md
|
|
206
201
|
[branches-url]: https://github.com/stdlib-js/ndarray-base-assert-is-same-kind-data-type-cast/blob/main/branches.md
|
|
207
202
|
|
|
208
203
|
[stdlib-license]: https://raw.githubusercontent.com/stdlib-js/ndarray-base-assert-is-same-kind-data-type-cast/main/LICENSE
|
package/SECURITY.md
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stdlib/ndarray-base-assert-is-same-kind-data-type-cast",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "Determine if an ndarray data type can be safely cast to, or is of the same kind as, another ndarray data type.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": {
|
|
@@ -15,21 +15,14 @@
|
|
|
15
15
|
],
|
|
16
16
|
"main": "./lib",
|
|
17
17
|
"directories": {
|
|
18
|
-
"benchmark": "./benchmark",
|
|
19
18
|
"doc": "./docs",
|
|
20
|
-
"example": "./examples",
|
|
21
19
|
"include": "./include",
|
|
22
20
|
"lib": "./lib",
|
|
23
21
|
"src": "./src",
|
|
24
|
-
"
|
|
22
|
+
"dist": "./dist"
|
|
25
23
|
},
|
|
26
24
|
"types": "./docs/types",
|
|
27
|
-
"scripts": {
|
|
28
|
-
"test": "make test",
|
|
29
|
-
"test-cov": "make test-cov",
|
|
30
|
-
"examples": "make examples",
|
|
31
|
-
"benchmark": "make benchmark"
|
|
32
|
-
},
|
|
25
|
+
"scripts": {},
|
|
33
26
|
"homepage": "https://stdlib.io",
|
|
34
27
|
"repository": {
|
|
35
28
|
"type": "git",
|
|
@@ -39,17 +32,10 @@
|
|
|
39
32
|
"url": "https://github.com/stdlib-js/stdlib/issues"
|
|
40
33
|
},
|
|
41
34
|
"dependencies": {
|
|
42
|
-
"@stdlib/ndarray-dtypes": "^0.1
|
|
43
|
-
"@stdlib/ndarray-same-kind-casts": "^0.1
|
|
44
|
-
"@stdlib/utils-library-manifest": "^0.1.0"
|
|
45
|
-
},
|
|
46
|
-
"devDependencies": {
|
|
47
|
-
"@stdlib/assert-is-boolean": "^0.1.0",
|
|
48
|
-
"@stdlib/bench": "^0.1.0",
|
|
49
|
-
"tape": "git+https://github.com/kgryte/tape.git#fix/globby",
|
|
50
|
-
"istanbul": "^0.4.1",
|
|
51
|
-
"tap-min": "git+https://github.com/Planeshifter/tap-min.git"
|
|
35
|
+
"@stdlib/ndarray-dtypes": "^0.2.1",
|
|
36
|
+
"@stdlib/ndarray-same-kind-casts": "^0.2.1"
|
|
52
37
|
},
|
|
38
|
+
"devDependencies": {},
|
|
53
39
|
"engines": {
|
|
54
40
|
"node": ">=0.10.0",
|
|
55
41
|
"npm": ">2.7.0"
|
package/CITATION.cff
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
cff-version: 1.2.0
|
|
2
|
-
title: stdlib
|
|
3
|
-
message: >-
|
|
4
|
-
If you use this software, please cite it using the
|
|
5
|
-
metadata from this file.
|
|
6
|
-
|
|
7
|
-
type: software
|
|
8
|
-
|
|
9
|
-
authors:
|
|
10
|
-
- name: The Stdlib Authors
|
|
11
|
-
url: https://github.com/stdlib-js/stdlib/graphs/contributors
|
|
12
|
-
|
|
13
|
-
repository-code: https://github.com/stdlib-js/stdlib
|
|
14
|
-
url: https://stdlib.io
|
|
15
|
-
|
|
16
|
-
abstract: |
|
|
17
|
-
Standard library for JavaScript and Node.js.
|
|
18
|
-
|
|
19
|
-
keywords:
|
|
20
|
-
- JavaScript
|
|
21
|
-
- Node.js
|
|
22
|
-
- TypeScript
|
|
23
|
-
- standard library
|
|
24
|
-
- scientific computing
|
|
25
|
-
- numerical computing
|
|
26
|
-
- statistical computing
|
|
27
|
-
|
|
28
|
-
license: Apache-2.0 AND BSL-1.0
|
|
29
|
-
|
|
30
|
-
date-released: 2016
|