const cloneImpl =
    typeof structuredClone !== 'undefined' ? structuredClone : (obj: any) => JSON.parse(JSON.stringify(obj));

export function clone<T>(object: T): T {
    return cloneImpl(object) as T;
}
