function invokeCallbackWithFallback(callbacks, name, ctx, arg) {
  const result = callbacks[name].call(ctx, arg);

  if (typeof result === 'undefined') {
    return defaultCallbacks[name].call(ctx, arg);
  }

  return result;
}
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 {any}