Skip to content

Commit 380990f

Browse files
committed
Style feedback from PR
1 parent 249f925 commit 380990f

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/compiler/checker.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8070,7 +8070,9 @@ namespace ts {
80708070
return anyType;
80718071
}
80728072
const isDirectExport = kind === AssignmentDeclarationKind.ExportsProperty && (isPropertyAccessExpression(expression.left) || isElementAccessExpression(expression.left)) && (isModuleExportsAccessExpression(expression.left.expression) || (isIdentifier(expression.left.expression) && isExportsIdentifier(expression.left.expression)));
8073-
const type = resolvedSymbol ? getTypeOfSymbol(resolvedSymbol) : (isDirectExport ? getRegularTypeOfLiteralType : getWidenedLiteralType)(checkExpressionCached(expression.right));
8073+
const type = resolvedSymbol ? getTypeOfSymbol(resolvedSymbol)
8074+
: isDirectExport ? getRegularTypeOfLiteralType(checkExpressionCached(expression.right))
8075+
: getWidenedLiteralType(checkExpressionCached(expression.right));
80748076
if (type.flags & TypeFlags.Object &&
80758077
kind === AssignmentDeclarationKind.ModuleExports &&
80768078
symbol.escapedName === InternalSymbolName.ExportEquals) {
@@ -29889,7 +29891,7 @@ namespace ts {
2988929891

2989029892
function checkExpressionForMutableLocation(node: Expression, checkMode: CheckMode | undefined, contextualType?: Type, forceTuple?: boolean): Type {
2989129893
const type = checkExpression(node, checkMode, forceTuple);
29892-
return isConstContext(node) || isCommonJsExportedExpresion(node) ? getRegularTypeOfLiteralType(type) :
29894+
return isConstContext(node) || isCommonJsExportedExpression(node) ? getRegularTypeOfLiteralType(type) :
2989329895
isTypeAssertion(node) ? type :
2989429896
getWidenedLiteralLikeTypeForContextualType(type, instantiateContextualType(arguments.length === 2 ? getContextualType(node) : contextualType, node));
2989529897
}

src/compiler/utilities.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1345,7 +1345,7 @@ namespace ts {
13451345
&& node.parent.parent.kind === SyntaxKind.VariableStatement;
13461346
}
13471347

1348-
export function isCommonJsExportedExpresion(node: Node) {
1348+
export function isCommonJsExportedExpression(node: Node) {
13491349
if (!isInJSFile(node)) return false;
13501350
return (isObjectLiteralExpression(node.parent) && isBinaryExpression(node.parent.parent) && getAssignmentDeclarationKind(node.parent.parent) === AssignmentDeclarationKind.ModuleExports) ||
13511351
isCommonJsExportPropertyAssignment(node.parent);

0 commit comments

Comments
 (0)