mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-18 07:29:16 -05:00
feat(43963): change var to a parameter in destructured function parameters (#44767)
This commit is contained in:
@@ -2059,7 +2059,9 @@ namespace ts {
|
||||
// Display-part writer helpers
|
||||
// #region
|
||||
export function isFirstDeclarationOfSymbolParameter(symbol: Symbol) {
|
||||
return symbol.declarations && symbol.declarations.length > 0 && symbol.declarations[0].kind === SyntaxKind.Parameter;
|
||||
const declaration = symbol.declarations ? firstOrUndefined(symbol.declarations) : undefined;
|
||||
return !!findAncestor(declaration, n =>
|
||||
isParameter(n) ? true : isBindingElement(n) || isObjectBindingPattern(n) || isArrayBindingPattern(n) ? false : "quit");
|
||||
}
|
||||
|
||||
const displayPartWriter = getDisplayPartWriter();
|
||||
|
||||
Reference in New Issue
Block a user