Skip to content

Commit e14cfcc

Browse files
committed
refactor(mcp): clean up import statements and improve code formatting
1 parent 65212fb commit e14cfcc

1 file changed

Lines changed: 9 additions & 8 deletions

File tree

cloudflare-mcp/src/index.js

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,9 @@ import { select } from "hast-util-select";
88
import { toString } from "hast-util-to-string";
99
import lunr from "lunr";
1010
import mcpDocs from "../../build/mcp/docs.json" with { type: "json" };
11-
import mcpSearchIndexData from "../../build/mcp/search-index.json" with {
12-
type: "json",
13-
};
11+
import mcpSearchIndexData from "../../build/mcp/search-index.json" with { type: "json" };
1412
import mcpManifest from "../../build/mcp/manifest.json" with { type: "json" };
15-
import siteSearchIndexData from "../../build/search-index.json" with {
16-
type: "json",
17-
};
13+
import siteSearchIndexData from "../../build/search-index.json" with { type: "json" };
1814

1915
const CONTENT_SELECTORS = ["article", "main", ".main-wrapper", '[role="main"]'];
2016

@@ -74,7 +70,11 @@ function makeTitle(doc) {
7470
}
7571

7672
function makeSnippet(doc) {
77-
if (typeof doc.t === "string" && typeof doc.s === "string" && doc.s !== doc.t) {
73+
if (
74+
typeof doc.t === "string" &&
75+
typeof doc.s === "string" &&
76+
doc.s !== doc.t
77+
) {
7878
return doc.t;
7979
}
8080
if (typeof doc.t === "string" && doc.t.trim()) return doc.t;
@@ -179,7 +179,8 @@ function normalizeToolUrl(value, docsBaseUrl) {
179179
const parsed = new URL(value);
180180
const docsBase = new URL(docsBaseUrl);
181181
const isDocsBase =
182-
parsed.origin === docsBase.origin && parsed.pathname === docsBase.pathname;
182+
parsed.origin === docsBase.origin &&
183+
parsed.pathname === docsBase.pathname;
183184

184185
if (!isDocsBase && parsed.pathname.length > 1) {
185186
parsed.pathname = parsed.pathname.replace(/\/+$/, "");

0 commit comments

Comments
 (0)