* Invoke callback from object with context and arguments. * If callback returns `undefined`, then will be invoked default callback. * @param {Record<keyof typeof defaultCallbacks, Function>} callbacks * @param {keyof typeof defaultCallbacks} name * @param {*} ctx * @param {*} arg * @returns {a
(callbacks, name, ctx, arg)
| 445 | * @returns {any} |
| 446 | */ |
| 447 | function invokeCallbackWithFallback(callbacks, name, ctx, arg) { |
| 448 | const result = callbacks[name].call(ctx, arg); |
| 449 | |
| 450 | if (typeof result === 'undefined') { |
| 451 | return defaultCallbacks[name].call(ctx, arg); |
| 452 | } |
| 453 | |
| 454 | return result; |
| 455 | } |
| 456 | |
| 457 | export class Tooltip extends Element { |
| 458 |
no outgoing calls
no test coverage detected