MCPcopy Index your code
hub / github.com/hydro-dev/Hydro / handleArguments

Function handleArguments

framework/framework/api.ts:101–114  ·  view source on GitHub ↗
(args: any)

Source from the content-addressed store, hash-verified

99}
100
101function handleArguments(args: any) {
102 try {
103 if (typeof args.args === 'string') {
104 args.args = JSON.parse(args.args);
105 }
106 if (typeof args.projection === 'string') {
107 args.projection = '{['.includes(args.projection[0])
108 ? JSON.parse(args.projection)
109 : args.projection.split(',').map((i) => i.trim()).filter((i) => i);
110 }
111 } catch (e) {
112 throw new BadRequestError('Invalid arguments');
113 }
114}
115
116export class ApiService extends Service {
117 constructor(ctx: Context) {

Callers 3

allMethod · 0.85
prepareMethod · 0.85
messageMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected