Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return;
}
let aliased = checker.getAliasedSymbol(sym);
if (!keep.value) {
// Here, keep.type == true.
if (aliased.flags & ts.SymbolFlags.Value) {
// Overwritten with a new value.
return;
}
if (aliased.flags && ts.SymbolFlags.Type) {
addName(node, key);
}
return;
}
// Here, keep.value == true and keep.type == false.
if (aliased.flags & ts.SymbolFlags.Type) {
// Overwritten with a new type.
if (
aliased.flags & ts.SymbolFlags.Value &&
!valueNames.has(aliased.escapedName)
) {
anyVars.add(aliased.escapedName);
}
return;
}
addName(node, key);
return;
}
if (ts.isFunctionDeclaration(node)) {
if (keep.value) {
addName(node, key);
}
function checkKeepDeclType(
checker: ts.TypeChecker,
symb: ts.Symbol
): { value: boolean; type: boolean } {
const ret = { value: true, type: true };
if (!symb) {
return ret;
}
if (symb.flags & ts.SymbolFlags.Alias) {
symb = checker.getAliasedSymbol(symb);
}
if (symb.flags & ts.SymbolFlags.Value) {
ret.value = false;
}
if (symb.flags & ts.SymbolFlags.Type) {
ret.type = false;
}
return ret;
}
function checkKeepDeclType(
checker: ts.TypeChecker,
symb: ts.Symbol
): { value: boolean; type: boolean } {
const ret = { value: true, type: true };
if (!symb) {
return ret;
}
if (symb.flags & ts.SymbolFlags.Alias) {
symb = checker.getAliasedSymbol(symb);
}
if (symb.flags & ts.SymbolFlags.Value) {
ret.value = false;
}
if (symb.flags & ts.SymbolFlags.Type) {
ret.type = false;
}
return ret;
}