Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
while (current) {
if (
current.kind === ReflectionKind.Global ||
current.kind === ReflectionKind.ExternalModule
) {
// Skip global/external module nodes
break;
}
const index = current.name.lastIndexOf('.');
const name =
index === -1 ? current.name : current.name.substring(index + 1);
// Check static methods/properties
if (
current.kind === ReflectionKind.Method ||
current.kind === ReflectionKind.Property
) {
if (current.flags.isStatic) {
names.unshift(name);
} else {
names.unshift(`prototype.${name}`);
}
} else {
names.unshift(name);
}
current = current.parent;
}
const qname = names.join('.');
return qname;
}
while (current) {
if (
current.kind === ReflectionKind.Global ||
current.kind === ReflectionKind.ExternalModule
) {
// Skip global/external module nodes
break;
}
const index = current.name.lastIndexOf('.');
const name =
index === -1 ? current.name : current.name.substring(index + 1);
// Check static methods/properties
if (
current.kind === ReflectionKind.Method ||
current.kind === ReflectionKind.Property
) {
if (current.flags.isStatic) {
names.unshift(name);
} else {
names.unshift(`prototype.${name}`);
}
} else {
names.unshift(name);
}
current = current.parent;
}
const qname = names.join('.');
return qname;
}
export function memberSymbol(this: DeclarationReflection) {
const isStatic = this.flags.map(flag => flag).includes('Static');
const symbol = '•';
if (this.kind === ReflectionKind.ConstructorSignature) {
return '\\+';
}
if (this.kind === ReflectionKind.CallSignature) {
return '▸';
}
if (this.kind === ReflectionKind.TypeAlias) {
return 'Ƭ';
}
if (this.kind === ReflectionKind.ObjectLiteral) {
return '▪';
}
if (this.kind === ReflectionKind.Property && isStatic) {
return '▪';
}
return symbol;
}