mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-06-14 16:56:06 -05:00
Preserve input key style of computed properties in declaration emit (#55298)
This commit is contained in:
committed by
GitHub
parent
38553696e2
commit
16dab6d5d6
@@ -8082,7 +8082,14 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
|
||||
|
||||
function isStringNamed(d: Declaration) {
|
||||
const name = getNameOfDeclaration(d);
|
||||
return !!name && isStringLiteral(name);
|
||||
if (!name) {
|
||||
return false;
|
||||
}
|
||||
if (isComputedPropertyName(name)) {
|
||||
const type = checkExpression(name.expression);
|
||||
return !!(type.flags & TypeFlags.StringLike);
|
||||
}
|
||||
return isStringLiteral(name);
|
||||
}
|
||||
|
||||
function isSingleQuotedStringNamed(d: Declaration) {
|
||||
|
||||
Reference in New Issue
Block a user