Second frontend, written in Next.JS + Typescript.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

1 lines
14 KiB

{"ast":null,"code":"\"use strict\";\n/**\nMIT License\nCopyright (c) 2015-present, Facebook, Inc.\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n*/\n// This file is based on https://github.com/facebook/create-react-app/blob/7b1a32be6ec9f99a6c9a3c66813f3ac09c4736b9/packages/react-dev-utils/formatWebpackMessages.js\n// It's been edited to remove chalk and CRA-specific logic\n\nvar _slicedToArray = require(\"@babel/runtime/helpers/slicedToArray\");\n\nvar friendlySyntaxErrorLabel = 'Syntax error:';\n\nfunction isLikelyASyntaxError(message) {\n return message.indexOf(friendlySyntaxErrorLabel) !== -1;\n} // Cleans up webpack error messages.\n\n\nfunction formatMessage(message) {\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 friendlySyntaxErrorLabel + \" \" + errorMessage + \" (\" + errorLine + \":\" + 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, friendlySyntaxErrorLabel + \" $3 ($1:$2)\\n\"); // 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 // ./file.module.scss (<<loader info>>) => ./file.module.scss\n lines[0] = lines[0].replace(/(.+) \\(.+?(?=\\?\\?).+?\\)/, '$1');\n lines[1] = \"To use Next.js' built-in Sass support, you first need to install `sass`.\\n\";\n lines[1] += 'Run `npm i sass` or `yarn add sass` inside your workspace.\\n';\n lines[1] += '\\nLearn more: https://err.sh/next.js/install-sass';\n }\n\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":{"version":3,"sources":["/home/gisle/projects/react/rpdata-frontend2/node_modules/next/dist/client/dev/error-overlay/format-webpack-messages.js"],"names":["friendlySyntaxErrorLabel","isLikelyASyntaxError","message","indexOf","formatMessage","lines","split","filter","line","test","map","parsingError","exec","errorLine","errorColumn","errorMessage","join","replace","length","trim","splice","match","index","arr","formatWebpackMessages","json","formattedErrors","errors","formattedWarnings","warnings","result","some","module","exports"],"mappings":"AAAA;AAAa;;;;;;;;;;;;;;;;;;;AAsBV;AACH;;;;AACA,IAAIA,wBAAwB,GAAC,eAA7B;;AAA6C,SAASC,oBAAT,CAA8BC,OAA9B,EAAsC;AAAC,SAAOA,OAAO,CAACC,OAAR,CAAgBH,wBAAhB,MA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,CAACH,MAAP,CAAcpB,MAAd,CAAqBN,oBAArB,CAAd;AAA0D;;AAAA,SAAO6B,MAAP;AAAe;;AAAAE,MAAM,CAACC,OAAP,GAAeT,qBAAf","sourcesContent":["\"use strict\";/**\nMIT License\n\nCopyright (c) 2015-present, Facebook, Inc.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n*/ // This file is based on https://github.com/facebook/create-react-app/blob/7b1a32be6ec9f99a6c9a3c66813f3ac09c4736b9/packages/react-dev-utils/formatWebpackMessages.js\n// It's been edited to remove chalk and CRA-specific logic\nvar friendlySyntaxErrorLabel='Syntax error:';function isLikelyASyntaxError(message){return message.indexOf(friendlySyntaxErrorLabel)!==-1;}// Cleans up webpack error messages.\nfunction formatMessage(message){var lines=message.split('\\n');// Strip Webpack-added headers off errors/warnings\n// https://github.com/webpack/webpack/blob/master/lib/ModuleError.js\nlines=lines.filter(line=>!/Module [A-z ]+\\(from/.test(line));// Transform parsing error into syntax error\n// TODO: move this to our ESLint formatter?\nlines=lines.map(line=>{var parsingError=/Line (\\d+):(?:(\\d+):)?\\s*Parsing error: (.+)$/.exec(line);if(!parsingError){return line;}var[,errorLine,errorColumn,errorMessage]=parsingError;return friendlySyntaxErrorLabel+\" \"+errorMessage+\" (\"+errorLine+\":\"+errorColumn+\")\";});message=lines.join('\\n');// Smoosh syntax errors (commonly found in CSS)\nmessage=message.replace(/SyntaxError\\s+\\((\\d+):(\\d+)\\)\\s*(.+?)\\n/g,friendlySyntaxErrorLabel+\" $3 ($1:$2)\\n\");// Clean up export errors\nmessage=message.replace(/^.*export '(.+?)' was not found in '(.+?)'.*$/gm,\"Attempted import error: '$1' is not exported from '$2'.\");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').\");message=message.replace(/^.*export '(.+?)' \\(imported as '(.+?)'\\) was not found in '(.+?)'.*$/gm,\"Attempted import error: '$1' is not exported from '$3' (imported as '$2').\");lines=message.split('\\n');// Remove leading newline\nif(lines.length>2&&lines[1].trim()===''){lines.splice(1,1);}// Clean up file name\nlines[0]=lines[0].replace(/^(.*) \\d+:\\d+-\\d+$/,'$1');// Cleans up verbose \"module not found\" messages for files and packages.\nif(lines[1]&&lines[1].indexOf('Module not found: ')===0){lines=[lines[0],lines[1].replace('Error: ','').replace('Module not found: Cannot find file:','Cannot find file:')];}// Add helpful message for users trying to use Sass for the first time\nif(lines[1]&&lines[1].match(/Cannot find module.+node-sass/)){// ./file.module.scss (<<loader info>>) => ./file.module.scss\nlines[0]=lines[0].replace(/(.+) \\(.+?(?=\\?\\?).+?\\)/,'$1');lines[1]=\"To use Next.js' built-in Sass support, you first need to install `sass`.\\n\";lines[1]+='Run `npm i sass` or `yarn add sass` inside your workspace.\\n';lines[1]+='\\nLearn more: https://err.sh/next.js/install-sass';}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\nmessage=message.replace(/^\\s*at\\s((?!webpack:).)*:\\d+:\\d+[\\s)]*(\\n|$)/gm,'');// at ... ...:x:y\nmessage=message.replace(/^\\s*at\\s<anonymous>(\\n|$)/gm,'');// at <anonymous>\nlines=message.split('\\n');// Remove duplicated newlines\nlines=lines.filter((line,index,arr)=>index===0||line.trim()!==''||line.trim()!==arr[index-1].trim());// Reassemble the message\nmessage=lines.join('\\n');return message.trim();}function formatWebpackMessages(json){var formattedErrors=json.errors.map(function(message){return formatMessage(message,true);});var formattedWarnings=json.warnings.map(function(message){return formatMessage(message,false);});var result={errors:formattedErrors,warnings:formattedWarnings};if(result.errors.some(isLikelyASyntaxError)){// If there are any syntax errors, show just them.\nresult.errors=result.errors.filter(isLikelyASyntaxError);}return result;}module.exports=formatWebpackMessages;"]},"metadata":{},"sourceType":"script"}