| 167 | * @param options - Options for the invocation |
| 168 | */ |
| 169 | export 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. |