Skip to content

Commit c3cf0f8

Browse files
committed
lint
1 parent 47c91b2 commit c3cf0f8

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/examples/strictTypesExample.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,12 @@ const extensibleTool = ExtensibleToolSchema.parse(toolData);
2626

2727
console.log("Extensible tool keeps ALL properties:");
2828
console.log("- name:", extensibleTool.name);
29-
console.log("- customField:", (extensibleTool as any).customField); // "This is an extension"
29+
// Type assertion to access the extra field
30+
console.log("- customField:", (extensibleTool as Record<string, unknown>).customField); // "This is an extension"
3031

3132
// With safe types - unknown fields are silently stripped
3233
const safeTool = ToolSchema.parse(toolData);
3334

3435
console.log("\nSafe tool strips unknown properties:");
35-
console.log("- customField:", (safeTool as any).customField); // undefined (stripped)
36+
// Type assertion to check the field was removed
37+
console.log("- customField:", (safeTool as Record<string, unknown>).customField); // undefined (stripped)

0 commit comments

Comments
 (0)