mirror of
https://github.com/idanoo/GoScrobble.git
synced 2024-11-23 00:45:16 +00:00
22 lines
865 B
JavaScript
22 lines
865 B
JavaScript
|
/**
|
||
|
* WARNING: Don't import this directly.
|
||
|
* Use `MuiError` from `@material-ui/utils/macros/MuiError.macro` instead.
|
||
|
* @param {number} code
|
||
|
*/
|
||
|
export default function formatMuiErrorMessage(code) {
|
||
|
// Apply babel-plugin-transform-template-literals in loose mode
|
||
|
// loose mode is safe iff we're concatenating primitives
|
||
|
// see https://babeljs.io/docs/en/babel-plugin-transform-template-literals#loose
|
||
|
|
||
|
/* eslint-disable prefer-template */
|
||
|
let url = 'https://material-ui.com/production-error/?code=' + code;
|
||
|
|
||
|
for (let i = 1; i < arguments.length; i += 1) {
|
||
|
// rest params over-transpile for this case
|
||
|
// eslint-disable-next-line prefer-rest-params
|
||
|
url += '&args[]=' + encodeURIComponent(arguments[i]);
|
||
|
}
|
||
|
|
||
|
return 'Minified Material-UI error #' + code + '; visit ' + url + ' for the full message.';
|
||
|
/* eslint-enable prefer-template */
|
||
|
}
|