Skip to content

Commit ce3ee6a

Browse files
OzTamirOrKoN
authored andcommitted
fix: proper typing for FILTERABLE_RESOURCE_TYPES
1 parent e97e7ee commit ce3ee6a

1 file changed

Lines changed: 25 additions & 27 deletions

File tree

src/tools/network.ts

Lines changed: 25 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -10,27 +10,30 @@ import z from 'zod';
1010
import { ToolCategories } from './categories.js';
1111
import { defineTool } from './ToolDefinition.js';
1212

13-
const FILTERABLE_RESOURCE_TYPES = [
14-
'document',
15-
'stylesheet',
16-
'image',
17-
'media',
18-
'font',
19-
'script',
20-
'texttrack',
21-
'xhr',
22-
'fetch',
23-
'prefetch',
24-
'eventsource',
25-
'websocket',
26-
'manifest',
27-
'signedexchange',
28-
'ping',
29-
'cspviolationreport',
30-
'preflight',
31-
'fedcm',
32-
'other',
33-
] as const satisfies readonly ResourceType[];
13+
const FILTERABLE_RESOURCE_TYPES: readonly [
14+
ResourceType,
15+
...ResourceType[],
16+
] = [
17+
'document',
18+
'stylesheet',
19+
'image',
20+
'media',
21+
'font',
22+
'script',
23+
'texttrack',
24+
'xhr',
25+
'fetch',
26+
'prefetch',
27+
'eventsource',
28+
'websocket',
29+
'manifest',
30+
'signedexchange',
31+
'ping',
32+
'cspviolationreport',
33+
'preflight',
34+
'fedcm',
35+
'other',
36+
];
3437

3538
export const listNetworkRequests = defineTool({
3639
name: 'list_network_requests',
@@ -58,12 +61,7 @@ export const listNetworkRequests = defineTool({
5861
),
5962
resourceTypes: z
6063
.array(
61-
z.enum(
62-
FILTERABLE_RESOURCE_TYPES as unknown as [
63-
ResourceType,
64-
...ResourceType[],
65-
],
66-
),
64+
z.enum(FILTERABLE_RESOURCE_TYPES),
6765
)
6866
.optional()
6967
.describe(

0 commit comments

Comments
 (0)