UNPKG

@miracledevs/paradigm-web-di

Version:

A minimal dependency injection library for the web

15 lines (11 loc) 421 B
export type ObjectType<T = any> = (new (...args: any[]) => T); export function getObjectTypeName<T = any>(objectType: ObjectType<T> | Function | any): string { if (!objectType) return "null object"; if (objectType.name) return objectType.name; if (objectType.constructor && objectType.constructor.name) return objectType.constructor.name; return "unknown type"; }