Skip to content

Commit 6f221d6

Browse files
style: reformat
1 parent 539e268 commit 6f221d6

File tree

2 files changed

+17
-5
lines changed

2 files changed

+17
-5
lines changed

migrate/migrate-bot.ts

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ async function convertToMDX(
9090
"{{LLM_DOCS}}",
9191
await readFile(
9292
__dirname +
93-
"/../src/content/docs/development/guide/component-docs-for-llm.mdx",
93+
"/../src/content/docs/development/guide/component-docs-for-llm.mdx",
9494
"utf8"
9595
)
9696
);
@@ -254,7 +254,11 @@ description: Auto‑generated from cppreference
254254
// curl --location --request POST "https://api.imgbb.com/1/upload?expiration=600&key=YOUR_CLIENT_API_KEY" --form "image=R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"
255255
async function uploadImageToImgBB(imageBuffer: Buffer): Promise<string> {
256256
const formData = new FormData();
257-
formData.append("image", new Blob([new Uint8Array(imageBuffer)]), "diff.webp");
257+
formData.append(
258+
"image",
259+
new Blob([new Uint8Array(imageBuffer)]),
260+
"diff.webp"
261+
);
258262
formData.append("name", "diff.webp");
259263

260264
const response = await fetch(
@@ -419,10 +423,18 @@ async function main() {
419423
await writeMDXFile(filePath, mdx, title);
420424

421425
console.log(` 尝试构建...`);
422-
const res = spawnSync(`npm`, ["run", "build"], { stdio: "inherit", shell: true });
426+
const res = spawnSync(`npm`, ["run", "build"], {
427+
stdio: "inherit",
428+
shell: true,
429+
});
423430
if (res.status !== 0) {
424431
throw new Error(
425-
"构建失败,可能生成的MDX有问题:" + res.stderr?.toString() + res.stdout?.toString() + res.error?.toString() + " exit code " + res.status
432+
"构建失败,可能生成的MDX有问题:" +
433+
res.stderr?.toString() +
434+
res.stdout?.toString() +
435+
res.error?.toString() +
436+
" exit code " +
437+
res.status
426438
);
427439
}
428440

migrate/text-diff-visualizer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,6 @@ export function visualizeTextDiff(textA: string, textB: string) {
336336
prevLineIdx = lineIdx;
337337
});
338338

339-
const buffer = canvas.toBuffer('image/webp');
339+
const buffer = canvas.toBuffer("image/webp");
340340
return buffer;
341341
}

0 commit comments

Comments
 (0)