Create a synthetic property access flow node after the last statement of the file
(symbol)
| 56096 | } |
| 56097 | /** Create a synthetic property access flow node after the last statement of the file */ |
| 56098 | function getFlowTypeFromCommonJSExport(symbol) { |
| 56099 | var file = ts.getSourceFileOfNode(symbol.declarations[0]); |
| 56100 | var accessName = ts.unescapeLeadingUnderscores(symbol.escapedName); |
| 56101 | var areAllModuleExports = symbol.declarations.every(function (d) { return ts.isInJSFile(d) && ts.isAccessExpression(d) && ts.isModuleExportsAccessExpression(d.expression); }); |
| 56102 | var reference = areAllModuleExports |
| 56103 | ? ts.factory.createPropertyAccessExpression(ts.factory.createPropertyAccessExpression(ts.factory.createIdentifier("module"), ts.factory.createIdentifier("exports")), accessName) |
| 56104 | : ts.factory.createPropertyAccessExpression(ts.factory.createIdentifier("exports"), accessName); |
| 56105 | if (areAllModuleExports) { |
| 56106 | ts.setParent(reference.expression.expression, reference.expression); |
| 56107 | } |
| 56108 | ts.setParent(reference.expression, reference); |
| 56109 | ts.setParent(reference, file); |
| 56110 | reference.flowNode = file.endFlowNode; |
| 56111 | return getFlowTypeOfReference(reference, autoType, undefinedType); |
| 56112 | } |
| 56113 | function getFlowTypeInStaticBlocks(symbol, staticBlocks) { |
| 56114 | var accessName = ts.startsWith(symbol.escapedName, "__#") |
| 56115 | ? ts.factory.createPrivateIdentifier(symbol.escapedName.split("@")[1]) |
no test coverage detected
searching dependent graphs…