Gazebo_simulation-Frontend/node_modules/.cache/babel-loader/4f635ea83a9f69ba5dbaf7b003a63dd7.json
2020-12-22 09:59:14 -05:00

1 line
4.7 KiB
JSON

{"ast":null,"code":"/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';\n\nvar _slicedToArray = require(\"/home/riddhi/simulation/Gazebo_simulation-Frontend/node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/slicedToArray\");\n\nvar chalk = require('chalk');\n\nvar friendlySyntaxErrorLabel = 'Syntax error:';\n\nfunction isLikelyASyntaxError(message) {\n return message.indexOf(friendlySyntaxErrorLabel) !== -1;\n} // Cleans up webpack error messages.\n// eslint-disable-next-line no-unused-vars\n\n\nfunction formatMessage(message, isError) {\n var lines = message.split('\\n'); // Strip Webpack-added headers off errors/warnings\n // https://github.com/webpack/webpack/blob/master/lib/ModuleError.js\n\n lines = lines.filter(function (line) {\n return !/Module [A-z ]+\\(from/.test(line);\n }); // Transform parsing error into syntax error\n // TODO: move this to our ESLint formatter?\n\n lines = lines.map(function (line) {\n var parsingError = /Line (\\d+):(?:(\\d+):)?\\s*Parsing error: (.+)$/.exec(line);\n\n if (!parsingError) {\n return line;\n }\n\n var _parsingError = _slicedToArray(parsingError, 4),\n errorLine = _parsingError[1],\n errorColumn = _parsingError[2],\n errorMessage = _parsingError[3];\n\n return \"\".concat(friendlySyntaxErrorLabel, \" \").concat(errorMessage, \" (\").concat(errorLine, \":\").concat(errorColumn, \")\");\n });\n message = lines.join('\\n'); // Smoosh syntax errors (commonly found in CSS)\n\n message = message.replace(/SyntaxError\\s+\\((\\d+):(\\d+)\\)\\s*(.+?)\\n/g, \"\".concat(friendlySyntaxErrorLabel, \" $3 ($1:$2)\\n\")); // Remove columns from ESLint formatter output (we added these for more\n // accurate syntax errors)\n\n message = message.replace(/Line (\\d+):\\d+:/g, 'Line $1:'); // Clean up export errors\n\n message = message.replace(/^.*export '(.+?)' was not found in '(.+?)'.*$/gm, \"Attempted import error: '$1' is not exported from '$2'.\");\n message = message.replace(/^.*export 'default' \\(imported as '(.+?)'\\) was not found in '(.+?)'.*$/gm, \"Attempted import error: '$2' does not contain a default export (imported as '$1').\");\n message = message.replace(/^.*export '(.+?)' \\(imported as '(.+?)'\\) was not found in '(.+?)'.*$/gm, \"Attempted import error: '$1' is not exported from '$3' (imported as '$2').\");\n lines = message.split('\\n'); // Remove leading newline\n\n if (lines.length > 2 && lines[1].trim() === '') {\n lines.splice(1, 1);\n } // Clean up file name\n\n\n lines[0] = lines[0].replace(/^(.*) \\d+:\\d+-\\d+$/, '$1'); // Cleans up verbose \"module not found\" messages for files and packages.\n\n if (lines[1] && lines[1].indexOf('Module not found: ') === 0) {\n lines = [lines[0], lines[1].replace('Error: ', '').replace('Module not found: Cannot find file:', 'Cannot find file:')];\n } // Add helpful message for users trying to use Sass for the first time\n\n\n if (lines[1] && lines[1].match(/Cannot find module.+node-sass/)) {\n lines[1] = 'To import Sass files, you first need to install node-sass.\\n';\n lines[1] += 'Run `npm install node-sass` or `yarn add node-sass` inside your workspace.';\n }\n\n lines[0] = chalk.inverse(lines[0]);\n message = lines.join('\\n'); // Internal stacks are generally useless so we strip them... with the\n // exception of stacks containing `webpack:` because they're normally\n // from user code generated by Webpack. For more information see\n // https://github.com/facebook/create-react-app/pull/1050\n\n message = message.replace(/^\\s*at\\s((?!webpack:).)*:\\d+:\\d+[\\s)]*(\\n|$)/gm, ''); // at ... ...:x:y\n\n message = message.replace(/^\\s*at\\s<anonymous>(\\n|$)/gm, ''); // at <anonymous>\n\n lines = message.split('\\n'); // Remove duplicated newlines\n\n lines = lines.filter(function (line, index, arr) {\n return index === 0 || line.trim() !== '' || line.trim() !== arr[index - 1].trim();\n }); // Reassemble the message\n\n message = lines.join('\\n');\n return message.trim();\n}\n\nfunction formatWebpackMessages(json) {\n var formattedErrors = json.errors.map(function (message) {\n return formatMessage(message, true);\n });\n var formattedWarnings = json.warnings.map(function (message) {\n return formatMessage(message, false);\n });\n var result = {\n errors: formattedErrors,\n warnings: formattedWarnings\n };\n\n if (result.errors.some(isLikelyASyntaxError)) {\n // If there are any syntax errors, show just them.\n result.errors = result.errors.filter(isLikelyASyntaxError);\n }\n\n return result;\n}\n\nmodule.exports = formatWebpackMessages;","map":null,"metadata":{},"sourceType":"script"}