rittenhop-dev/versions/5.94.2/node_modules/@stdlib/assert-has-node-buffer-support/dist/index.js.map

8 lines
4.4 KiB
Plaintext
Raw Normal View History

2024-09-23 19:40:12 -04:00
{
"version": 3,
"sources": ["../lib/buffer.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\nvar main = ( typeof Buffer === 'function' ) ? Buffer : null; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nmodule.exports = main;\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 GlobalBuffer = require( './buffer.js' );\n\n\n// MAIN //\n\n/**\n* Tests for native `Buffer` support.\n*\n* @returns {boolean} boolean indicating if an environment has `Buffer` support\n*\n* @example\n* var bool = hasNodeBufferSupport();\n* // returns <boolean>\n*/\nfunction hasNodeBufferSupport() {\n\tvar bool;\n\tvar b;\n\n\tif ( typeof GlobalBuffer !== 'function' ) {\n\t\treturn false;\n\t}\n\t// Test basic support...\n\ttry {\n\t\tif ( typeof GlobalBuffer.from === 'function' ) {\n\t\t\tb = GlobalBuffer.from( [ 1, 2, 3, 4 ] );\n\t\t} else {\n\t\t\tb = new GlobalBuffer( [ 1, 2, 3, 4 ] ); // Note: this is deprecated behavior starting in Node v6 (see https://nodejs.org/api/buffer.html#buffer_new_buffer_array)\n\t\t}\n\t\tbool = (\n\t\t\tisBuffer( b ) &&\n\t\t\tb[ 0 ] === 1 &&\n\t\t\tb[ 1 ] === 2 &&\n\t\t\tb[ 2 ] === 3 &&\n\t\t\tb[ 3 ] === 4\n\t\t);\n\t} catch ( err ) { // eslint-disable-line no-unused-vars\n\t\tbool = false;\n\t}\n\treturn bool;\n}\n\n\n// EXPORTS //\n\nmodule.exports = hasNodeBufferSupport;\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* Test for native `Buffer` support.\n*\n* @module @stdlib/assert-has-node-buffer-support\n*\n* @example\n* var hasNodeBufferSupport = require( '@stdlib/assert-has-node-buffer-support' );\n*\n* var bool = hasNodeBufferSupport();\n* // returns <boolean>\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,cAsBA,IAAIC,EAAS,OAAO,QAAW,WAAe,OAAS,KAKvDD,EAAO,QAAUC,IC3BjB,IAAAC,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAW,QAAS,0BAA2B,EAC/CC,EAAe,IAcnB,SAASC,GAAuB,CAC/B,IAAIC,EACAC,EAEJ,GAAK,OAAOH,GAAiB,WAC5B,MAAO,GAGR,GAAI,CACE,OAAOA,EAAa,MAAS,WACjCG,EAAIH,EAAa,KAAM,CAAE,EAAG,EAAG,EAAG,CAAE,CAAE,EAEtCG,EAAI,IAAIH,EAAc,CAAE,EAAG,EAAG,EAAG,CAAE,CAAE,EAEtCE,EACCH,EAAUI,CAAE,GACZA,EAAG,CAAE,IAAM,GACXA,EAAG,CAAE,IAAM,GACXA,EAAG,CAAE,IAAM,GACXA,EAAG,CAAE,IAAM,CAEb,OAAUC,EAAM,CACfF,EAAO,EACR,CACA,OAAOA,CACR,CAKAJ,EAAO,QAAUG,ICjCjB,IAAII,EAAO,IAKX,OAAO,QAAUA",
"names": ["require_buffer", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isBuffer", "GlobalBuffer", "hasNodeBufferSupport", "bool", "b", "err", "main"]
}