rittenhop-dev/versions/5.94.2/node_modules/@stdlib/assert-is-error/dist/index.js.map

8 lines
3.2 KiB
Plaintext
Raw Normal View History

2024-09-23 19:40:12 -04:00
{
"version": 3,
"sources": ["../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// MODULES //\n\nvar getPrototypeOf = require( '@stdlib/utils-get-prototype-of' );\nvar nativeClass = require( '@stdlib/utils-native-class' );\n\n\n// MAIN //\n\n/**\n* Tests if a value is an `Error` object.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether a value is an `Error` object\n*\n* @example\n* var bool = isError( new Error( 'beep' ) );\n* // returns true\n*\n* @example\n* var bool = isError( {} );\n* // returns false\n*/\nfunction isError( value ) {\n\tif ( typeof value !== 'object' || value === null ) {\n\t\treturn false;\n\t}\n\t// Check for `Error` objects from the same realm (same Node.js `vm` or same `Window` object)...\n\tif ( value instanceof Error ) {\n\t\treturn true;\n\t}\n\t// Walk the prototype tree until we find an object having the desired native class...\n\twhile ( value ) {\n\t\tif ( nativeClass( value ) === '[object Error]' ) {\n\t\t\treturn true;\n\t\t}\n\t\tvalue = getPrototypeOf( value );\n\t}\n\treturn false;\n}\n\n\n// EXPORTS //\n\nmodule.exports = isError;\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 if a value is an `Error` object.\n*\n* @module @stdlib/assert-is-error\n*\n* @example\n* var isError = require( '@stdlib/assert-is-error' );\n*\n* var bool = isError( new Error( 'beep' ) );\n* // returns true\n*\n* bool = isError( {} );\n* // returns false\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,EAAiB,QAAS,gCAAiC,EAC3DC,EAAc,QAAS,4BAA6B,EAmBxD,SAASC,EAASC,EAAQ,CACzB,GAAK,OAAOA,GAAU,UAAYA,IAAU,KAC3C,MAAO,GAGR,GAAKA,aAAiB,MACrB,MAAO,GAGR,KAAQA,GAAQ,CACf,GAAKF,EAAaE,CAAM,IAAM,iBAC7B,MAAO,GAERA,EAAQH,EAAgBG,CAAM,CAC/B,CACA,MAAO,EACR,CAKAJ,EAAO,QAAUG,IC1BjB,IAAIE,EAAO,IAKX,OAAO,QAAUA",
"names": ["require_main", "__commonJSMin", "exports", "module", "getPrototypeOf", "nativeClass", "isError", "value", "main"]
}