switch order of params so the last one can be omitted
This commit is contained in:
parent
48b0076ea5
commit
6376c9ae43
15
src/docs.mts
15
src/docs.mts
|
@ -100,9 +100,9 @@ const logWasOrShouldBeTransformed = (filename: string, wasCopied: boolean) => {
|
|||
* documentation directory. Default is `false`
|
||||
*/
|
||||
const copyTransformedContents = (
|
||||
file: string,
|
||||
transformedContent?: string,
|
||||
doCopy: boolean = false
|
||||
filename: string,
|
||||
doCopy: boolean = false,
|
||||
transformedContent?: string
|
||||
) => {
|
||||
const fileInFinalDocDir = changeToFinalDocDir(file);
|
||||
const existingBuffer = existsSync(fileInFinalDocDir)
|
||||
|
@ -152,6 +152,7 @@ const transformMarkdown = (file: string) => {
|
|||
|
||||
copyTransformedContents(
|
||||
file,
|
||||
!verifyOnly,
|
||||
prettier.format(transformed, {
|
||||
parser: 'markdown',
|
||||
useTabs: false,
|
||||
|
@ -159,8 +160,7 @@ const transformMarkdown = (file: string) => {
|
|||
endOfLine: 'auto',
|
||||
printWidth: 100,
|
||||
singleQuote: true,
|
||||
}),
|
||||
!verifyOnly
|
||||
})
|
||||
);
|
||||
};
|
||||
|
||||
|
@ -191,7 +191,7 @@ const transformHtml = (filename: string) => {
|
|||
};
|
||||
|
||||
const transformedHTML = insertAutoGeneratedComment(filename);
|
||||
copyTransformedContents(filename, transformedHTML, !verifyOnly);
|
||||
copyTransformedContents(filename, !verifyOnly, transformedHTML);
|
||||
};
|
||||
|
||||
/** Main method (entry point) */
|
||||
|
@ -214,8 +214,7 @@ const transformHtml = (filename: string) => {
|
|||
dot: includeFilesStartingWithDot,
|
||||
});
|
||||
otherFiles.forEach((file: string) => {
|
||||
const transformedContents = readSyncedUTF8file(file); // no transformation is done; just get the contents
|
||||
copyTransformedContents(file, transformedContents, !verifyOnly);
|
||||
copyTransformedContents(file, !verifyOnly); // no transformation
|
||||
});
|
||||
|
||||
if (filesWereTransformed) {
|
||||
|
|
Loading…
Reference in New Issue