mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-02 19:03:38 +02:00
refactor(v2): cleanup console output (#4979)
* refactor(v2): cleanup console output * fix jest issue Co-authored-by: slorber <lorber.sebastien@gmail.com>
This commit is contained in:
parent
8501db78a1
commit
41d9288e3d
86 changed files with 382 additions and 339 deletions
|
@ -342,7 +342,7 @@ export function getElementsAround<T extends unknown>(
|
|||
const max = array.length - 1;
|
||||
if (aroundIndex < min || aroundIndex > max) {
|
||||
throw new Error(
|
||||
`Valid aroundIndex for array (of size ${array.length}) are between ${min} and ${max}, but you provided aroundIndex=${aroundIndex}`,
|
||||
`Valid "aroundIndex" for array (of size ${array.length}) are between ${min} and ${max}, but you provided ${aroundIndex}.`,
|
||||
);
|
||||
}
|
||||
const previous = aroundIndex === min ? undefined : array[aroundIndex - 1];
|
||||
|
@ -427,7 +427,7 @@ export async function getFolderContainingFile(
|
|||
// should never happen, as the source was read from the FS anyway...
|
||||
if (!maybeFolderPath) {
|
||||
throw new Error(
|
||||
`relativeFilePath=[${relativeFilePath}] does not exist in any of these folders: \n- ${folderPaths.join(
|
||||
`File "${relativeFilePath}" does not exist in any of these folders:\n- ${folderPaths.join(
|
||||
'\n- ',
|
||||
)}]`,
|
||||
);
|
||||
|
@ -455,7 +455,7 @@ export function reportMessage(
|
|||
throw new Error(message);
|
||||
default:
|
||||
throw new Error(
|
||||
`unexpected reportingSeverity value: ${reportingSeverity}`,
|
||||
`Unexpected "reportingSeverity" value: ${reportingSeverity}.`,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue