export function deepCopy<T>(obj: T): T {
  // Structured cloning
  if (typeof globalThis?.structuredClone === 'function') {
    // @ts-ignore
    return globalThis.structuredClone(obj) as T;
  }

  // Normal objects
  return JSON.parse(JSON.stringify(obj)) as T;
}
