export * from './array.js';
export {default as randomUUID} from './uuid.js';

export function tryRun(fn, defaultValue) {
  try { return fn() || defaultValue; } catch (_) { return defaultValue; }
}

export function tryRunOrError(fn, defaultValue) {
  try {
    const value = fn() || defaultValue;
    return [null, value];
  } catch (error) {
    return [error, defaultValue];
  }
}