MCPcopy Index your code
hub / github.com/loopbackio/loopback-next / invokeMethod

Function invokeMethod

packages/context/src/invocation.ts:169–198  ·  view source on GitHub ↗
(
  target: object,
  method: string,
  ctx: Context,
  nonInjectedArgs: InvocationArgs = [],
  options: InvocationOptions = {},
)

Source from the content-addressed store, hash-verified

167 * @param options - Options for the invocation
168 */
169export function invokeMethod(
170 target: object,
171 method: string,
172 ctx: Context,
173 nonInjectedArgs: InvocationArgs = [],
174 options: InvocationOptions = {},
175): ValueOrPromise<InvocationResult> {
176 if (options.skipInterceptors) {
177 if (options.skipParameterInjection) {
178 // Invoke the target method directly without injection or interception
179 return invokeTargetMethod(ctx, target, method, nonInjectedArgs);
180 } else {
181 return invokeTargetMethodWithInjection(
182 ctx,
183 target,
184 method,
185 nonInjectedArgs,
186 options.session,
187 );
188 }
189 }
190 // Invoke the target method with interception but no injection
191 return invokeMethodWithInterceptors(
192 ctx,
193 target,
194 method,
195 nonInjectedArgs,
196 options,
197 );
198}
199
200/**
201 * Invoke a method. Method parameter dependency injection is honored.

Calls 3

invokeTargetMethodFunction · 0.85

Tested by 2

cancelOrderFunction · 0.68
placeOrderFunction · 0.68