Skip to content

Commit 4ba2db5

Browse files
authored
Refactor transform.ts and context.ts for improved code clarity (#12)
- Added an ESLint directive to suppress warnings for the TransformPatterns namespace in transform.ts. - Commented out the getParams function in context.ts to indicate it is deprecated and will be moved to utils for better organization.
1 parent 6302a4d commit 4ba2db5

File tree

2 files changed

+20
-19
lines changed

2 files changed

+20
-19
lines changed

src/types/services/context.ts

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -191,22 +191,22 @@ export const executionContextConfig = {
191191
} as const;
192192

193193
//todo move to utils
194-
export function getParams(context: ExecutionContext) {
195-
console.log("getParams", context);
196-
switch (context.protocol) {
197-
case Protocol.A2A:
198-
const a2aRequestParams = context.getRequestParams();
199-
if (!a2aRequestParams) {
200-
throw new Error("No request params provided");
201-
}
202-
return a2aRequestParams;
203-
case Protocol.MCP:
204-
const mcpRequestParams = context.getRequestParams();
205-
if (!mcpRequestParams) {
206-
throw new Error("No request params provided");
207-
}
208-
return mcpRequestParams;
209-
default:
210-
throw new Error("Invalid protocol");
211-
}
212-
}
194+
// export function getParams(context: ExecutionContext) {
195+
// console.log("getParams", context);
196+
// switch (context.protocol) {
197+
// case Protocol.A2A:
198+
// const a2aRequestParams = context.getRequestParams();
199+
// if (!a2aRequestParams) {
200+
// throw new Error("No request params provided");
201+
// }
202+
// return a2aRequestParams;
203+
// case Protocol.MCP:
204+
// const mcpRequestParams = context.getRequestParams();
205+
// if (!mcpRequestParams) {
206+
// throw new Error("No request params provided");
207+
// }
208+
// return mcpRequestParams;
209+
// default:
210+
// throw new Error("Invalid protocol");
211+
// }
212+
// }

src/types/transform.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ export function createRenameConfig<T extends object>() {
8585
/**
8686
* Common transformation patterns using built-in utility types
8787
*/
88+
// eslint-disable-next-line @typescript-eslint/no-namespace
8889
export namespace TransformPatterns {
8990
/**
9091
* Convert snake_case keys to camelCase

0 commit comments

Comments
 (0)