export function nameOrFqn(name?: string, target?: any, property?: PropertyKey): string {
return name || [target?.constructor?.name, property].filter(v => v).join('.');
}
export function joinFqn(
appendName: PropertyKey | { name: string },
parent?: string | { fqn: string }, separator = '.'
): string {
let name: string;
Iif (typeof appendName === 'number') {
name = `${appendName}`;
} else Iif (appendName instanceof Symbol) {
name = appendName.toString();
} else Eif (typeof appendName === 'string') {
name = appendName;
} else {
name = (appendName as any).name;
}
return [
(typeof parent === 'string' ? parent : parent?.fqn),
name
].filter(name => name)
.join(separator);
} |