UNPKG

next-era

Version:

Welcome to **Next Era**! A comprehensive library designed to supercharge your **Next.js** applications with powerful utilities and significant performance optimizations. Build faster, more efficient, and feature-rich Next.js projects with ease.

16 lines (15 loc) 656 B
import { Session } from "next-auth"; /** * Factory function to create a new instance of a DTO class. * @param obj - The object to process. * @returns A new DTO class. */ export default function Factory<T>(obj: string | number | Record<string, string | number | null> | (string | number | Record<string, string | number | null>)[]): { to: <K extends { auth: () => Promise<Session>; } | object>(ctor: new (obj: T) => K) => Promise<K>; toArray: <K extends { auth: () => Promise<Session>; } | object>(ctor: new (obj: T) => K) => Promise<Awaited<K>[]>; toCamelKey: () => string | number | T | (string | number | T)[]; };