@stdlib/ndarray-safe-casts 0.3.0 → 0.4.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 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/ndarray-safe-casts.svg
196
196
  [npm-url]: https://npmjs.org/package/@stdlib/ndarray-safe-casts
197
197
 
198
- [test-image]: https://github.com/stdlib-js/ndarray-safe-casts/actions/workflows/test.yml/badge.svg?branch=v0.3.0
199
- [test-url]: https://github.com/stdlib-js/ndarray-safe-casts/actions/workflows/test.yml?query=branch:v0.3.0
198
+ [test-image]: https://github.com/stdlib-js/ndarray-safe-casts/actions/workflows/test.yml/badge.svg?branch=v0.4.1
199
+ [test-url]: https://github.com/stdlib-js/ndarray-safe-casts/actions/workflows/test.yml?query=branch:v0.4.1
200
200
 
201
201
  [coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/ndarray-safe-casts/main.svg
202
202
  [coverage-url]: https://codecov.io/github/stdlib-js/ndarray-safe-casts?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
- "use strict";var p=function(t,n){return function(){return n||t((n={exports:{}}).exports,n),n.exports}};var m=p(function(A,g){g.exports={float64:{float64:1,float32:0,int32:0,int16:0,int8:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:1,complex64:0,binary:0,generic:1,bool:0},float32:{float64:1,float32:1,int32:0,int16:0,int8:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:1,complex64:1,binary:0,generic:1,bool:0},int32:{float64:1,float32:0,int32:1,int16:0,int8:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:1,complex64:0,binary:0,generic:1,bool:0},int16:{float64:1,float32:1,int32:1,int16:1,int8:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:1,complex64:1,binary:0,generic:1,bool:0},int8:{float64:1,float32:1,int32:1,int16:1,int8:1,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:1,complex64:1,binary:0,generic:1,bool:0},uint32:{float64:1,float32:0,int32:0,int16:0,int8:0,uint32:1,uint16:0,uint8:0,uint8c:0,complex128:1,complex64:0,binary:0,generic:1,bool:0},uint16:{float64:1,float32:1,int32:1,int16:0,int8:0,uint32:1,uint16:1,uint8:0,uint8c:0,complex128:1,complex64:1,binary:0,generic:1,bool:0},uint8:{float64:1,float32:1,int32:1,int16:1,int8:0,uint32:1,uint16:1,uint8:1,uint8c:1,complex128:1,complex64:1,binary:0,generic:1,bool:0},uint8c:{float64:1,float32:1,int32:1,int16:1,int8:0,uint32:1,uint16:1,uint8:1,uint8c:1,complex128:1,complex64:1,binary:0,generic:1,bool:0},complex128:{float64:0,float32:0,int32:0,int16:0,int8:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:1,complex64:0,binary:0,generic:1,bool:0},complex64:{float64:0,float32:0,int32:0,int16:0,int8:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:1,complex64:1,binary:0,generic:1,bool:0},generic:{float64:0,float32:0,int32:0,int16:0,int8:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:0,complex64:0,binary:0,generic:1,bool:0},binary:{float64:0,float32:0,int32:0,int16:0,int8:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:0,complex64:0,binary:1,generic:0,bool:0},bool:{float64:0,float32:0,int32:0,int16:0,int8:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:0,complex64:0,binary:0,generic:1,bool:1}}});var v=p(function(S,x){
2
- var b=require('@stdlib/utils-keys/dist'),s=require('@stdlib/assert-has-own-property/dist'),y=require('@stdlib/ndarray-base-dtype-resolve-str/dist'),f=m(),c;function h(){var t,n,e,r,l,u,a,i,o;for(e={},t=b(f),n=t.length,o=0;o<n;o++){for(l=t[o],a=f[l],r={},i=0;i<n;i++)u=t[i],r[u]=a[u];e[l]=r}return e}function q(){var t,n,e,r,l,u,a,i,o;for(e={},t=b(f),n=t.length,o=0;o<n;o++){for(l=t[o],a=f[l],r=[],i=0;i<n;i++)u=t[i],a[u]===1&&r.push(u);e[l]=r}return e}function d(t){return arguments.length===0?h():(c===void 0&&(c=q()),t=y(t),s(c,t)?c[t].slice():null)}x.exports=d
1
+ "use strict";var p=function(t,n){return function(){return n||t((n={exports:{}}).exports,n),n.exports}};var m=p(function(A,g){g.exports={float64:{float64:1,float32:0,float16:0,int64:0,int32:0,int16:0,int8:0,uint64:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:1,complex64:0,complex32:0,binary:0,generic:1,bool:0},float32:{float64:1,float32:1,float16:0,int64:0,int32:0,int16:0,int8:0,uint64:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:1,complex64:1,complex32:0,binary:0,generic:1,bool:0},float16:{float64:1,float32:1,float16:1,int64:0,int32:0,int16:0,int8:0,uint64:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:1,complex64:1,complex32:1,binary:0,generic:1,bool:0},int64:{float64:0,float32:0,float16:0,int64:1,int32:0,int16:0,int8:0,uint64:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:0,complex64:0,complex32:0,binary:0,generic:1,bool:0},int32:{float64:1,float32:0,float16:0,int64:1,int32:1,int16:0,int8:0,uint64:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:1,complex64:0,complex32:0,binary:0,generic:1,bool:0},int16:{float64:1,float32:1,float16:0,int64:1,int32:1,int16:1,int8:0,uint64:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:1,complex64:1,complex32:0,binary:0,generic:1,bool:0},int8:{float64:1,float32:1,float16:1,int64:1,int32:1,int16:1,int8:1,uint64:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:1,complex64:1,complex32:1,binary:0,generic:1,bool:0},uint64:{float64:0,float32:0,float16:0,int64:0,int32:0,int16:0,int8:0,uint64:1,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:0,complex64:0,complex32:0,binary:0,generic:1,bool:0},uint32:{float64:1,float32:0,float16:0,int64:1,int32:0,int16:0,int8:0,uint64:1,uint32:1,uint16:0,uint8:0,uint8c:0,complex128:1,complex64:0,complex32:0,binary:0,generic:1,bool:0},uint16:{float64:1,float32:1,float16:0,int64:1,int32:1,int16:0,int8:0,uint64:1,uint32:1,uint16:1,uint8:0,uint8c:0,complex128:1,complex64:1,complex32:0,binary:0,generic:1,bool:0},uint8:{float64:1,float32:1,float16:1,int64:1,int32:1,int16:1,int8:0,uint64:1,uint32:1,uint16:1,uint8:1,uint8c:1,complex128:1,complex64:1,complex32:1,binary:0,generic:1,bool:0},uint8c:{float64:1,float32:1,float16:1,int64:1,int32:1,int16:1,int8:0,uint64:1,uint32:1,uint16:1,uint8:1,uint8c:1,complex128:1,complex64:1,complex32:1,binary:0,generic:1,bool:0},complex128:{float64:0,float32:0,float16:0,int64:0,int32:0,int16:0,int8:0,uint64:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:1,complex64:0,complex32:0,binary:0,generic:1,bool:0},complex64:{float64:0,float32:0,float16:0,int64:0,int32:0,int16:0,int8:0,uint64:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:1,complex64:1,complex32:0,binary:0,generic:1,bool:0},complex32:{float64:0,float32:0,float16:0,int64:0,int32:0,int16:0,int8:0,uint64:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:1,complex64:1,complex32:1,binary:0,generic:1,bool:0},generic:{float64:0,float32:0,float16:0,int64:0,int32:0,int16:0,int8:0,uint64:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:0,complex64:0,complex32:0,binary:0,generic:1,bool:0},binary:{float64:0,float32:0,float16:0,int64:0,int32:0,int16:0,int8:0,uint64:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:0,complex64:0,complex32:0,binary:1,generic:0,bool:0},bool:{float64:0,float32:0,float16:0,int64:0,int32:0,int16:0,int8:0,uint64:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:0,complex64:0,complex32:0,binary:0,generic:1,bool:1}}});var v=p(function(S,b){
2
+ var x=require('@stdlib/utils-keys/dist'),y=require('@stdlib/assert-has-own-property/dist'),s=require('@stdlib/ndarray-base-dtype-resolve-str/dist'),f=m(),r;function h(){var t,n,l,e,u,a,c,i,o;for(l={},t=x(f),n=t.length,o=0;o<n;o++){for(u=t[o],c=f[u],e={},i=0;i<n;i++)a=t[i],e[a]=c[a];l[u]=e}return l}function q(){var t,n,l,e,u,a,c,i,o;for(l={},t=x(f),n=t.length,o=0;o<n;o++){for(u=t[o],c=f[u],e=[],i=0;i<n;i++)a=t[i],c[a]===1&&e.push(a);l[u]=e}return l}function d(t){return arguments.length===0?h():(r===void 0&&(r=q()),t=s(t),y(r,t)?r[t].slice():null)}b.exports=d
3
3
  });var T=v();module.exports=T;
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/safe_casts.json", "../lib/main.js", "../lib/index.js"],
4
- "sourcesContent": ["{\n\t\"float64\": {\n\t\t\"float64\": 1,\n\t\t\"float32\": 0,\n\t\t\"int32\": 0,\n\t\t\"int16\": 0,\n\t\t\"int8\": 0,\n\t\t\"uint32\": 0,\n\t\t\"uint16\": 0,\n\t\t\"uint8\": 0,\n\t\t\"uint8c\": 0,\n\t\t\"complex128\": 1,\n\t\t\"complex64\": 0,\n\t\t\"binary\": 0,\n\t\t\"generic\": 1,\n\t\t\"bool\": 0\n\t},\n\t\"float32\": {\n\t\t\"float64\": 1,\n\t\t\"float32\": 1,\n\t\t\"int32\": 0,\n\t\t\"int16\": 0,\n\t\t\"int8\": 0,\n\t\t\"uint32\": 0,\n\t\t\"uint16\": 0,\n\t\t\"uint8\": 0,\n\t\t\"uint8c\": 0,\n\t\t\"complex128\": 1,\n\t\t\"complex64\": 1,\n\t\t\"binary\": 0,\n\t\t\"generic\": 1,\n\t\t\"bool\": 0\n\t},\n\t\"int32\": {\n\t\t\"float64\": 1,\n\t\t\"float32\": 0,\n\t\t\"int32\": 1,\n\t\t\"int16\": 0,\n\t\t\"int8\": 0,\n\t\t\"uint32\": 0,\n\t\t\"uint16\": 0,\n\t\t\"uint8\": 0,\n\t\t\"uint8c\": 0,\n\t\t\"complex128\": 1,\n\t\t\"complex64\": 0,\n\t\t\"binary\": 0,\n\t\t\"generic\": 1,\n\t\t\"bool\": 0\n\t},\n\t\"int16\": {\n\t\t\"float64\": 1,\n\t\t\"float32\": 1,\n\t\t\"int32\": 1,\n\t\t\"int16\": 1,\n\t\t\"int8\": 0,\n\t\t\"uint32\": 0,\n\t\t\"uint16\": 0,\n\t\t\"uint8\": 0,\n\t\t\"uint8c\": 0,\n\t\t\"complex128\": 1,\n\t\t\"complex64\": 1,\n\t\t\"binary\": 0,\n\t\t\"generic\": 1,\n\t\t\"bool\": 0\n\t},\n\t\"int8\": {\n\t\t\"float64\": 1,\n\t\t\"float32\": 1,\n\t\t\"int32\": 1,\n\t\t\"int16\": 1,\n\t\t\"int8\": 1,\n\t\t\"uint32\": 0,\n\t\t\"uint16\": 0,\n\t\t\"uint8\": 0,\n\t\t\"uint8c\": 0,\n\t\t\"complex128\": 1,\n\t\t\"complex64\": 1,\n\t\t\"binary\": 0,\n\t\t\"generic\": 1,\n\t\t\"bool\": 0\n\t},\n\t\"uint32\": {\n\t\t\"float64\": 1,\n\t\t\"float32\": 0,\n\t\t\"int32\": 0,\n\t\t\"int16\": 0,\n\t\t\"int8\": 0,\n\t\t\"uint32\": 1,\n\t\t\"uint16\": 0,\n\t\t\"uint8\": 0,\n\t\t\"uint8c\": 0,\n\t\t\"complex128\": 1,\n\t\t\"complex64\": 0,\n\t\t\"binary\": 0,\n\t\t\"generic\": 1,\n\t\t\"bool\": 0\n\t},\n\t\"uint16\": {\n\t\t\"float64\": 1,\n\t\t\"float32\": 1,\n\t\t\"int32\": 1,\n\t\t\"int16\": 0,\n\t\t\"int8\": 0,\n\t\t\"uint32\": 1,\n\t\t\"uint16\": 1,\n\t\t\"uint8\": 0,\n\t\t\"uint8c\": 0,\n\t\t\"complex128\": 1,\n\t\t\"complex64\": 1,\n\t\t\"binary\": 0,\n\t\t\"generic\": 1,\n\t\t\"bool\": 0\n\t},\n\t\"uint8\": {\n\t\t\"float64\": 1,\n\t\t\"float32\": 1,\n\t\t\"int32\": 1,\n\t\t\"int16\": 1,\n\t\t\"int8\": 0,\n\t\t\"uint32\": 1,\n\t\t\"uint16\": 1,\n\t\t\"uint8\": 1,\n\t\t\"uint8c\": 1,\n\t\t\"complex128\": 1,\n\t\t\"complex64\": 1,\n\t\t\"binary\": 0,\n\t\t\"generic\": 1,\n\t\t\"bool\": 0\n\t},\n\t\"uint8c\": {\n\t\t\"float64\": 1,\n\t\t\"float32\": 1,\n\t\t\"int32\": 1,\n\t\t\"int16\": 1,\n\t\t\"int8\": 0,\n\t\t\"uint32\": 1,\n\t\t\"uint16\": 1,\n\t\t\"uint8\": 1,\n\t\t\"uint8c\": 1,\n\t\t\"complex128\": 1,\n\t\t\"complex64\": 1,\n\t\t\"binary\": 0,\n\t\t\"generic\": 1,\n\t\t\"bool\": 0\n\t},\n\t\"complex128\": {\n\t\t\"float64\": 0,\n\t\t\"float32\": 0,\n\t\t\"int32\": 0,\n\t\t\"int16\": 0,\n\t\t\"int8\": 0,\n\t\t\"uint32\": 0,\n\t\t\"uint16\": 0,\n\t\t\"uint8\": 0,\n\t\t\"uint8c\": 0,\n\t\t\"complex128\": 1,\n\t\t\"complex64\": 0,\n\t\t\"binary\": 0,\n\t\t\"generic\": 1,\n\t\t\"bool\": 0\n\t},\n\t\"complex64\": {\n\t\t\"float64\": 0,\n\t\t\"float32\": 0,\n\t\t\"int32\": 0,\n\t\t\"int16\": 0,\n\t\t\"int8\": 0,\n\t\t\"uint32\": 0,\n\t\t\"uint16\": 0,\n\t\t\"uint8\": 0,\n\t\t\"uint8c\": 0,\n\t\t\"complex128\": 1,\n\t\t\"complex64\": 1,\n\t\t\"binary\": 0,\n\t\t\"generic\": 1,\n\t\t\"bool\": 0\n\t},\n\t\"generic\": {\n\t\t\"float64\": 0,\n\t\t\"float32\": 0,\n\t\t\"int32\": 0,\n\t\t\"int16\": 0,\n\t\t\"int8\": 0,\n\t\t\"uint32\": 0,\n\t\t\"uint16\": 0,\n\t\t\"uint8\": 0,\n\t\t\"uint8c\": 0,\n\t\t\"complex128\": 0,\n\t\t\"complex64\": 0,\n\t\t\"binary\": 0,\n\t\t\"generic\": 1,\n\t\t\"bool\": 0\n\t},\n\t\"binary\": {\n\t\t\"float64\": 0,\n\t\t\"float32\": 0,\n\t\t\"int32\": 0,\n\t\t\"int16\": 0,\n\t\t\"int8\": 0,\n\t\t\"uint32\": 0,\n\t\t\"uint16\": 0,\n\t\t\"uint8\": 0,\n\t\t\"uint8c\": 0,\n\t\t\"complex128\": 0,\n\t\t\"complex64\": 0,\n\t\t\"binary\": 1,\n\t\t\"generic\": 0,\n\t\t\"bool\": 0\n\t},\n\t\"bool\": {\n\t\t\"float64\": 0,\n\t\t\"float32\": 0,\n\t\t\"int32\": 0,\n\t\t\"int16\": 0,\n\t\t\"int8\": 0,\n\t\t\"uint32\": 0,\n\t\t\"uint16\": 0,\n\t\t\"uint8\": 0,\n\t\t\"uint8c\": 0,\n\t\t\"complex128\": 0,\n\t\t\"complex64\": 0,\n\t\t\"binary\": 0,\n\t\t\"generic\": 1,\n\t\t\"bool\": 1\n\t}\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 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 objectKeys = require( '@stdlib/utils-keys' );\nvar hasOwnProp = require( '@stdlib/assert-has-own-property' );\nvar resolve = require( '@stdlib/ndarray-base-dtype-resolve-str' );\nvar SAFE_CASTS = require( './safe_casts.json' );\n\n\n// VARIABLES //\n\nvar TABLE;\n\n\n// FUNCTIONS //\n\n/**\n* Generates a full table of safe casts for each ndarray data type.\n*\n* @private\n* @returns {Object} table\n*/\nfunction generateFullTable() {\n\tvar dtypes;\n\tvar ntypes;\n\tvar out;\n\tvar tmp;\n\tvar dt1;\n\tvar dt2;\n\tvar o;\n\tvar j;\n\tvar i;\n\n\tout = {};\n\tdtypes = objectKeys( SAFE_CASTS );\n\tntypes = dtypes.length;\n\tfor ( i = 0; i < ntypes; i++ ) {\n\t\tdt1 = dtypes[ i ];\n\t\to = SAFE_CASTS[ dt1 ];\n\t\ttmp = {};\n\t\tfor ( j = 0; j < ntypes; j++ ) {\n\t\t\tdt2 = dtypes[ j ];\n\t\t\ttmp[ dt2 ] = o[ dt2 ];\n\t\t}\n\t\tout[ dt1 ] = tmp;\n\t}\n\treturn out;\n}\n\n/**\n* Generates a table of safe casts for each ndarray data type.\n*\n* @private\n* @returns {Object} table\n*/\nfunction generateTable() {\n\tvar dtypes;\n\tvar ntypes;\n\tvar out;\n\tvar tmp;\n\tvar dt1;\n\tvar dt2;\n\tvar o;\n\tvar j;\n\tvar i;\n\n\tout = {};\n\tdtypes = objectKeys( SAFE_CASTS );\n\tntypes = dtypes.length;\n\tfor ( i = 0; i < ntypes; i++ ) {\n\t\tdt1 = dtypes[ i ];\n\t\to = SAFE_CASTS[ dt1 ];\n\t\ttmp = [];\n\t\tfor ( j = 0; j < ntypes; j++ ) {\n\t\t\tdt2 = dtypes[ j ];\n\t\t\tif ( o[ dt2 ] === 1 ) {\n\t\t\t\ttmp.push( dt2 );\n\t\t\t}\n\t\t}\n\t\tout[ dt1 ] = tmp;\n\t}\n\treturn out;\n}\n\n\n// MAIN //\n\n/**\n* Returns a list of ndarray data types to which a provided ndarray data type can be safely cast.\n*\n* @param {*} [dtype] - ndarray data type value\n* @returns {(Object|StringArray|null)} list of ndarray data types or null\n*\n* @example\n* var list = safeCasts( 'float32' );\n* // returns [...]\n*/\nfunction safeCasts( dtype ) {\n\tif ( arguments.length === 0 ) {\n\t\treturn generateFullTable();\n\t}\n\tif ( TABLE === void 0 ) {\n\t\t// Lazily generate table...\n\t\tTABLE = generateTable();\n\t}\n\tdtype = resolve( dtype );\n\tif ( hasOwnProp( TABLE, dtype ) ) {\n\t\treturn TABLE[ dtype ].slice();\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = safeCasts;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 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* Return a list of ndarray data types to which a provided ndarray data type can be safely cast.\n*\n* @module @stdlib/ndarray-safe-casts\n*\n* @example\n* var safeCasts = require( '@stdlib/ndarray-safe-casts' );\n*\n* var list = safeCasts( 'float32' );\n* // returns [...]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n"],
5
- "mappings": "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",
4
+ "sourcesContent": ["{\n \"float64\": {\n \"float64\": 1,\n \"float32\": 0,\n \"float16\": 0,\n \"int64\": 0,\n \"int32\": 0,\n \"int16\": 0,\n \"int8\": 0,\n \"uint64\": 0,\n \"uint32\": 0,\n \"uint16\": 0,\n \"uint8\": 0,\n \"uint8c\": 0,\n \"complex128\": 1,\n \"complex64\": 0,\n \"complex32\": 0,\n \"binary\": 0,\n \"generic\": 1,\n \"bool\": 0\n },\n \"float32\": {\n \"float64\": 1,\n \"float32\": 1,\n \"float16\": 0,\n \"int64\": 0,\n \"int32\": 0,\n \"int16\": 0,\n \"int8\": 0,\n \"uint64\": 0,\n \"uint32\": 0,\n \"uint16\": 0,\n \"uint8\": 0,\n \"uint8c\": 0,\n \"complex128\": 1,\n \"complex64\": 1,\n \"complex32\": 0,\n \"binary\": 0,\n \"generic\": 1,\n \"bool\": 0\n },\n \"float16\": {\n \"float64\": 1,\n \"float32\": 1,\n \"float16\": 1,\n \"int64\": 0,\n \"int32\": 0,\n \"int16\": 0,\n \"int8\": 0,\n \"uint64\": 0,\n \"uint32\": 0,\n \"uint16\": 0,\n \"uint8\": 0,\n \"uint8c\": 0,\n \"complex128\": 1,\n \"complex64\": 1,\n \"complex32\": 1,\n \"binary\": 0,\n \"generic\": 1,\n \"bool\": 0\n },\n \"int64\": {\n \"float64\": 0,\n \"float32\": 0,\n \"float16\": 0,\n \"int64\": 1,\n \"int32\": 0,\n \"int16\": 0,\n \"int8\": 0,\n \"uint64\": 0,\n \"uint32\": 0,\n \"uint16\": 0,\n \"uint8\": 0,\n \"uint8c\": 0,\n \"complex128\": 0,\n \"complex64\": 0,\n \"complex32\": 0,\n \"binary\": 0,\n \"generic\": 1,\n \"bool\": 0\n },\n \"int32\": {\n \"float64\": 1,\n \"float32\": 0,\n \"float16\": 0,\n \"int64\": 1,\n \"int32\": 1,\n \"int16\": 0,\n \"int8\": 0,\n \"uint64\": 0,\n \"uint32\": 0,\n \"uint16\": 0,\n \"uint8\": 0,\n \"uint8c\": 0,\n \"complex128\": 1,\n \"complex64\": 0,\n \"complex32\": 0,\n \"binary\": 0,\n \"generic\": 1,\n \"bool\": 0\n },\n \"int16\": {\n \"float64\": 1,\n \"float32\": 1,\n \"float16\": 0,\n \"int64\": 1,\n \"int32\": 1,\n \"int16\": 1,\n \"int8\": 0,\n \"uint64\": 0,\n \"uint32\": 0,\n \"uint16\": 0,\n \"uint8\": 0,\n \"uint8c\": 0,\n \"complex128\": 1,\n \"complex64\": 1,\n \"complex32\": 0,\n \"binary\": 0,\n \"generic\": 1,\n \"bool\": 0\n },\n \"int8\": {\n \"float64\": 1,\n \"float32\": 1,\n \"float16\": 1,\n \"int64\": 1,\n \"int32\": 1,\n \"int16\": 1,\n \"int8\": 1,\n \"uint64\": 0,\n \"uint32\": 0,\n \"uint16\": 0,\n \"uint8\": 0,\n \"uint8c\": 0,\n \"complex128\": 1,\n \"complex64\": 1,\n \"complex32\": 1,\n \"binary\": 0,\n \"generic\": 1,\n \"bool\": 0\n },\n \"uint64\": {\n \"float64\": 0,\n \"float32\": 0,\n \"float16\": 0,\n \"int64\": 0,\n \"int32\": 0,\n \"int16\": 0,\n \"int8\": 0,\n \"uint64\": 1,\n \"uint32\": 0,\n \"uint16\": 0,\n \"uint8\": 0,\n \"uint8c\": 0,\n \"complex128\": 0,\n \"complex64\": 0,\n \"complex32\": 0,\n \"binary\": 0,\n \"generic\": 1,\n \"bool\": 0\n },\n \"uint32\": {\n \"float64\": 1,\n \"float32\": 0,\n \"float16\": 0,\n \"int64\": 1,\n \"int32\": 0,\n \"int16\": 0,\n \"int8\": 0,\n \"uint64\": 1,\n \"uint32\": 1,\n \"uint16\": 0,\n \"uint8\": 0,\n \"uint8c\": 0,\n \"complex128\": 1,\n \"complex64\": 0,\n \"complex32\": 0,\n \"binary\": 0,\n \"generic\": 1,\n \"bool\": 0\n },\n \"uint16\": {\n \"float64\": 1,\n \"float32\": 1,\n \"float16\": 0,\n \"int64\": 1,\n \"int32\": 1,\n \"int16\": 0,\n \"int8\": 0,\n \"uint64\": 1,\n \"uint32\": 1,\n \"uint16\": 1,\n \"uint8\": 0,\n \"uint8c\": 0,\n \"complex128\": 1,\n \"complex64\": 1,\n \"complex32\": 0,\n \"binary\": 0,\n \"generic\": 1,\n \"bool\": 0\n },\n \"uint8\": {\n \"float64\": 1,\n \"float32\": 1,\n \"float16\": 1,\n \"int64\": 1,\n \"int32\": 1,\n \"int16\": 1,\n \"int8\": 0,\n \"uint64\": 1,\n \"uint32\": 1,\n \"uint16\": 1,\n \"uint8\": 1,\n \"uint8c\": 1,\n \"complex128\": 1,\n \"complex64\": 1,\n \"complex32\": 1,\n \"binary\": 0,\n \"generic\": 1,\n \"bool\": 0\n },\n \"uint8c\": {\n \"float64\": 1,\n \"float32\": 1,\n \"float16\": 1,\n \"int64\": 1,\n \"int32\": 1,\n \"int16\": 1,\n \"int8\": 0,\n \"uint64\": 1,\n \"uint32\": 1,\n \"uint16\": 1,\n \"uint8\": 1,\n \"uint8c\": 1,\n \"complex128\": 1,\n \"complex64\": 1,\n \"complex32\": 1,\n \"binary\": 0,\n \"generic\": 1,\n \"bool\": 0\n },\n \"complex128\": {\n \"float64\": 0,\n \"float32\": 0,\n \"float16\": 0,\n \"int64\": 0,\n \"int32\": 0,\n \"int16\": 0,\n \"int8\": 0,\n \"uint64\": 0,\n \"uint32\": 0,\n \"uint16\": 0,\n \"uint8\": 0,\n \"uint8c\": 0,\n \"complex128\": 1,\n \"complex64\": 0,\n \"complex32\": 0,\n \"binary\": 0,\n \"generic\": 1,\n \"bool\": 0\n },\n \"complex64\": {\n \"float64\": 0,\n \"float32\": 0,\n \"float16\": 0,\n \"int64\": 0,\n \"int32\": 0,\n \"int16\": 0,\n \"int8\": 0,\n \"uint64\": 0,\n \"uint32\": 0,\n \"uint16\": 0,\n \"uint8\": 0,\n \"uint8c\": 0,\n \"complex128\": 1,\n \"complex64\": 1,\n \"complex32\": 0,\n \"binary\": 0,\n \"generic\": 1,\n \"bool\": 0\n },\n \"complex32\": {\n \"float64\": 0,\n \"float32\": 0,\n \"float16\": 0,\n \"int64\": 0,\n \"int32\": 0,\n \"int16\": 0,\n \"int8\": 0,\n \"uint64\": 0,\n \"uint32\": 0,\n \"uint16\": 0,\n \"uint8\": 0,\n \"uint8c\": 0,\n \"complex128\": 1,\n \"complex64\": 1,\n \"complex32\": 1,\n \"binary\": 0,\n \"generic\": 1,\n \"bool\": 0\n },\n \"generic\": {\n \"float64\": 0,\n \"float32\": 0,\n \"float16\": 0,\n \"int64\": 0,\n \"int32\": 0,\n \"int16\": 0,\n \"int8\": 0,\n \"uint64\": 0,\n \"uint32\": 0,\n \"uint16\": 0,\n \"uint8\": 0,\n \"uint8c\": 0,\n \"complex128\": 0,\n \"complex64\": 0,\n \"complex32\": 0,\n \"binary\": 0,\n \"generic\": 1,\n \"bool\": 0\n },\n \"binary\": {\n \"float64\": 0,\n \"float32\": 0,\n \"float16\": 0,\n \"int64\": 0,\n \"int32\": 0,\n \"int16\": 0,\n \"int8\": 0,\n \"uint64\": 0,\n \"uint32\": 0,\n \"uint16\": 0,\n \"uint8\": 0,\n \"uint8c\": 0,\n \"complex128\": 0,\n \"complex64\": 0,\n \"complex32\": 0,\n \"binary\": 1,\n \"generic\": 0,\n \"bool\": 0\n },\n \"bool\": {\n \"float64\": 0,\n \"float32\": 0,\n \"float16\": 0,\n \"int64\": 0,\n \"int32\": 0,\n \"int16\": 0,\n \"int8\": 0,\n \"uint64\": 0,\n \"uint32\": 0,\n \"uint16\": 0,\n \"uint8\": 0,\n \"uint8c\": 0,\n \"complex128\": 0,\n \"complex64\": 0,\n \"complex32\": 0,\n \"binary\": 0,\n \"generic\": 1,\n \"bool\": 1\n }\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 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 objectKeys = require( '@stdlib/utils-keys' );\nvar hasOwnProp = require( '@stdlib/assert-has-own-property' );\nvar resolve = require( '@stdlib/ndarray-base-dtype-resolve-str' );\nvar SAFE_CASTS = require( './safe_casts.json' );\n\n\n// VARIABLES //\n\nvar TABLE;\n\n\n// FUNCTIONS //\n\n/**\n* Generates a full table of safe casts for each ndarray data type.\n*\n* @private\n* @returns {Object} table\n*/\nfunction generateFullTable() {\n\tvar dtypes;\n\tvar ntypes;\n\tvar out;\n\tvar tmp;\n\tvar dt1;\n\tvar dt2;\n\tvar o;\n\tvar j;\n\tvar i;\n\n\tout = {};\n\tdtypes = objectKeys( SAFE_CASTS );\n\tntypes = dtypes.length;\n\tfor ( i = 0; i < ntypes; i++ ) {\n\t\tdt1 = dtypes[ i ];\n\t\to = SAFE_CASTS[ dt1 ];\n\t\ttmp = {};\n\t\tfor ( j = 0; j < ntypes; j++ ) {\n\t\t\tdt2 = dtypes[ j ];\n\t\t\ttmp[ dt2 ] = o[ dt2 ];\n\t\t}\n\t\tout[ dt1 ] = tmp;\n\t}\n\treturn out;\n}\n\n/**\n* Generates a table of safe casts for each ndarray data type.\n*\n* @private\n* @returns {Object} table\n*/\nfunction generateTable() {\n\tvar dtypes;\n\tvar ntypes;\n\tvar out;\n\tvar tmp;\n\tvar dt1;\n\tvar dt2;\n\tvar o;\n\tvar j;\n\tvar i;\n\n\tout = {};\n\tdtypes = objectKeys( SAFE_CASTS );\n\tntypes = dtypes.length;\n\tfor ( i = 0; i < ntypes; i++ ) {\n\t\tdt1 = dtypes[ i ];\n\t\to = SAFE_CASTS[ dt1 ];\n\t\ttmp = [];\n\t\tfor ( j = 0; j < ntypes; j++ ) {\n\t\t\tdt2 = dtypes[ j ];\n\t\t\tif ( o[ dt2 ] === 1 ) {\n\t\t\t\ttmp.push( dt2 );\n\t\t\t}\n\t\t}\n\t\tout[ dt1 ] = tmp;\n\t}\n\treturn out;\n}\n\n\n// MAIN //\n\n/**\n* Returns a list of ndarray data types to which a provided ndarray data type can be safely cast.\n*\n* @param {*} [dtype] - ndarray data type value\n* @returns {(Object|StringArray|null)} list of ndarray data types or null\n*\n* @example\n* var list = safeCasts( 'float32' );\n* // returns [...]\n*/\nfunction safeCasts( dtype ) {\n\tif ( arguments.length === 0 ) {\n\t\treturn generateFullTable();\n\t}\n\tif ( TABLE === void 0 ) {\n\t\t// Lazily generate table...\n\t\tTABLE = generateTable();\n\t}\n\tdtype = resolve( dtype );\n\tif ( hasOwnProp( TABLE, dtype ) ) {\n\t\treturn TABLE[ dtype ].slice();\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = safeCasts;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 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* Return a list of ndarray data types to which a provided ndarray data type can be safely cast.\n*\n* @module @stdlib/ndarray-safe-casts\n*\n* @example\n* var safeCasts = require( '@stdlib/ndarray-safe-casts' );\n*\n* var list = safeCasts( 'float32' );\n* // returns [...]\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,CAAAA,EAAA,SACE,QAAW,CACT,QAAW,EACX,QAAW,EACX,QAAW,EACX,MAAS,EACT,MAAS,EACT,MAAS,EACT,KAAQ,EACR,OAAU,EACV,OAAU,EACV,OAAU,EACV,MAAS,EACT,OAAU,EACV,WAAc,EACd,UAAa,EACb,UAAa,EACb,OAAU,EACV,QAAW,EACX,KAAQ,CACV,EACA,QAAW,CACT,QAAW,EACX,QAAW,EACX,QAAW,EACX,MAAS,EACT,MAAS,EACT,MAAS,EACT,KAAQ,EACR,OAAU,EACV,OAAU,EACV,OAAU,EACV,MAAS,EACT,OAAU,EACV,WAAc,EACd,UAAa,EACb,UAAa,EACb,OAAU,EACV,QAAW,EACX,KAAQ,CACV,EACA,QAAW,CACT,QAAW,EACX,QAAW,EACX,QAAW,EACX,MAAS,EACT,MAAS,EACT,MAAS,EACT,KAAQ,EACR,OAAU,EACV,OAAU,EACV,OAAU,EACV,MAAS,EACT,OAAU,EACV,WAAc,EACd,UAAa,EACb,UAAa,EACb,OAAU,EACV,QAAW,EACX,KAAQ,CACV,EACA,MAAS,CACP,QAAW,EACX,QAAW,EACX,QAAW,EACX,MAAS,EACT,MAAS,EACT,MAAS,EACT,KAAQ,EACR,OAAU,EACV,OAAU,EACV,OAAU,EACV,MAAS,EACT,OAAU,EACV,WAAc,EACd,UAAa,EACb,UAAa,EACb,OAAU,EACV,QAAW,EACX,KAAQ,CACV,EACA,MAAS,CACP,QAAW,EACX,QAAW,EACX,QAAW,EACX,MAAS,EACT,MAAS,EACT,MAAS,EACT,KAAQ,EACR,OAAU,EACV,OAAU,EACV,OAAU,EACV,MAAS,EACT,OAAU,EACV,WAAc,EACd,UAAa,EACb,UAAa,EACb,OAAU,EACV,QAAW,EACX,KAAQ,CACV,EACA,MAAS,CACP,QAAW,EACX,QAAW,EACX,QAAW,EACX,MAAS,EACT,MAAS,EACT,MAAS,EACT,KAAQ,EACR,OAAU,EACV,OAAU,EACV,OAAU,EACV,MAAS,EACT,OAAU,EACV,WAAc,EACd,UAAa,EACb,UAAa,EACb,OAAU,EACV,QAAW,EACX,KAAQ,CACV,EACA,KAAQ,CACN,QAAW,EACX,QAAW,EACX,QAAW,EACX,MAAS,EACT,MAAS,EACT,MAAS,EACT,KAAQ,EACR,OAAU,EACV,OAAU,EACV,OAAU,EACV,MAAS,EACT,OAAU,EACV,WAAc,EACd,UAAa,EACb,UAAa,EACb,OAAU,EACV,QAAW,EACX,KAAQ,CACV,EACA,OAAU,CACR,QAAW,EACX,QAAW,EACX,QAAW,EACX,MAAS,EACT,MAAS,EACT,MAAS,EACT,KAAQ,EACR,OAAU,EACV,OAAU,EACV,OAAU,EACV,MAAS,EACT,OAAU,EACV,WAAc,EACd,UAAa,EACb,UAAa,EACb,OAAU,EACV,QAAW,EACX,KAAQ,CACV,EACA,OAAU,CACR,QAAW,EACX,QAAW,EACX,QAAW,EACX,MAAS,EACT,MAAS,EACT,MAAS,EACT,KAAQ,EACR,OAAU,EACV,OAAU,EACV,OAAU,EACV,MAAS,EACT,OAAU,EACV,WAAc,EACd,UAAa,EACb,UAAa,EACb,OAAU,EACV,QAAW,EACX,KAAQ,CACV,EACA,OAAU,CACR,QAAW,EACX,QAAW,EACX,QAAW,EACX,MAAS,EACT,MAAS,EACT,MAAS,EACT,KAAQ,EACR,OAAU,EACV,OAAU,EACV,OAAU,EACV,MAAS,EACT,OAAU,EACV,WAAc,EACd,UAAa,EACb,UAAa,EACb,OAAU,EACV,QAAW,EACX,KAAQ,CACV,EACA,MAAS,CACP,QAAW,EACX,QAAW,EACX,QAAW,EACX,MAAS,EACT,MAAS,EACT,MAAS,EACT,KAAQ,EACR,OAAU,EACV,OAAU,EACV,OAAU,EACV,MAAS,EACT,OAAU,EACV,WAAc,EACd,UAAa,EACb,UAAa,EACb,OAAU,EACV,QAAW,EACX,KAAQ,CACV,EACA,OAAU,CACR,QAAW,EACX,QAAW,EACX,QAAW,EACX,MAAS,EACT,MAAS,EACT,MAAS,EACT,KAAQ,EACR,OAAU,EACV,OAAU,EACV,OAAU,EACV,MAAS,EACT,OAAU,EACV,WAAc,EACd,UAAa,EACb,UAAa,EACb,OAAU,EACV,QAAW,EACX,KAAQ,CACV,EACA,WAAc,CACZ,QAAW,EACX,QAAW,EACX,QAAW,EACX,MAAS,EACT,MAAS,EACT,MAAS,EACT,KAAQ,EACR,OAAU,EACV,OAAU,EACV,OAAU,EACV,MAAS,EACT,OAAU,EACV,WAAc,EACd,UAAa,EACb,UAAa,EACb,OAAU,EACV,QAAW,EACX,KAAQ,CACV,EACA,UAAa,CACX,QAAW,EACX,QAAW,EACX,QAAW,EACX,MAAS,EACT,MAAS,EACT,MAAS,EACT,KAAQ,EACR,OAAU,EACV,OAAU,EACV,OAAU,EACV,MAAS,EACT,OAAU,EACV,WAAc,EACd,UAAa,EACb,UAAa,EACb,OAAU,EACV,QAAW,EACX,KAAQ,CACV,EACA,UAAa,CACX,QAAW,EACX,QAAW,EACX,QAAW,EACX,MAAS,EACT,MAAS,EACT,MAAS,EACT,KAAQ,EACR,OAAU,EACV,OAAU,EACV,OAAU,EACV,MAAS,EACT,OAAU,EACV,WAAc,EACd,UAAa,EACb,UAAa,EACb,OAAU,EACV,QAAW,EACX,KAAQ,CACV,EACA,QAAW,CACT,QAAW,EACX,QAAW,EACX,QAAW,EACX,MAAS,EACT,MAAS,EACT,MAAS,EACT,KAAQ,EACR,OAAU,EACV,OAAU,EACV,OAAU,EACV,MAAS,EACT,OAAU,EACV,WAAc,EACd,UAAa,EACb,UAAa,EACb,OAAU,EACV,QAAW,EACX,KAAQ,CACV,EACA,OAAU,CACR,QAAW,EACX,QAAW,EACX,QAAW,EACX,MAAS,EACT,MAAS,EACT,MAAS,EACT,KAAQ,EACR,OAAU,EACV,OAAU,EACV,OAAU,EACV,MAAS,EACT,OAAU,EACV,WAAc,EACd,UAAa,EACb,UAAa,EACb,OAAU,EACV,QAAW,EACX,KAAQ,CACV,EACA,KAAQ,CACN,QAAW,EACX,QAAW,EACX,QAAW,EACX,MAAS,EACT,MAAS,EACT,MAAS,EACT,KAAQ,EACR,OAAU,EACV,OAAU,EACV,OAAU,EACV,MAAS,EACT,OAAU,EACV,WAAc,EACd,UAAa,EACb,UAAa,EACb,OAAU,EACV,QAAW,EACX,KAAQ,CACV,CACF,ICzWA,IAAAC,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAa,QAAS,oBAAqB,EAC3CC,EAAa,QAAS,iCAAkC,EACxDC,EAAU,QAAS,wCAAyC,EAC5DC,EAAa,IAKbC,EAWJ,SAASC,GAAoB,CAC5B,IAAIC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EAKJ,IAHAN,EAAM,CAAC,EACPF,EAASN,EAAYG,CAAW,EAChCI,EAASD,EAAO,OACVQ,EAAI,EAAGA,EAAIP,EAAQO,IAAM,CAI9B,IAHAJ,EAAMJ,EAAQQ,CAAE,EAChBF,EAAIT,EAAYO,CAAI,EACpBD,EAAM,CAAC,EACDI,EAAI,EAAGA,EAAIN,EAAQM,IACxBF,EAAML,EAAQO,CAAE,EAChBJ,EAAKE,CAAI,EAAIC,EAAGD,CAAI,EAErBH,EAAKE,CAAI,EAAID,CACd,CACA,OAAOD,CACR,CAQA,SAASO,GAAgB,CACxB,IAAIT,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EAKJ,IAHAN,EAAM,CAAC,EACPF,EAASN,EAAYG,CAAW,EAChCI,EAASD,EAAO,OACVQ,EAAI,EAAGA,EAAIP,EAAQO,IAAM,CAI9B,IAHAJ,EAAMJ,EAAQQ,CAAE,EAChBF,EAAIT,EAAYO,CAAI,EACpBD,EAAM,CAAC,EACDI,EAAI,EAAGA,EAAIN,EAAQM,IACxBF,EAAML,EAAQO,CAAE,EACXD,EAAGD,CAAI,IAAM,GACjBF,EAAI,KAAME,CAAI,EAGhBH,EAAKE,CAAI,EAAID,CACd,CACA,OAAOD,CACR,CAeA,SAASQ,EAAWC,EAAQ,CAC3B,OAAK,UAAU,SAAW,EAClBZ,EAAkB,GAErBD,IAAU,SAEdA,EAAQW,EAAc,GAEvBE,EAAQf,EAASe,CAAM,EAClBhB,EAAYG,EAAOa,CAAM,EACtBb,EAAOa,CAAM,EAAE,MAAM,EAEtB,KACR,CAKAlB,EAAO,QAAUiB,ICpGjB,IAAIE,EAAO,IAKX,OAAO,QAAUA",
6
6
  "names": ["require_safe_casts", "__commonJSMin", "exports", "module", "require_main", "__commonJSMin", "exports", "module", "objectKeys", "hasOwnProp", "resolve", "SAFE_CASTS", "TABLE", "generateFullTable", "dtypes", "ntypes", "out", "tmp", "dt1", "dt2", "o", "j", "i", "generateTable", "safeCasts", "dtype", "main"]
7
7
  }
@@ -41,9 +41,11 @@ const int8_t STDLIB_NDARRAY_SAFE_CASTS_FLOAT64[ STDLIB_NDARRAY_NDTYPES ] = {
41
41
  [ STDLIB_NDARRAY_INT64 ] = 0,
42
42
  [ STDLIB_NDARRAY_UINT64 ] = 0,
43
43
 
44
+ [ STDLIB_NDARRAY_FLOAT16 ] = 0,
44
45
  [ STDLIB_NDARRAY_FLOAT32 ] = 0,
45
46
  [ STDLIB_NDARRAY_FLOAT64 ] = 1,
46
47
 
48
+ [ STDLIB_NDARRAY_COMPLEX32 ] = 0,
47
49
  [ STDLIB_NDARRAY_COMPLEX64 ] = 0,
48
50
  [ STDLIB_NDARRAY_COMPLEX128 ] = 1,
49
51
 
@@ -65,9 +67,37 @@ const int8_t STDLIB_NDARRAY_SAFE_CASTS_FLOAT32[ STDLIB_NDARRAY_NDTYPES ] = {
65
67
  [ STDLIB_NDARRAY_INT64 ] = 0,
66
68
  [ STDLIB_NDARRAY_UINT64 ] = 0,
67
69
 
70
+ [ STDLIB_NDARRAY_FLOAT16 ] = 0,
68
71
  [ STDLIB_NDARRAY_FLOAT32 ] = 1,
69
72
  [ STDLIB_NDARRAY_FLOAT64 ] = 1,
70
73
 
74
+ [ STDLIB_NDARRAY_COMPLEX32 ] = 0,
75
+ [ STDLIB_NDARRAY_COMPLEX64 ] = 1,
76
+ [ STDLIB_NDARRAY_COMPLEX128 ] = 1,
77
+
78
+ [ STDLIB_NDARRAY_BOOL ] = 0,
79
+
80
+ [ STDLIB_NDARRAY_BINARY ] = 0,
81
+ [ STDLIB_NDARRAY_GENERIC ] = 0
82
+ };
83
+
84
+ const int8_t STDLIB_NDARRAY_SAFE_CASTS_FLOAT16[ STDLIB_NDARRAY_NDTYPES ] = {
85
+
86
+ [ STDLIB_NDARRAY_INT8 ] = 0,
87
+ [ STDLIB_NDARRAY_UINT8 ] = 0,
88
+ [ STDLIB_NDARRAY_UINT8C ] = 0,
89
+ [ STDLIB_NDARRAY_INT16 ] = 0,
90
+ [ STDLIB_NDARRAY_UINT16 ] = 0,
91
+ [ STDLIB_NDARRAY_INT32 ] = 0,
92
+ [ STDLIB_NDARRAY_UINT32 ] = 0,
93
+ [ STDLIB_NDARRAY_INT64 ] = 0,
94
+ [ STDLIB_NDARRAY_UINT64 ] = 0,
95
+
96
+ [ STDLIB_NDARRAY_FLOAT16 ] = 1,
97
+ [ STDLIB_NDARRAY_FLOAT32 ] = 1,
98
+ [ STDLIB_NDARRAY_FLOAT64 ] = 1,
99
+
100
+ [ STDLIB_NDARRAY_COMPLEX32 ] = 1,
71
101
  [ STDLIB_NDARRAY_COMPLEX64 ] = 1,
72
102
  [ STDLIB_NDARRAY_COMPLEX128 ] = 1,
73
103
 
@@ -89,9 +119,11 @@ const int8_t STDLIB_NDARRAY_SAFE_CASTS_UINT64[ STDLIB_NDARRAY_NDTYPES ] = {
89
119
  [ STDLIB_NDARRAY_INT64 ] = 0,
90
120
  [ STDLIB_NDARRAY_UINT64 ] = 1,
91
121
 
122
+ [ STDLIB_NDARRAY_FLOAT16 ] = 0,
92
123
  [ STDLIB_NDARRAY_FLOAT32 ] = 0,
93
124
  [ STDLIB_NDARRAY_FLOAT64 ] = 0,
94
125
 
126
+ [ STDLIB_NDARRAY_COMPLEX32 ] = 0,
95
127
  [ STDLIB_NDARRAY_COMPLEX64 ] = 0,
96
128
  [ STDLIB_NDARRAY_COMPLEX128 ] = 0,
97
129
 
@@ -113,9 +145,11 @@ const int8_t STDLIB_NDARRAY_SAFE_CASTS_INT64[ STDLIB_NDARRAY_NDTYPES ] = {
113
145
  [ STDLIB_NDARRAY_INT64 ] = 1,
114
146
  [ STDLIB_NDARRAY_UINT64 ] = 0,
115
147
 
148
+ [ STDLIB_NDARRAY_FLOAT16 ] = 0,
116
149
  [ STDLIB_NDARRAY_FLOAT32 ] = 0,
117
150
  [ STDLIB_NDARRAY_FLOAT64 ] = 0,
118
151
 
152
+ [ STDLIB_NDARRAY_COMPLEX32 ] = 0,
119
153
  [ STDLIB_NDARRAY_COMPLEX64 ] = 0,
120
154
  [ STDLIB_NDARRAY_COMPLEX128 ] = 0,
121
155
 
@@ -137,9 +171,11 @@ const int8_t STDLIB_NDARRAY_SAFE_CASTS_UINT32[ STDLIB_NDARRAY_NDTYPES ] = {
137
171
  [ STDLIB_NDARRAY_INT64 ] = 1,
138
172
  [ STDLIB_NDARRAY_UINT64 ] = 1,
139
173
 
174
+ [ STDLIB_NDARRAY_FLOAT16 ] = 0,
140
175
  [ STDLIB_NDARRAY_FLOAT32 ] = 0,
141
176
  [ STDLIB_NDARRAY_FLOAT64 ] = 1,
142
177
 
178
+ [ STDLIB_NDARRAY_COMPLEX32 ] = 0,
143
179
  [ STDLIB_NDARRAY_COMPLEX64 ] = 0,
144
180
  [ STDLIB_NDARRAY_COMPLEX128 ] = 1,
145
181
 
@@ -161,9 +197,11 @@ const int8_t STDLIB_NDARRAY_SAFE_CASTS_INT32[ STDLIB_NDARRAY_NDTYPES ] = {
161
197
  [ STDLIB_NDARRAY_INT64 ] = 1,
162
198
  [ STDLIB_NDARRAY_UINT64 ] = 0,
163
199
 
200
+ [ STDLIB_NDARRAY_FLOAT16 ] = 0,
164
201
  [ STDLIB_NDARRAY_FLOAT32 ] = 0,
165
202
  [ STDLIB_NDARRAY_FLOAT64 ] = 1,
166
203
 
204
+ [ STDLIB_NDARRAY_COMPLEX32 ] = 0,
167
205
  [ STDLIB_NDARRAY_COMPLEX64 ] = 0,
168
206
  [ STDLIB_NDARRAY_COMPLEX128 ] = 1,
169
207
 
@@ -185,9 +223,11 @@ const int8_t STDLIB_NDARRAY_SAFE_CASTS_UINT16[ STDLIB_NDARRAY_NDTYPES ] = {
185
223
  [ STDLIB_NDARRAY_INT64 ] = 1,
186
224
  [ STDLIB_NDARRAY_UINT64 ] = 1,
187
225
 
226
+ [ STDLIB_NDARRAY_FLOAT16 ] = 0,
188
227
  [ STDLIB_NDARRAY_FLOAT32 ] = 1,
189
228
  [ STDLIB_NDARRAY_FLOAT64 ] = 1,
190
229
 
230
+ [ STDLIB_NDARRAY_COMPLEX32 ] = 0,
191
231
  [ STDLIB_NDARRAY_COMPLEX64 ] = 1,
192
232
  [ STDLIB_NDARRAY_COMPLEX128 ] = 1,
193
233
 
@@ -209,9 +249,11 @@ const int8_t STDLIB_NDARRAY_SAFE_CASTS_INT16[ STDLIB_NDARRAY_NDTYPES ] = {
209
249
  [ STDLIB_NDARRAY_INT64 ] = 1,
210
250
  [ STDLIB_NDARRAY_UINT64 ] = 0,
211
251
 
252
+ [ STDLIB_NDARRAY_FLOAT16 ] = 0,
212
253
  [ STDLIB_NDARRAY_FLOAT32 ] = 1,
213
254
  [ STDLIB_NDARRAY_FLOAT64 ] = 1,
214
255
 
256
+ [ STDLIB_NDARRAY_COMPLEX32 ] = 0,
215
257
  [ STDLIB_NDARRAY_COMPLEX64 ] = 1,
216
258
  [ STDLIB_NDARRAY_COMPLEX128 ] = 1,
217
259
 
@@ -233,9 +275,11 @@ const int8_t STDLIB_NDARRAY_SAFE_CASTS_UINT8[ STDLIB_NDARRAY_NDTYPES ] = {
233
275
  [ STDLIB_NDARRAY_INT64 ] = 1,
234
276
  [ STDLIB_NDARRAY_UINT64 ] = 1,
235
277
 
278
+ [ STDLIB_NDARRAY_FLOAT16 ] = 1,
236
279
  [ STDLIB_NDARRAY_FLOAT32 ] = 1,
237
280
  [ STDLIB_NDARRAY_FLOAT64 ] = 1,
238
281
 
282
+ [ STDLIB_NDARRAY_COMPLEX32 ] = 1,
239
283
  [ STDLIB_NDARRAY_COMPLEX64 ] = 1,
240
284
  [ STDLIB_NDARRAY_COMPLEX128 ] = 1,
241
285
 
@@ -257,9 +301,11 @@ const int8_t STDLIB_NDARRAY_SAFE_CASTS_UINT8C[ STDLIB_NDARRAY_NDTYPES ] = {
257
301
  [ STDLIB_NDARRAY_INT64 ] = 1,
258
302
  [ STDLIB_NDARRAY_UINT64 ] = 1,
259
303
 
304
+ [ STDLIB_NDARRAY_FLOAT16 ] = 1,
260
305
  [ STDLIB_NDARRAY_FLOAT32 ] = 1,
261
306
  [ STDLIB_NDARRAY_FLOAT64 ] = 1,
262
307
 
308
+ [ STDLIB_NDARRAY_COMPLEX32 ] = 1,
263
309
  [ STDLIB_NDARRAY_COMPLEX64 ] = 1,
264
310
  [ STDLIB_NDARRAY_COMPLEX128 ] = 1,
265
311
 
@@ -281,9 +327,11 @@ const int8_t STDLIB_NDARRAY_SAFE_CASTS_INT8[ STDLIB_NDARRAY_NDTYPES ] = {
281
327
  [ STDLIB_NDARRAY_INT64 ] = 1,
282
328
  [ STDLIB_NDARRAY_UINT64 ] = 0,
283
329
 
330
+ [ STDLIB_NDARRAY_FLOAT16 ] = 1,
284
331
  [ STDLIB_NDARRAY_FLOAT32 ] = 1,
285
332
  [ STDLIB_NDARRAY_FLOAT64 ] = 1,
286
333
 
334
+ [ STDLIB_NDARRAY_COMPLEX32 ] = 1,
287
335
  [ STDLIB_NDARRAY_COMPLEX64 ] = 1,
288
336
  [ STDLIB_NDARRAY_COMPLEX128 ] = 1,
289
337
 
@@ -305,9 +353,11 @@ const int8_t STDLIB_NDARRAY_SAFE_CASTS_COMPLEX128[ STDLIB_NDARRAY_NDTYPES ] = {
305
353
  [ STDLIB_NDARRAY_INT64 ] = 0,
306
354
  [ STDLIB_NDARRAY_UINT64 ] = 0,
307
355
 
356
+ [ STDLIB_NDARRAY_FLOAT16 ] = 0,
308
357
  [ STDLIB_NDARRAY_FLOAT32 ] = 0,
309
358
  [ STDLIB_NDARRAY_FLOAT64 ] = 0,
310
359
 
360
+ [ STDLIB_NDARRAY_COMPLEX32 ] = 0,
311
361
  [ STDLIB_NDARRAY_COMPLEX64 ] = 0,
312
362
  [ STDLIB_NDARRAY_COMPLEX128 ] = 1,
313
363
 
@@ -329,9 +379,37 @@ const int8_t STDLIB_NDARRAY_SAFE_CASTS_COMPLEX64[ STDLIB_NDARRAY_NDTYPES ] = {
329
379
  [ STDLIB_NDARRAY_INT64 ] = 0,
330
380
  [ STDLIB_NDARRAY_UINT64 ] = 0,
331
381
 
382
+ [ STDLIB_NDARRAY_FLOAT16 ] = 0,
383
+ [ STDLIB_NDARRAY_FLOAT32 ] = 0,
384
+ [ STDLIB_NDARRAY_FLOAT64 ] = 0,
385
+
386
+ [ STDLIB_NDARRAY_COMPLEX32 ] = 0,
387
+ [ STDLIB_NDARRAY_COMPLEX64 ] = 1,
388
+ [ STDLIB_NDARRAY_COMPLEX128 ] = 1,
389
+
390
+ [ STDLIB_NDARRAY_BOOL ] = 0,
391
+
392
+ [ STDLIB_NDARRAY_BINARY ] = 0,
393
+ [ STDLIB_NDARRAY_GENERIC ] = 0
394
+ };
395
+
396
+ const int8_t STDLIB_NDARRAY_SAFE_CASTS_COMPLEX32[ STDLIB_NDARRAY_NDTYPES ] = {
397
+
398
+ [ STDLIB_NDARRAY_INT8 ] = 0,
399
+ [ STDLIB_NDARRAY_UINT8 ] = 0,
400
+ [ STDLIB_NDARRAY_UINT8C ] = 0,
401
+ [ STDLIB_NDARRAY_INT16 ] = 0,
402
+ [ STDLIB_NDARRAY_UINT16 ] = 0,
403
+ [ STDLIB_NDARRAY_INT32 ] = 0,
404
+ [ STDLIB_NDARRAY_UINT32 ] = 0,
405
+ [ STDLIB_NDARRAY_INT64 ] = 0,
406
+ [ STDLIB_NDARRAY_UINT64 ] = 0,
407
+
408
+ [ STDLIB_NDARRAY_FLOAT16 ] = 0,
332
409
  [ STDLIB_NDARRAY_FLOAT32 ] = 0,
333
410
  [ STDLIB_NDARRAY_FLOAT64 ] = 0,
334
411
 
412
+ [ STDLIB_NDARRAY_COMPLEX32 ] = 1,
335
413
  [ STDLIB_NDARRAY_COMPLEX64 ] = 1,
336
414
  [ STDLIB_NDARRAY_COMPLEX128 ] = 1,
337
415
 
@@ -353,9 +431,11 @@ const int8_t STDLIB_NDARRAY_SAFE_CASTS_BOOL[ STDLIB_NDARRAY_NDTYPES ] = {
353
431
  [ STDLIB_NDARRAY_INT64 ] = 0,
354
432
  [ STDLIB_NDARRAY_UINT64 ] = 0,
355
433
 
434
+ [ STDLIB_NDARRAY_FLOAT16 ] = 0,
356
435
  [ STDLIB_NDARRAY_FLOAT32 ] = 0,
357
436
  [ STDLIB_NDARRAY_FLOAT64 ] = 0,
358
437
 
438
+ [ STDLIB_NDARRAY_COMPLEX32 ] = 0,
359
439
  [ STDLIB_NDARRAY_COMPLEX64 ] = 0,
360
440
  [ STDLIB_NDARRAY_COMPLEX128 ] = 0,
361
441
 
@@ -377,9 +457,11 @@ const int8_t STDLIB_NDARRAY_SAFE_CASTS_BINARY[ STDLIB_NDARRAY_NDTYPES ] = {
377
457
  [ STDLIB_NDARRAY_INT64 ] = 0,
378
458
  [ STDLIB_NDARRAY_UINT64 ] = 0,
379
459
 
460
+ [ STDLIB_NDARRAY_FLOAT16 ] = 0,
380
461
  [ STDLIB_NDARRAY_FLOAT32 ] = 0,
381
462
  [ STDLIB_NDARRAY_FLOAT64 ] = 0,
382
463
 
464
+ [ STDLIB_NDARRAY_COMPLEX32 ] = 0,
383
465
  [ STDLIB_NDARRAY_COMPLEX64 ] = 0,
384
466
  [ STDLIB_NDARRAY_COMPLEX128 ] = 0,
385
467
 
@@ -401,9 +483,11 @@ const int8_t STDLIB_NDARRAY_SAFE_CASTS_GENERIC[ STDLIB_NDARRAY_NDTYPES ] = {
401
483
  [ STDLIB_NDARRAY_INT64 ] = 0,
402
484
  [ STDLIB_NDARRAY_UINT64 ] = 0,
403
485
 
486
+ [ STDLIB_NDARRAY_FLOAT16 ] = 0,
404
487
  [ STDLIB_NDARRAY_FLOAT32 ] = 0,
405
488
  [ STDLIB_NDARRAY_FLOAT64 ] = 0,
406
489
 
490
+ [ STDLIB_NDARRAY_COMPLEX32 ] = 0,
407
491
  [ STDLIB_NDARRAY_COMPLEX64 ] = 0,
408
492
  [ STDLIB_NDARRAY_COMPLEX128 ] = 0,
409
493
 
@@ -426,9 +510,11 @@ const int8_t *STDLIB_NDARRAY_SAFE_CASTS[ STDLIB_NDARRAY_NDTYPES ] = {
426
510
  [ STDLIB_NDARRAY_INT64 ] = STDLIB_NDARRAY_SAFE_CASTS_INT64,
427
511
  [ STDLIB_NDARRAY_UINT64 ] = STDLIB_NDARRAY_SAFE_CASTS_UINT64,
428
512
 
513
+ [ STDLIB_NDARRAY_FLOAT16 ] = STDLIB_NDARRAY_SAFE_CASTS_FLOAT16,
429
514
  [ STDLIB_NDARRAY_FLOAT32 ] = STDLIB_NDARRAY_SAFE_CASTS_FLOAT32,
430
515
  [ STDLIB_NDARRAY_FLOAT64 ] = STDLIB_NDARRAY_SAFE_CASTS_FLOAT64,
431
516
 
517
+ [ STDLIB_NDARRAY_COMPLEX32 ] = STDLIB_NDARRAY_SAFE_CASTS_COMPLEX32,
432
518
  [ STDLIB_NDARRAY_COMPLEX64 ] = STDLIB_NDARRAY_SAFE_CASTS_COMPLEX64,
433
519
  [ STDLIB_NDARRAY_COMPLEX128 ] = STDLIB_NDARRAY_SAFE_CASTS_COMPLEX128,
434
520
 
@@ -1,226 +1,362 @@
1
1
  {
2
- "float64": {
3
- "float64": 1,
4
- "float32": 0,
5
- "int32": 0,
6
- "int16": 0,
7
- "int8": 0,
8
- "uint32": 0,
9
- "uint16": 0,
10
- "uint8": 0,
11
- "uint8c": 0,
12
- "complex128": 1,
13
- "complex64": 0,
14
- "binary": 0,
15
- "generic": 1,
16
- "bool": 0
17
- },
18
- "float32": {
19
- "float64": 1,
20
- "float32": 1,
21
- "int32": 0,
22
- "int16": 0,
23
- "int8": 0,
24
- "uint32": 0,
25
- "uint16": 0,
26
- "uint8": 0,
27
- "uint8c": 0,
28
- "complex128": 1,
29
- "complex64": 1,
30
- "binary": 0,
31
- "generic": 1,
32
- "bool": 0
33
- },
34
- "int32": {
35
- "float64": 1,
36
- "float32": 0,
37
- "int32": 1,
38
- "int16": 0,
39
- "int8": 0,
40
- "uint32": 0,
41
- "uint16": 0,
42
- "uint8": 0,
43
- "uint8c": 0,
44
- "complex128": 1,
45
- "complex64": 0,
46
- "binary": 0,
47
- "generic": 1,
48
- "bool": 0
49
- },
50
- "int16": {
51
- "float64": 1,
52
- "float32": 1,
53
- "int32": 1,
54
- "int16": 1,
55
- "int8": 0,
56
- "uint32": 0,
57
- "uint16": 0,
58
- "uint8": 0,
59
- "uint8c": 0,
60
- "complex128": 1,
61
- "complex64": 1,
62
- "binary": 0,
63
- "generic": 1,
64
- "bool": 0
65
- },
66
- "int8": {
67
- "float64": 1,
68
- "float32": 1,
69
- "int32": 1,
70
- "int16": 1,
71
- "int8": 1,
72
- "uint32": 0,
73
- "uint16": 0,
74
- "uint8": 0,
75
- "uint8c": 0,
76
- "complex128": 1,
77
- "complex64": 1,
78
- "binary": 0,
79
- "generic": 1,
80
- "bool": 0
81
- },
82
- "uint32": {
83
- "float64": 1,
84
- "float32": 0,
85
- "int32": 0,
86
- "int16": 0,
87
- "int8": 0,
88
- "uint32": 1,
89
- "uint16": 0,
90
- "uint8": 0,
91
- "uint8c": 0,
92
- "complex128": 1,
93
- "complex64": 0,
94
- "binary": 0,
95
- "generic": 1,
96
- "bool": 0
97
- },
98
- "uint16": {
99
- "float64": 1,
100
- "float32": 1,
101
- "int32": 1,
102
- "int16": 0,
103
- "int8": 0,
104
- "uint32": 1,
105
- "uint16": 1,
106
- "uint8": 0,
107
- "uint8c": 0,
108
- "complex128": 1,
109
- "complex64": 1,
110
- "binary": 0,
111
- "generic": 1,
112
- "bool": 0
113
- },
114
- "uint8": {
115
- "float64": 1,
116
- "float32": 1,
117
- "int32": 1,
118
- "int16": 1,
119
- "int8": 0,
120
- "uint32": 1,
121
- "uint16": 1,
122
- "uint8": 1,
123
- "uint8c": 1,
124
- "complex128": 1,
125
- "complex64": 1,
126
- "binary": 0,
127
- "generic": 1,
128
- "bool": 0
129
- },
130
- "uint8c": {
131
- "float64": 1,
132
- "float32": 1,
133
- "int32": 1,
134
- "int16": 1,
135
- "int8": 0,
136
- "uint32": 1,
137
- "uint16": 1,
138
- "uint8": 1,
139
- "uint8c": 1,
140
- "complex128": 1,
141
- "complex64": 1,
142
- "binary": 0,
143
- "generic": 1,
144
- "bool": 0
145
- },
146
- "complex128": {
147
- "float64": 0,
148
- "float32": 0,
149
- "int32": 0,
150
- "int16": 0,
151
- "int8": 0,
152
- "uint32": 0,
153
- "uint16": 0,
154
- "uint8": 0,
155
- "uint8c": 0,
156
- "complex128": 1,
157
- "complex64": 0,
158
- "binary": 0,
159
- "generic": 1,
160
- "bool": 0
161
- },
162
- "complex64": {
163
- "float64": 0,
164
- "float32": 0,
165
- "int32": 0,
166
- "int16": 0,
167
- "int8": 0,
168
- "uint32": 0,
169
- "uint16": 0,
170
- "uint8": 0,
171
- "uint8c": 0,
172
- "complex128": 1,
173
- "complex64": 1,
174
- "binary": 0,
175
- "generic": 1,
176
- "bool": 0
177
- },
178
- "generic": {
179
- "float64": 0,
180
- "float32": 0,
181
- "int32": 0,
182
- "int16": 0,
183
- "int8": 0,
184
- "uint32": 0,
185
- "uint16": 0,
186
- "uint8": 0,
187
- "uint8c": 0,
188
- "complex128": 0,
189
- "complex64": 0,
190
- "binary": 0,
191
- "generic": 1,
192
- "bool": 0
193
- },
194
- "binary": {
195
- "float64": 0,
196
- "float32": 0,
197
- "int32": 0,
198
- "int16": 0,
199
- "int8": 0,
200
- "uint32": 0,
201
- "uint16": 0,
202
- "uint8": 0,
203
- "uint8c": 0,
204
- "complex128": 0,
205
- "complex64": 0,
206
- "binary": 1,
207
- "generic": 0,
208
- "bool": 0
209
- },
210
- "bool": {
211
- "float64": 0,
212
- "float32": 0,
213
- "int32": 0,
214
- "int16": 0,
215
- "int8": 0,
216
- "uint32": 0,
217
- "uint16": 0,
218
- "uint8": 0,
219
- "uint8c": 0,
220
- "complex128": 0,
221
- "complex64": 0,
222
- "binary": 0,
223
- "generic": 1,
224
- "bool": 1
225
- }
2
+ "float64": {
3
+ "float64": 1,
4
+ "float32": 0,
5
+ "float16": 0,
6
+ "int64": 0,
7
+ "int32": 0,
8
+ "int16": 0,
9
+ "int8": 0,
10
+ "uint64": 0,
11
+ "uint32": 0,
12
+ "uint16": 0,
13
+ "uint8": 0,
14
+ "uint8c": 0,
15
+ "complex128": 1,
16
+ "complex64": 0,
17
+ "complex32": 0,
18
+ "binary": 0,
19
+ "generic": 1,
20
+ "bool": 0
21
+ },
22
+ "float32": {
23
+ "float64": 1,
24
+ "float32": 1,
25
+ "float16": 0,
26
+ "int64": 0,
27
+ "int32": 0,
28
+ "int16": 0,
29
+ "int8": 0,
30
+ "uint64": 0,
31
+ "uint32": 0,
32
+ "uint16": 0,
33
+ "uint8": 0,
34
+ "uint8c": 0,
35
+ "complex128": 1,
36
+ "complex64": 1,
37
+ "complex32": 0,
38
+ "binary": 0,
39
+ "generic": 1,
40
+ "bool": 0
41
+ },
42
+ "float16": {
43
+ "float64": 1,
44
+ "float32": 1,
45
+ "float16": 1,
46
+ "int64": 0,
47
+ "int32": 0,
48
+ "int16": 0,
49
+ "int8": 0,
50
+ "uint64": 0,
51
+ "uint32": 0,
52
+ "uint16": 0,
53
+ "uint8": 0,
54
+ "uint8c": 0,
55
+ "complex128": 1,
56
+ "complex64": 1,
57
+ "complex32": 1,
58
+ "binary": 0,
59
+ "generic": 1,
60
+ "bool": 0
61
+ },
62
+ "int64": {
63
+ "float64": 0,
64
+ "float32": 0,
65
+ "float16": 0,
66
+ "int64": 1,
67
+ "int32": 0,
68
+ "int16": 0,
69
+ "int8": 0,
70
+ "uint64": 0,
71
+ "uint32": 0,
72
+ "uint16": 0,
73
+ "uint8": 0,
74
+ "uint8c": 0,
75
+ "complex128": 0,
76
+ "complex64": 0,
77
+ "complex32": 0,
78
+ "binary": 0,
79
+ "generic": 1,
80
+ "bool": 0
81
+ },
82
+ "int32": {
83
+ "float64": 1,
84
+ "float32": 0,
85
+ "float16": 0,
86
+ "int64": 1,
87
+ "int32": 1,
88
+ "int16": 0,
89
+ "int8": 0,
90
+ "uint64": 0,
91
+ "uint32": 0,
92
+ "uint16": 0,
93
+ "uint8": 0,
94
+ "uint8c": 0,
95
+ "complex128": 1,
96
+ "complex64": 0,
97
+ "complex32": 0,
98
+ "binary": 0,
99
+ "generic": 1,
100
+ "bool": 0
101
+ },
102
+ "int16": {
103
+ "float64": 1,
104
+ "float32": 1,
105
+ "float16": 0,
106
+ "int64": 1,
107
+ "int32": 1,
108
+ "int16": 1,
109
+ "int8": 0,
110
+ "uint64": 0,
111
+ "uint32": 0,
112
+ "uint16": 0,
113
+ "uint8": 0,
114
+ "uint8c": 0,
115
+ "complex128": 1,
116
+ "complex64": 1,
117
+ "complex32": 0,
118
+ "binary": 0,
119
+ "generic": 1,
120
+ "bool": 0
121
+ },
122
+ "int8": {
123
+ "float64": 1,
124
+ "float32": 1,
125
+ "float16": 1,
126
+ "int64": 1,
127
+ "int32": 1,
128
+ "int16": 1,
129
+ "int8": 1,
130
+ "uint64": 0,
131
+ "uint32": 0,
132
+ "uint16": 0,
133
+ "uint8": 0,
134
+ "uint8c": 0,
135
+ "complex128": 1,
136
+ "complex64": 1,
137
+ "complex32": 1,
138
+ "binary": 0,
139
+ "generic": 1,
140
+ "bool": 0
141
+ },
142
+ "uint64": {
143
+ "float64": 0,
144
+ "float32": 0,
145
+ "float16": 0,
146
+ "int64": 0,
147
+ "int32": 0,
148
+ "int16": 0,
149
+ "int8": 0,
150
+ "uint64": 1,
151
+ "uint32": 0,
152
+ "uint16": 0,
153
+ "uint8": 0,
154
+ "uint8c": 0,
155
+ "complex128": 0,
156
+ "complex64": 0,
157
+ "complex32": 0,
158
+ "binary": 0,
159
+ "generic": 1,
160
+ "bool": 0
161
+ },
162
+ "uint32": {
163
+ "float64": 1,
164
+ "float32": 0,
165
+ "float16": 0,
166
+ "int64": 1,
167
+ "int32": 0,
168
+ "int16": 0,
169
+ "int8": 0,
170
+ "uint64": 1,
171
+ "uint32": 1,
172
+ "uint16": 0,
173
+ "uint8": 0,
174
+ "uint8c": 0,
175
+ "complex128": 1,
176
+ "complex64": 0,
177
+ "complex32": 0,
178
+ "binary": 0,
179
+ "generic": 1,
180
+ "bool": 0
181
+ },
182
+ "uint16": {
183
+ "float64": 1,
184
+ "float32": 1,
185
+ "float16": 0,
186
+ "int64": 1,
187
+ "int32": 1,
188
+ "int16": 0,
189
+ "int8": 0,
190
+ "uint64": 1,
191
+ "uint32": 1,
192
+ "uint16": 1,
193
+ "uint8": 0,
194
+ "uint8c": 0,
195
+ "complex128": 1,
196
+ "complex64": 1,
197
+ "complex32": 0,
198
+ "binary": 0,
199
+ "generic": 1,
200
+ "bool": 0
201
+ },
202
+ "uint8": {
203
+ "float64": 1,
204
+ "float32": 1,
205
+ "float16": 1,
206
+ "int64": 1,
207
+ "int32": 1,
208
+ "int16": 1,
209
+ "int8": 0,
210
+ "uint64": 1,
211
+ "uint32": 1,
212
+ "uint16": 1,
213
+ "uint8": 1,
214
+ "uint8c": 1,
215
+ "complex128": 1,
216
+ "complex64": 1,
217
+ "complex32": 1,
218
+ "binary": 0,
219
+ "generic": 1,
220
+ "bool": 0
221
+ },
222
+ "uint8c": {
223
+ "float64": 1,
224
+ "float32": 1,
225
+ "float16": 1,
226
+ "int64": 1,
227
+ "int32": 1,
228
+ "int16": 1,
229
+ "int8": 0,
230
+ "uint64": 1,
231
+ "uint32": 1,
232
+ "uint16": 1,
233
+ "uint8": 1,
234
+ "uint8c": 1,
235
+ "complex128": 1,
236
+ "complex64": 1,
237
+ "complex32": 1,
238
+ "binary": 0,
239
+ "generic": 1,
240
+ "bool": 0
241
+ },
242
+ "complex128": {
243
+ "float64": 0,
244
+ "float32": 0,
245
+ "float16": 0,
246
+ "int64": 0,
247
+ "int32": 0,
248
+ "int16": 0,
249
+ "int8": 0,
250
+ "uint64": 0,
251
+ "uint32": 0,
252
+ "uint16": 0,
253
+ "uint8": 0,
254
+ "uint8c": 0,
255
+ "complex128": 1,
256
+ "complex64": 0,
257
+ "complex32": 0,
258
+ "binary": 0,
259
+ "generic": 1,
260
+ "bool": 0
261
+ },
262
+ "complex64": {
263
+ "float64": 0,
264
+ "float32": 0,
265
+ "float16": 0,
266
+ "int64": 0,
267
+ "int32": 0,
268
+ "int16": 0,
269
+ "int8": 0,
270
+ "uint64": 0,
271
+ "uint32": 0,
272
+ "uint16": 0,
273
+ "uint8": 0,
274
+ "uint8c": 0,
275
+ "complex128": 1,
276
+ "complex64": 1,
277
+ "complex32": 0,
278
+ "binary": 0,
279
+ "generic": 1,
280
+ "bool": 0
281
+ },
282
+ "complex32": {
283
+ "float64": 0,
284
+ "float32": 0,
285
+ "float16": 0,
286
+ "int64": 0,
287
+ "int32": 0,
288
+ "int16": 0,
289
+ "int8": 0,
290
+ "uint64": 0,
291
+ "uint32": 0,
292
+ "uint16": 0,
293
+ "uint8": 0,
294
+ "uint8c": 0,
295
+ "complex128": 1,
296
+ "complex64": 1,
297
+ "complex32": 1,
298
+ "binary": 0,
299
+ "generic": 1,
300
+ "bool": 0
301
+ },
302
+ "generic": {
303
+ "float64": 0,
304
+ "float32": 0,
305
+ "float16": 0,
306
+ "int64": 0,
307
+ "int32": 0,
308
+ "int16": 0,
309
+ "int8": 0,
310
+ "uint64": 0,
311
+ "uint32": 0,
312
+ "uint16": 0,
313
+ "uint8": 0,
314
+ "uint8c": 0,
315
+ "complex128": 0,
316
+ "complex64": 0,
317
+ "complex32": 0,
318
+ "binary": 0,
319
+ "generic": 1,
320
+ "bool": 0
321
+ },
322
+ "binary": {
323
+ "float64": 0,
324
+ "float32": 0,
325
+ "float16": 0,
326
+ "int64": 0,
327
+ "int32": 0,
328
+ "int16": 0,
329
+ "int8": 0,
330
+ "uint64": 0,
331
+ "uint32": 0,
332
+ "uint16": 0,
333
+ "uint8": 0,
334
+ "uint8c": 0,
335
+ "complex128": 0,
336
+ "complex64": 0,
337
+ "complex32": 0,
338
+ "binary": 1,
339
+ "generic": 0,
340
+ "bool": 0
341
+ },
342
+ "bool": {
343
+ "float64": 0,
344
+ "float32": 0,
345
+ "float16": 0,
346
+ "int64": 0,
347
+ "int32": 0,
348
+ "int16": 0,
349
+ "int8": 0,
350
+ "uint64": 0,
351
+ "uint32": 0,
352
+ "uint16": 0,
353
+ "uint8": 0,
354
+ "uint8c": 0,
355
+ "complex128": 0,
356
+ "complex64": 0,
357
+ "complex32": 0,
358
+ "binary": 0,
359
+ "generic": 1,
360
+ "bool": 1
361
+ }
226
362
  }
package/manifest.json CHANGED
@@ -1,38 +1,38 @@
1
1
  {
2
- "options": {},
3
- "fields": [
4
- {
5
- "field": "src",
6
- "resolve": true,
7
- "relative": true
8
- },
9
- {
10
- "field": "include",
11
- "resolve": true,
12
- "relative": true
13
- },
14
- {
15
- "field": "libraries",
16
- "resolve": false,
17
- "relative": false
18
- },
19
- {
20
- "field": "libpath",
21
- "resolve": true,
22
- "relative": false
23
- }
24
- ],
25
- "confs": [
26
- {
27
- "src": [],
28
- "include": [
29
- "./include"
30
- ],
31
- "libraries": [],
32
- "libpath": [],
33
- "dependencies": [
34
- "@stdlib/ndarray-dtypes"
35
- ]
36
- }
37
- ]
2
+ "options": {},
3
+ "fields": [
4
+ {
5
+ "field": "src",
6
+ "resolve": true,
7
+ "relative": true
8
+ },
9
+ {
10
+ "field": "include",
11
+ "resolve": true,
12
+ "relative": true
13
+ },
14
+ {
15
+ "field": "libraries",
16
+ "resolve": false,
17
+ "relative": false
18
+ },
19
+ {
20
+ "field": "libpath",
21
+ "resolve": true,
22
+ "relative": false
23
+ }
24
+ ],
25
+ "confs": [
26
+ {
27
+ "src": [],
28
+ "include": [
29
+ "./include"
30
+ ],
31
+ "libraries": [],
32
+ "libpath": [],
33
+ "dependencies": [
34
+ "@stdlib/ndarray-dtypes"
35
+ ]
36
+ }
37
+ ]
38
38
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stdlib/ndarray-safe-casts",
3
- "version": "0.3.0",
3
+ "version": "0.4.1",
4
4
  "description": "Return a list of ndarray data types to which a provided ndarray data type can be safely cast.",
5
5
  "license": "Apache-2.0",
6
6
  "author": {
@@ -31,10 +31,10 @@
31
31
  "url": "https://github.com/stdlib-js/stdlib/issues"
32
32
  },
33
33
  "dependencies": {
34
- "@stdlib/assert-has-own-property": "^0.2.2",
35
- "@stdlib/ndarray-base-dtype-resolve-str": "^0.2.1",
36
- "@stdlib/ndarray-dtypes": "^0.2.1",
37
- "@stdlib/utils-keys": "^0.2.2"
34
+ "@stdlib/assert-has-own-property": "^0.2.3",
35
+ "@stdlib/ndarray-base-dtype-resolve-str": "^0.3.1",
36
+ "@stdlib/ndarray-dtypes": "^0.4.0",
37
+ "@stdlib/utils-keys": "^0.2.3"
38
38
  },
39
39
  "devDependencies": {},
40
40
  "engines": {
@@ -66,7 +66,6 @@
66
66
  "utils",
67
67
  "util"
68
68
  ],
69
- "__stdlib__": {},
70
69
  "funding": {
71
70
  "type": "opencollective",
72
71
  "url": "https://opencollective.com/stdlib"