Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@stdlib/array-dtype

Package Overview
Dependencies
Maintainers
4
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@stdlib/array-dtype - npm Package Compare versions

Comparing version
0.2.1
to
0.3.0
+10
-9
dist/index.js

@@ -1,11 +0,12 @@

"use strict";var t=function(e,r){return function(){return r||e((r={exports:{}}).exports,r),r.exports}};var i=t(function(B,a){
var v={Float32Array:"float32",Float64Array:"float64",Array:"generic",Int16Array:"int16",Int32Array:"int32",Int8Array:"int8",Uint16Array:"uint16",Uint32Array:"uint32",Uint8Array:"uint8",Uint8ClampedArray:"uint8c",Complex64Array:"complex64",Complex128Array:"complex128"};a.exports=v
});var u=t(function(b,n){
var c=require('@stdlib/array-float64/dist'),p=require('@stdlib/array-float32/dist'),q=require('@stdlib/array-uint32/dist'),x=require('@stdlib/array-int32/dist'),f=require('@stdlib/array-uint16/dist'),m=require('@stdlib/array-int16/dist'),C=require('@stdlib/array-uint8/dist'),U=require('@stdlib/array-uint8c/dist'),I=require('@stdlib/array-int8/dist'),d=require('@stdlib/array-complex64/dist'),S=require('@stdlib/array-complex128/dist'),T=[c,p,x,q,m,f,I,C,U,d,S];n.exports=T
});var y=t(function(j,o){
var F=["float64","float32","int32","uint32","int16","uint16","int8","uint8","uint8c","complex64","complex128"];o.exports=F
});var s=t(function(k,l){
var g=require('@stdlib/assert-is-buffer/dist'),E=require('@stdlib/assert-is-array/dist'),P=require('@stdlib/utils-constructor-name/dist'),Y=i(),D=u(),A=y(),N=A.length;function O(e){var r;if(E(e))return"generic";if(g(e))return null;for(r=0;r<N;r++)if(e instanceof D[r])return A[r];return Y[P(e)]||null}l.exports=O
});var R=s();module.exports=R;
"use strict";var t=function(e,r){return function(){return r||e((r={exports:{}}).exports,r),r.exports}};var i=t(function(h,a){
var s={Float32Array:"float32",Float64Array:"float64",Array:"generic",Int16Array:"int16",Int32Array:"int32",Int8Array:"int8",Uint16Array:"uint16",Uint32Array:"uint32",Uint8Array:"uint8",Uint8ClampedArray:"uint8c",Complex64Array:"complex64",Complex128Array:"complex128",BooleanArray:"bool"};a.exports=s
});var u=t(function(j,n){
var c=require('@stdlib/array-float64/dist'),q=require('@stdlib/array-float32/dist'),p=require('@stdlib/array-uint32/dist'),x=require('@stdlib/array-int32/dist'),f=require('@stdlib/array-uint16/dist'),m=require('@stdlib/array-int16/dist'),C=require('@stdlib/array-uint8/dist'),U=require('@stdlib/array-uint8c/dist'),I=require('@stdlib/array-int8/dist'),d=require('@stdlib/array-complex64/dist'),S=require('@stdlib/array-complex128/dist'),T=require('@stdlib/array-bool/dist'),F=[c,q,x,p,m,f,I,C,U,d,S,T];n.exports=F
});var y=t(function(k,o){
var g=["float64","float32","int32","uint32","int16","uint16","int8","uint8","uint8c","complex64","complex128","bool"];o.exports=g
});var v=t(function(w,l){
var B=require('@stdlib/assert-is-buffer/dist'),E=require('@stdlib/assert-is-array/dist'),P=require('@stdlib/utils-constructor-name/dist'),Y=i(),b=u(),A=y(),D=A.length;function N(e){var r;if(E(e))return"generic";if(B(e))return null;for(r=0;r<D;r++)if(e instanceof b[r])return A[r];return Y[P(e)]||null}l.exports=N
});var O=v();module.exports=O;
/** @license Apache-2.0 */
/** @license Apache-2.0 */
//# sourceMappingURL=index.js.map
{
"version": 3,
"sources": ["../lib/ctor2dtype.js", "../lib/ctors.js", "../lib/dtypes.js", "../lib/main.js", "../lib/index.js"],
"sourcesContent": ["/**\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// MAIN //\n\n// Mapping from array constructors to data types...\nvar ctor2dtypes = {\n\t'Float32Array': 'float32',\n\t'Float64Array': 'float64',\n\t'Array': 'generic',\n\t'Int16Array': 'int16',\n\t'Int32Array': 'int32',\n\t'Int8Array': 'int8',\n\t'Uint16Array': 'uint16',\n\t'Uint32Array': 'uint32',\n\t'Uint8Array': 'uint8',\n\t'Uint8ClampedArray': 'uint8c',\n\t'Complex64Array': 'complex64',\n\t'Complex128Array': 'complex128'\n};\n\n\n// EXPORTS //\n\nmodule.exports = ctor2dtypes;\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 Float64Array = require( '@stdlib/array-float64' );\nvar Float32Array = require( '@stdlib/array-float32' );\nvar Uint32Array = require( '@stdlib/array-uint32' );\nvar Int32Array = require( '@stdlib/array-int32' );\nvar Uint16Array = require( '@stdlib/array-uint16' );\nvar Int16Array = require( '@stdlib/array-int16' );\nvar Uint8Array = require( '@stdlib/array-uint8' );\nvar Uint8ClampedArray = require( '@stdlib/array-uint8c' );\nvar Int8Array = require( '@stdlib/array-int8' );\nvar Complex64Array = require( '@stdlib/array-complex64' );\nvar Complex128Array = require( '@stdlib/array-complex128' );\n\n\n// MAIN //\n\n// Note: order should match `dtypes` order\nvar CTORS = [\n\tFloat64Array,\n\tFloat32Array,\n\tInt32Array,\n\tUint32Array,\n\tInt16Array,\n\tUint16Array,\n\tInt8Array,\n\tUint8Array,\n\tUint8ClampedArray,\n\tComplex64Array,\n\tComplex128Array\n];\n\n\n// EXPORTS //\n\nmodule.exports = CTORS;\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// MAIN //\n\n// Note: order should match `ctors` order\nvar DTYPES = [\n\t'float64',\n\t'float32',\n\t'int32',\n\t'uint32',\n\t'int16',\n\t'uint16',\n\t'int8',\n\t'uint8',\n\t'uint8c',\n\t'complex64',\n\t'complex128'\n];\n\n\n// EXPORTS //\n\nmodule.exports = DTYPES;\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 isBuffer = require( '@stdlib/assert-is-buffer' );\nvar isArray = require( '@stdlib/assert-is-array' );\nvar constructorName = require( '@stdlib/utils-constructor-name' );\nvar ctor2dtype = require( './ctor2dtype.js' );\nvar CTORS = require( './ctors.js' );\nvar DTYPES = require( './dtypes.js' );\n\n\n// VARIABLES //\n\nvar NTYPES = DTYPES.length;\n\n\n// MAIN //\n\n/**\n* Returns the data type of an array.\n*\n* @param {*} value - input value\n* @returns {(string|null)} data type\n*\n* @example\n* var dt = dtype( [ 1, 2, 3 ] );\n* // returns 'generic'\n*\n* var dt = dtype( 'beep' );\n* // returns null\n*/\nfunction dtype( value ) {\n\tvar i;\n\tif ( isArray( value ) ) {\n\t\treturn 'generic';\n\t}\n\tif ( isBuffer( value ) ) {\n\t\treturn null;\n\t}\n\tfor ( i = 0; i < NTYPES; i++ ) {\n\t\tif ( value instanceof CTORS[ i ] ) {\n\t\t\treturn DTYPES[ i ];\n\t\t}\n\t}\n\t// If the above failed, fall back to a more robust (and significantly slower) means for resolving underlying data types:\n\treturn ctor2dtype[ constructorName( value ) ] || null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dtype;\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 the data type of an array.\n*\n* @module @stdlib/array-dtype\n*\n* @example\n* var Float64Array = require( '@stdlib/array-float64' );\n* var dtype = require( '@stdlib/array-dtype' );\n*\n* var arr = new Float64Array( 10 );\n*\n* var dt = dtype( arr );\n* // returns 'float64'\n*\n* dt = dtype( {} );\n* // returns null\n*\n* dt = dtype( 'beep' );\n* // returns null\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n"],
"mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAuBA,IAAIC,EAAc,CACjB,aAAgB,UAChB,aAAgB,UAChB,MAAS,UACT,WAAc,QACd,WAAc,QACd,UAAa,OACb,YAAe,SACf,YAAe,SACf,WAAc,QACd,kBAAqB,SACrB,eAAkB,YAClB,gBAAmB,YACpB,EAKAD,EAAO,QAAUC,ICzCjB,IAAAC,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAe,QAAS,uBAAwB,EAChDC,EAAe,QAAS,uBAAwB,EAChDC,EAAc,QAAS,sBAAuB,EAC9CC,EAAa,QAAS,qBAAsB,EAC5CC,EAAc,QAAS,sBAAuB,EAC9CC,EAAa,QAAS,qBAAsB,EAC5CC,EAAa,QAAS,qBAAsB,EAC5CC,EAAoB,QAAS,sBAAuB,EACpDC,EAAY,QAAS,oBAAqB,EAC1CC,EAAiB,QAAS,yBAA0B,EACpDC,EAAkB,QAAS,0BAA2B,EAMtDC,EAAQ,CACXX,EACAC,EACAE,EACAD,EACAG,EACAD,EACAI,EACAF,EACAC,EACAE,EACAC,CACD,EAKAX,EAAO,QAAUY,ICvDjB,IAAAC,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAuBA,IAAIC,EAAS,CACZ,UACA,UACA,QACA,SACA,QACA,SACA,OACA,QACA,SACA,YACA,YACD,EAKAD,EAAO,QAAUC,ICxCjB,IAAAC,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAW,QAAS,0BAA2B,EAC/CC,EAAU,QAAS,yBAA0B,EAC7CC,EAAkB,QAAS,gCAAiC,EAC5DC,EAAa,IACbC,EAAQ,IACRC,EAAS,IAKTC,EAASD,EAAO,OAkBpB,SAASE,EAAOC,EAAQ,CACvB,IAAIC,EACJ,GAAKR,EAASO,CAAM,EACnB,MAAO,UAER,GAAKR,EAAUQ,CAAM,EACpB,OAAO,KAER,IAAMC,EAAI,EAAGA,EAAIH,EAAQG,IACxB,GAAKD,aAAiBJ,EAAOK,CAAE,EAC9B,OAAOJ,EAAQI,CAAE,EAInB,OAAON,EAAYD,EAAiBM,CAAM,CAAE,GAAK,IAClD,CAKAT,EAAO,QAAUQ,IC3BjB,IAAIG,EAAO,IAKX,OAAO,QAAUA",
"names": ["require_ctor2dtype", "__commonJSMin", "exports", "module", "ctor2dtypes", "require_ctors", "__commonJSMin", "exports", "module", "Float64Array", "Float32Array", "Uint32Array", "Int32Array", "Uint16Array", "Int16Array", "Uint8Array", "Uint8ClampedArray", "Int8Array", "Complex64Array", "Complex128Array", "CTORS", "require_dtypes", "__commonJSMin", "exports", "module", "DTYPES", "require_main", "__commonJSMin", "exports", "module", "isBuffer", "isArray", "constructorName", "ctor2dtype", "CTORS", "DTYPES", "NTYPES", "dtype", "value", "i", "main"]
"sourcesContent": ["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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// MAIN //\n\n// Mapping from array constructors to data types...\nvar ctor2dtypes = {\n\t'Float32Array': 'float32',\n\t'Float64Array': 'float64',\n\t'Array': 'generic',\n\t'Int16Array': 'int16',\n\t'Int32Array': 'int32',\n\t'Int8Array': 'int8',\n\t'Uint16Array': 'uint16',\n\t'Uint32Array': 'uint32',\n\t'Uint8Array': 'uint8',\n\t'Uint8ClampedArray': 'uint8c',\n\t'Complex64Array': 'complex64',\n\t'Complex128Array': 'complex128',\n\t'BooleanArray': 'bool'\n};\n\n\n// EXPORTS //\n\nmodule.exports = ctor2dtypes;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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 Float64Array = require( '@stdlib/array-float64' );\nvar Float32Array = require( '@stdlib/array-float32' );\nvar Uint32Array = require( '@stdlib/array-uint32' );\nvar Int32Array = require( '@stdlib/array-int32' );\nvar Uint16Array = require( '@stdlib/array-uint16' );\nvar Int16Array = require( '@stdlib/array-int16' );\nvar Uint8Array = require( '@stdlib/array-uint8' );\nvar Uint8ClampedArray = require( '@stdlib/array-uint8c' );\nvar Int8Array = require( '@stdlib/array-int8' );\nvar Complex64Array = require( '@stdlib/array-complex64' );\nvar Complex128Array = require( '@stdlib/array-complex128' );\nvar BooleanArray = require( '@stdlib/array-bool' );\n\n\n// MAIN //\n\n// Note: order should match `dtypes` order\nvar CTORS = [\n\tFloat64Array,\n\tFloat32Array,\n\tInt32Array,\n\tUint32Array,\n\tInt16Array,\n\tUint16Array,\n\tInt8Array,\n\tUint8Array,\n\tUint8ClampedArray,\n\tComplex64Array,\n\tComplex128Array,\n\tBooleanArray\n];\n\n\n// EXPORTS //\n\nmodule.exports = CTORS;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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// MAIN //\n\n// Note: order should match `ctors` order\nvar DTYPES = [\n\t'float64',\n\t'float32',\n\t'int32',\n\t'uint32',\n\t'int16',\n\t'uint16',\n\t'int8',\n\t'uint8',\n\t'uint8c',\n\t'complex64',\n\t'complex128',\n\t'bool'\n];\n\n\n// EXPORTS //\n\nmodule.exports = DTYPES;\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 isBuffer = require( '@stdlib/assert-is-buffer' );\nvar isArray = require( '@stdlib/assert-is-array' );\nvar constructorName = require( '@stdlib/utils-constructor-name' );\nvar ctor2dtype = require( './ctor2dtype.js' );\nvar CTORS = require( './ctors.js' );\nvar DTYPES = require( './dtypes.js' );\n\n\n// VARIABLES //\n\nvar NTYPES = DTYPES.length;\n\n\n// MAIN //\n\n/**\n* Returns the data type of an array.\n*\n* @param {*} value - input value\n* @returns {(string|null)} data type\n*\n* @example\n* var dt = dtype( [ 1, 2, 3 ] );\n* // returns 'generic'\n*\n* var dt = dtype( 'beep' );\n* // returns null\n*/\nfunction dtype( value ) {\n\tvar i;\n\tif ( isArray( value ) ) {\n\t\treturn 'generic';\n\t}\n\tif ( isBuffer( value ) ) {\n\t\treturn null;\n\t}\n\tfor ( i = 0; i < NTYPES; i++ ) {\n\t\tif ( value instanceof CTORS[ i ] ) {\n\t\t\treturn DTYPES[ i ];\n\t\t}\n\t}\n\t// If the above failed, fall back to a more robust (and significantly slower) means for resolving underlying data types:\n\treturn ctor2dtype[ constructorName( value ) ] || null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dtype;\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 the data type of an array.\n*\n* @module @stdlib/array-dtype\n*\n* @example\n* var Float64Array = require( '@stdlib/array-float64' );\n* var dtype = require( '@stdlib/array-dtype' );\n*\n* var arr = new Float64Array( 10 );\n*\n* var dt = dtype( arr );\n* // returns 'float64'\n*\n* dt = dtype( {} );\n* // returns null\n*\n* dt = dtype( 'beep' );\n* // returns null\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n"],
"mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAuBA,IAAIC,EAAc,CACjB,aAAgB,UAChB,aAAgB,UAChB,MAAS,UACT,WAAc,QACd,WAAc,QACd,UAAa,OACb,YAAe,SACf,YAAe,SACf,WAAc,QACd,kBAAqB,SACrB,eAAkB,YAClB,gBAAmB,aACnB,aAAgB,MACjB,EAKAD,EAAO,QAAUC,IC1CjB,IAAAC,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAe,QAAS,uBAAwB,EAChDC,EAAe,QAAS,uBAAwB,EAChDC,EAAc,QAAS,sBAAuB,EAC9CC,EAAa,QAAS,qBAAsB,EAC5CC,EAAc,QAAS,sBAAuB,EAC9CC,EAAa,QAAS,qBAAsB,EAC5CC,EAAa,QAAS,qBAAsB,EAC5CC,EAAoB,QAAS,sBAAuB,EACpDC,EAAY,QAAS,oBAAqB,EAC1CC,EAAiB,QAAS,yBAA0B,EACpDC,EAAkB,QAAS,0BAA2B,EACtDC,EAAe,QAAS,oBAAqB,EAM7CC,EAAQ,CACXZ,EACAC,EACAE,EACAD,EACAG,EACAD,EACAI,EACAF,EACAC,EACAE,EACAC,EACAC,CACD,EAKAZ,EAAO,QAAUa,ICzDjB,IAAAC,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAuBA,IAAIC,EAAS,CACZ,UACA,UACA,QACA,SACA,QACA,SACA,OACA,QACA,SACA,YACA,aACA,MACD,EAKAD,EAAO,QAAUC,ICzCjB,IAAAC,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAW,QAAS,0BAA2B,EAC/CC,EAAU,QAAS,yBAA0B,EAC7CC,EAAkB,QAAS,gCAAiC,EAC5DC,EAAa,IACbC,EAAQ,IACRC,EAAS,IAKTC,EAASD,EAAO,OAkBpB,SAASE,EAAOC,EAAQ,CACvB,IAAIC,EACJ,GAAKR,EAASO,CAAM,EACnB,MAAO,UAER,GAAKR,EAAUQ,CAAM,EACpB,OAAO,KAER,IAAMC,EAAI,EAAGA,EAAIH,EAAQG,IACxB,GAAKD,aAAiBJ,EAAOK,CAAE,EAC9B,OAAOJ,EAAQI,CAAE,EAInB,OAAON,EAAYD,EAAiBM,CAAM,CAAE,GAAK,IAClD,CAKAT,EAAO,QAAUQ,IC3BjB,IAAIG,EAAO,IAKX,OAAO,QAAUA",
"names": ["require_ctor2dtype", "__commonJSMin", "exports", "module", "ctor2dtypes", "require_ctors", "__commonJSMin", "exports", "module", "Float64Array", "Float32Array", "Uint32Array", "Int32Array", "Uint16Array", "Int16Array", "Uint8Array", "Uint8ClampedArray", "Int8Array", "Complex64Array", "Complex128Array", "BooleanArray", "CTORS", "require_dtypes", "__commonJSMin", "exports", "module", "DTYPES", "require_main", "__commonJSMin", "exports", "module", "isBuffer", "isArray", "constructorName", "ctor2dtype", "CTORS", "DTYPES", "NTYPES", "dtype", "value", "i", "main"]
}
/*
* @license Apache-2.0
*
* Copyright (c) 2021 The Stdlib Authors.
* Copyright (c) 2024 The Stdlib Authors.
*

@@ -23,3 +23,3 @@ * Licensed under the Apache License, Version 2.0 (the "License");

import { RealOrComplexTypedArray, Complex128Array, Complex64Array, DataType } from '@stdlib/types/array';
import { RealOrComplexTypedArray, Complex128Array, Complex64Array, BooleanArray, DataType } from '@stdlib/types/array';

@@ -89,2 +89,16 @@ /**

* @example
* var BooleanArray = require( '@stdlib/array-bool' );
*
* var dt = dtype( new BooleanArray( [ true, false, true, false ] ) );
* // returns 'bool'
*/
declare function dtype( value: BooleanArray ): 'bool';
/**
* Returns the data type of an array.
*
* @param value - input value
* @returns data type
*
* @example
* var Int32Array = require( '@stdlib/array-int32' );

@@ -91,0 +105,0 @@ *

/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
* Copyright (c) 2024 The Stdlib Authors.
*

@@ -36,3 +36,4 @@ * Licensed under the Apache License, Version 2.0 (the "License");

'Complex64Array': 'complex64',
'Complex128Array': 'complex128'
'Complex128Array': 'complex128',
'BooleanArray': 'bool'
};

@@ -39,0 +40,0 @@

/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
* Copyright (c) 2024 The Stdlib Authors.
*

@@ -34,2 +34,3 @@ * Licensed under the Apache License, Version 2.0 (the "License");

var Complex128Array = require( '@stdlib/array-complex128' );
var BooleanArray = require( '@stdlib/array-bool' );

@@ -51,3 +52,4 @@

Complex64Array,
Complex128Array
Complex128Array,
BooleanArray
];

@@ -54,0 +56,0 @@

/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
* Copyright (c) 2024 The Stdlib Authors.
*

@@ -35,3 +35,4 @@ * Licensed under the Apache License, Version 2.0 (the "License");

'complex64',
'complex128'
'complex128',
'bool'
];

@@ -38,0 +39,0 @@

{
"name": "@stdlib/array-dtype",
"version": "0.2.1",
"version": "0.3.0",
"description": "Return the data type of an array.",

@@ -33,16 +33,17 @@ "license": "Apache-2.0",

"dependencies": {
"@stdlib/array-bool": "^0.0.1",
"@stdlib/array-complex128": "^0.2.1",
"@stdlib/array-complex64": "^0.2.1",
"@stdlib/array-float32": "^0.2.1",
"@stdlib/array-float64": "^0.2.1",
"@stdlib/array-int16": "^0.2.1",
"@stdlib/array-int32": "^0.2.1",
"@stdlib/array-int8": "^0.2.1",
"@stdlib/array-uint16": "^0.2.1",
"@stdlib/array-uint32": "^0.2.1",
"@stdlib/array-uint8": "^0.2.1",
"@stdlib/array-uint8c": "^0.2.1",
"@stdlib/assert-is-array": "^0.2.1",
"@stdlib/assert-is-buffer": "^0.2.1",
"@stdlib/utils-constructor-name": "^0.2.1"
"@stdlib/array-float32": "^0.2.2",
"@stdlib/array-float64": "^0.2.2",
"@stdlib/array-int16": "^0.2.2",
"@stdlib/array-int32": "^0.2.2",
"@stdlib/array-int8": "^0.2.2",
"@stdlib/array-uint16": "^0.2.2",
"@stdlib/array-uint32": "^0.2.2",
"@stdlib/array-uint8": "^0.2.2",
"@stdlib/array-uint8c": "^0.2.2",
"@stdlib/assert-is-array": "^0.2.2",
"@stdlib/assert-is-buffer": "^0.2.2",
"@stdlib/utils-constructor-name": "^0.2.2"
},

@@ -49,0 +50,0 @@ "devDependencies": {},

@@ -199,4 +199,4 @@ <!--

[test-image]: https://github.com/stdlib-js/array-dtype/actions/workflows/test.yml/badge.svg?branch=v0.2.1
[test-url]: https://github.com/stdlib-js/array-dtype/actions/workflows/test.yml?query=branch:v0.2.1
[test-image]: https://github.com/stdlib-js/array-dtype/actions/workflows/test.yml/badge.svg?branch=v0.3.0
[test-url]: https://github.com/stdlib-js/array-dtype/actions/workflows/test.yml?query=branch:v0.3.0

@@ -203,0 +203,0 @@ [coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/array-dtype/main.svg