Creates a Proxy object that will dynamically call the handler argument when attributes are accessed.
const proxy = proxied((propertyName) => propertyName.toUpperCase());proxy.foo; // => "FOO"
npx atmx add helper proxied
Copy and paste the following method into @/utils/helpers/undefined.ts:
@/utils/helpers/undefined.ts
/*** Creates a Proxy object that will dynamically call the handler* argument when attributes are accessed.** @example* const proxy = proxied(propertyName => propertyName.toUpperCase())* proxy.foo // => "FOO"*/export function proxied<T, K>(handler: (propertyName: T) => K,): Record<string, K> {return new Proxy({},{ get: (_, propertyName: any) => handler(propertyName),},);}