-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.mjs.map
1 lines (1 loc) · 8.33 KB
/
index.mjs.map
1
{"version":3,"file":"index.mjs","sources":["../lib/main.js","../lib/enum.js","../lib/index.js","../lib/assign.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// MODULES //\n\nimport replace from '@stdlib/string-base-replace';\nimport DTYPES from './dtypes.json';\n\n\n// VARIABLES //\n\nvar RE_SUFFIX = /_and_generic$/;\n\n\n// MAIN //\n\n/**\n* Returns a list of ndarray data types.\n*\n* @param {string} [kind] - data type kind\n* @returns {StringArray} list of ndarray data types\n*\n* @example\n* var list = dtypes();\n* // returns [...]\n*\n* @example\n* var list = dtypes( 'floating_point' );\n* // returns [...]\n*/\nfunction dtypes() {\n\tvar kind;\n\tvar out;\n\tvar FLG;\n\tif ( arguments.length === 0 ) {\n\t\treturn DTYPES.all.slice();\n\t}\n\tFLG = false;\n\tkind = arguments[ 0 ];\n\tif ( RE_SUFFIX.test( kind ) ) {\n\t\tkind = replace( kind, RE_SUFFIX, '' );\n\t\tif ( kind !== 'all' && kind !== 'index' ) {\n\t\t\tFLG = true;\n\t\t}\n\t}\n\tout = DTYPES[ kind ];\n\tout = ( out ) ? out.slice() : [];\n\tif ( FLG && out.length > 0 ) {\n\t\tout.push( 'generic' );\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default dtypes;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 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/* eslint-disable stdlib/empty-line-before-comment */\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns an object mapping supported data type strings to enumeration constants.\n*\n* ## Notes\n*\n* - Downstream consumers of this mapping should **not** rely on specific integer values (e.g., `INT8 == 0`). Instead, the object should be used in an opaque manner.\n* - The main purpose of this function is JavaScript and C inter-operation of ndarray objects. While certain dtypes, such as \"generic\" and \"binary\", have special behavior in JavaScript, they do not have a direct complement in C.\n*\n* @private\n* @returns {Object} object mapping supported dtypes to enumeration constants\n*\n* @example\n* var table = enumeration();\n* // returns <Object>\n*/\nfunction enumeration() {\n\t// NOTE: the following should match the C `dtypes.h` enumeration!!!!\n\treturn {\n\t\t// Boolean data types:\n\t\t'bool': 0,\n\n\t\t// Integer data types:\n\t\t'int8': 1,\n\t\t'uint8': 2,\n\t\t'uint8c': 3,\n\t\t'int16': 4,\n\t\t'uint16': 5,\n\t\t'int32': 6,\n\t\t'uint32': 7,\n\t\t'int64': 8,\n\t\t'uint64': 9,\n\t\t// 'int128': 10, // uncomment once supported\n\t\t// 'uint128': 11,\n\t\t// 'int256': 12,\n\t\t// 'uint256': 13,\n\n\t\t// Floating-point data types:\n\t\t// 'float16': 14,\n\t\t// 'bfloat16': 15,\n\t\t'float32': 10,\n\t\t'float64': 11,\n\t\t// 'float128': 18, // uncomment once supported\n\n\t\t// Complex floating-point number data types:\n\t\t'complex64': 12,\n\t\t'complex128': 13,\n\n\t\t// Data type for \"binary\" data (i.e., data stored in a Node.js `Buffer` object):\n\t\t'binary': 14,\n\n\t\t// Data type for \"generic\" JavaScript values (objects):\n\t\t'generic': 15,\n\n\t\t// Define a signaling value which is guaranteed not to be a valid type enumeration value:\n\t\t'notype': 17,\n\n\t\t// Indicate the start of user defined type numbers (leaving room for type growth above):\n\t\t'userdefined_type': 256\n\t};\n}\n\n\n// EXPORTS //\n\nexport default enumeration;\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.\n*\n* @module @stdlib/ndarray-dtypes\n*\n* @example\n* import dtypes from '@stdlib/ndarray-dtypes';\n*\n* var list = dtypes();\n* // returns [...]\n*/\n\n// MODULES //\n\nimport setReadOnly from '@stdlib/utils-define-nonenumerable-read-only-property';\nimport main from './main.js';\nimport enumeration from './enum.js';\nimport assign from './assign.js';\n\n\n// MAIN //\n\nsetReadOnly( main, 'enum', enumeration );\nassign( main, enumeration() );\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 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\nimport setReadOnly from '@stdlib/utils-define-read-only-property';\nimport objectKeys from '@stdlib/utils-keys';\n\n\n// MAIN //\n\n/**\n* Copies all enumerable own properties from a source object to a target object as enumerable read-only properties.\n*\n* @private\n* @param {Object} target - target object\n* @param {Object} source - source object\n* @returns {Object} modified target object\n*\n* @example\n* var source = {\n* 'beep': 'boop'\n* };\n* var target = {};\n*\n* var out = assign( target, source );\n* // returns <Object>\n*\n* var bool = ( out === target );\n* // returns true\n*\n* var v = target.beep;\n* // returns 'boop'\n*/\nfunction assign( target, source ) {\n\tvar keys;\n\tvar k;\n\tvar i;\n\n\tkeys = objectKeys( source );\n\tfor ( i = 0; i < keys.length; i++ ) {\n\t\tk = keys[ i ];\n\t\tsetReadOnly( target, k, source[ k ] );\n\t}\n\treturn target;\n}\n\n\n// EXPORTS //\n\nexport default assign;\n"],"names":["RE_SUFFIX","dtypes","kind","out","FLG","arguments","length","DTYPES","all","slice","test","replace","push","enumeration","bool","int8","uint8","uint8c","int16","uint16","int32","uint32","int64","uint64","float32","float64","complex64","complex128","binary","generic","notype","userdefined_type","setReadOnly","main","target","source","keys","k","i","objectKeys","assign"],"mappings":";;w0CA4BIA,EAAY,gBAmBhB,SAASC,IACR,IAAIC,EACAC,EACAC,EACJ,OAA0B,IAArBC,UAAUC,OACPC,EAAOC,IAAIC,SAEnBL,GAAM,EACNF,EAAOG,UAAW,GACbL,EAAUU,KAAMR,IAEN,SADdA,EAAOS,EAAST,EAAMF,EAAW,MACD,UAATE,IACtBE,GAAM,GAIRD,GADAA,EAAMI,EAAQL,IACEC,EAAIM,QAAU,GACzBL,GAAOD,EAAIG,OAAS,GACxBH,EAAIS,KAAM,WAEJT,EACR,CC7BA,SAASU,IAER,MAAO,CAENC,KAAQ,EAGRC,KAAQ,EACRC,MAAS,EACTC,OAAU,EACVC,MAAS,EACTC,OAAU,EACVC,MAAS,EACTC,OAAU,EACVC,MAAS,EACTC,OAAU,EASVC,QAAW,GACXC,QAAW,GAIXC,UAAa,GACbC,WAAc,GAGdC,OAAU,GAGVC,QAAW,GAGXC,OAAU,GAGVC,iBAAoB,IAEtB,CCzCAC,EAAAC,EAAA,OAAApB,GCSA,SAAiBqB,EAAQC,GACxB,IAAIC,EACAC,EACAC,EAGJ,IADAF,EAAOG,EAAYJ,GACbG,EAAI,EAAGA,EAAIF,EAAK9B,OAAQgC,IAC7BD,EAAID,EAAME,GACVN,EAAaE,EAAQG,EAAGF,EAAQE,GAGlC,CDnBAG,CAAAP,EDFQ,CAENnB,KAAQ,EAGRC,KAAQ,EACRC,MAAS,EACTC,OAAU,EACVC,MAAS,EACTC,OAAU,EACVC,MAAS,EACTC,OAAU,EACVC,MAAS,EACTC,OAAU,EASVC,QAAW,GACXC,QAAW,GAIXC,UAAa,GACbC,WAAc,GAGdC,OAAU,GAGVC,QAAW,GAGXC,OAAU,GAGVC,iBAAoB"}