(
userScript:
| ((
params: typeof this.params,
settings: Record<string, unknown>
) => Promise<unknown>)
| {
entry: (
params: typeof this.params,
settings: Record<string, unknown>
) => Promise<unknown>;
},
command: IUserScript
)
| 394 | } |
| 395 | |
| 396 | private async runScriptWithSettings( |
| 397 | userScript: |
| 398 | | (( |
| 399 | params: typeof this.params, |
| 400 | settings: Record<string, unknown> |
| 401 | ) => Promise<unknown>) |
| 402 | | { |
| 403 | entry: ( |
| 404 | params: typeof this.params, |
| 405 | settings: Record<string, unknown> |
| 406 | ) => Promise<unknown>; |
| 407 | }, |
| 408 | command: IUserScript |
| 409 | ) { |
| 410 | if ( |
| 411 | typeof userScript !== "function" && |
| 412 | userScript.entry && |
| 413 | typeof userScript.entry === "function" |
| 414 | ) { |
| 415 | return await this.onExportIsFunction( |
| 416 | userScript.entry, |
| 417 | await this.getResolvedUserScriptSettings(command), |
| 418 | ); |
| 419 | } |
| 420 | |
| 421 | if (typeof userScript === "function") { |
| 422 | return await this.onExportIsFunction( |
| 423 | userScript, |
| 424 | await this.getResolvedUserScriptSettings(command), |
| 425 | ); |
| 426 | } |
| 427 | } |
| 428 | |
| 429 | |
| 430 | protected async userScriptDelegator(userScript: unknown) { |
no test coverage detected