merge static method

Merges two debug options, with other taking precedence over base.

Returns null if DevTools is not enabled or both options are null. When merging, values from other are preferred over base.

Implementation

static JoltDebugOption? merge(JoltDebugOption? base, JoltDebugOption? other) {
  if (!JoltDevTools.enabled) return null;
  if (base == null && other == null) return null;
  return JoltDebugOption._(
    debugLabel: other?.debugLabel ?? base?.debugLabel,
    debugType: other?.debugType ?? base?.debugType,
    onDebug: other?.onDebug ?? base?.onDebug,
  );
}