(name: keyof typeof propsDecorators, props: any, ...fnArgs: any[])
| 399 | } |
| 400 | |
| 401 | function getProps(name: keyof typeof propsDecorators, props: any, ...fnArgs: any[]) { |
| 402 | const decorators = propsDecorators[name]; |
| 403 | let props_: typeof props; |
| 404 | |
| 405 | decorators.forEach((fn) => { |
| 406 | let ret_; |
| 407 | |
| 408 | if (!props_) { |
| 409 | props_ = Object.assign({}, props); |
| 410 | } |
| 411 | |
| 412 | try { |
| 413 | // eslint-disable-next-line @typescript-eslint/no-unsafe-call |
| 414 | ret_ = fn(...fnArgs, props_); |
| 415 | } catch (err) { |
| 416 | notify('Plugin error', `${fn._pluginName}: Error occurred in \`${name}\`. Check Developer Tools for details.`, { |
| 417 | error: err |
| 418 | }); |
| 419 | return; |
| 420 | } |
| 421 | |
| 422 | if (!ret_ || typeof ret_ !== 'object') { |
| 423 | notify('Plugin error', `${fn._pluginName}: Invalid return value of \`${name}\` (object expected).`); |
| 424 | return; |
| 425 | } |
| 426 | |
| 427 | props_ = ret_; |
| 428 | }); |
| 429 | |
| 430 | return props_ || props; |
| 431 | } |
| 432 | |
| 433 | export function getTermGroupProps<T extends Assignable<TermGroupOwnProps, T>>( |
| 434 | uid: string, |
no test coverage detected