// import { Ctor, Func } from '@rhom6us/func'; // import * as obj from './obj'; // export function Lazy(ctor: T): T { // return class { // constructor(...ctorArgs: any[]) { // let ref: WeakRef>; // return new Proxy({}, mapValues(Reflect, (key, fn) => (...args: any) => { // const target = ref?.deref() ?? (ref = new WeakRef(new ctor(...ctorArgs))).deref(); // if (!target) { // throw 'wtf mate?'; // } // return fn(target, ...args.slice(1) as GoddamnTuple) // })); // } // } as T; // } // type GoddamnTuple = [any, any, any]; // function mapValues, R>(source: T, map: Func, R>) { // return obj.fromEntries(entries(source).map(([key, fn]) => [key, map(key, fn)] as const)); // } // function entries(p: T): obj.entries[] { // eslint-disable-line @typescript-eslint/ban-types // return Reflect.ownKeys(p).filter(p => typeof p === 'string').map(key => [key, p[key as keyof T]]) as any; // };