/
githubmirror
/
material-ui
Обзор
Документация
Войти
/
githubmirror
/
material-ui
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
packages/mui-utils/src/formatMuiErrorMessage/formatMuiErrorMessage.ts
15 строк
749 B
Jan Potoms
[code-infra] Move MuiError babel macro to babel plugin (#43904)
07 окт 2024, 19:16
Не верифицирован
07 окт 2024, 19:16
0210994
Код
Авторство
О чём код?
/** * WARNING: Don't import this directly. It's imported by the code generated by * `@mui/interal-babel-plugin-minify-errors`. Make sure to always use string literals in `Error` * constructors to ensure the plugin works as expected. Supported patterns include: * throw new Error('My message'); * throw new Error(`My message: ${foo}`); * throw new Error(`My message: ${foo}` + 'another string'); * ... * @param {number} code */ export default function formatMuiErrorMessage(code: number, ...args: string[]): string { const url = new URL(`https://mui.com/production-error/?code=${code}`); args.forEach((arg) => url.searchParams.append('args[]', arg)); return `Minified MUI error #${code}; visit ${url} for the full message.`; }