Skip to content

Commit 40e1753

Browse files
docs: remove unnecessary replace (#475)
1 parent b30bdd6 commit 40e1753

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

scripts/generate-docs.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ function addCrossLinks(text: string, tools: ToolWithAnnotations[]): string {
4444

4545
for (const toolName of sortedToolNames) {
4646
// Create regex to match tool name (case insensitive, word boundaries)
47-
const regex = new RegExp(`\\b${toolName.replace(/_/g, '_')}\\b`, 'gi');
47+
const regex = new RegExp(`\\b${toolName}\\b`, 'gi');
4848

4949
result = result.replace(regex, match => {
5050
// Only create link if the match isn't already inside a link
@@ -274,15 +274,16 @@ async function generateToolDocumentation(): Promise<void> {
274274

275275
const propertyNames = Object.keys(properties).sort();
276276
for (const propName of propertyNames) {
277-
const prop = properties[propName] as string;
277+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
278+
const prop = properties[propName] as any;
278279
const isRequired = required.includes(propName);
279280
const requiredText = isRequired
280281
? ' **(required)**'
281282
: ' _(optional)_';
282283

283284
let typeInfo = prop.type || 'unknown';
284285
if (prop.enum) {
285-
typeInfo = `enum: ${prop.enum.map(v => `"${v}"`).join(', ')}`;
286+
typeInfo = `enum: ${prop.enum.map((v: string) => `"${v}"`).join(', ')}`;
286287
}
287288

288289
markdown += `- **${propName}** (${typeInfo})${requiredText}`;

0 commit comments

Comments
 (0)