Skip to content

Commit d0998cb

Browse files
fix: remove any type and unused import in type guard
- Replace any with explicit type assertion in isCompletable() - Remove unused CompletableDef import from mcp.ts
1 parent f20b4e3 commit d0998cb

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/server/completable.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export type CompletableSchema<T extends ZodTypeAny> = T & { _def: T['_def'] & Co
2626
* Type guard to check if a schema has been wrapped with completion capabilities.
2727
*/
2828
export function isCompletable<T extends ZodTypeAny>(schema: ZodTypeAny): schema is CompletableSchema<T> {
29-
const defLike = (schema as any)._def;
29+
const defLike = (schema as { _def?: { typeName?: unknown } })._def;
3030
return defLike?.typeName === McpZodTypeKind.Completable;
3131
}
3232

src/server/mcp.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ import {
3232
ToolAnnotations,
3333
LoggingMessageNotification
3434
} from '../types.js';
35-
import { CompletableDef, isCompletable } from './completable.js';
35+
import { isCompletable } from './completable.js';
3636
import { UriTemplate, Variables } from '../shared/uriTemplate.js';
3737
import { RequestHandlerExtra } from '../shared/protocol.js';
3838
import { Transport } from '../shared/transport.js';

0 commit comments

Comments
 (0)