Code coverage report for core/src/util/strings.ts

Statements: 61.54% (8 / 13)      Branches: 43.48% (10 / 23)      Functions: 50% (2 / 4)      Lines: 66.67% (8 / 12)      Ignored: none     

All files » core/src/util/ » strings.ts
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 251         1         277   277   277 277       277     554    
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);
}