@ -59,10 +59,7 @@ module.exports = function readTypeScriptModules(tsParser, modules, getFileInfo,
|
||||
if (anyMatches(ignoreExportsMatching, exportSymbol.name)) return;
|
||||
|
||||
// If the symbol is an Alias then for most things we want the original resolved symbol
|
||||
var resolvedExport = exportSymbol;
|
||||
if (exportSymbol.resolvedSymbol && exportSymbol.resolvedSymbol.name !== "unknown") {
|
||||
resolvedExport = exportSymbol.resolvedSymbol;
|
||||
}
|
||||
var resolvedExport = exportSymbol.resolvedSymbol || exportSymbol;
|
||||
var exportDoc = createExportDoc(exportSymbol.name, resolvedExport, moduleDoc, basePath, parseInfo.typeChecker);
|
||||
log.debug('>>>> EXPORT: ' + exportDoc.name + ' (' + exportDoc.docType + ') from ' + moduleDoc.id);
|
||||
|
||||
@ -285,11 +282,7 @@ module.exports = function readTypeScriptModules(tsParser, modules, getFileInfo,
|
||||
|
||||
|
||||
function getDecorators(symbol) {
|
||||
var declaration = symbol.valueDeclaration;
|
||||
if (!declaration) {
|
||||
console.log("missing declaration for symbol", declaration);
|
||||
return [];
|
||||
}
|
||||
var declaration = symbol.valueDeclaration || symbol.declarations[0];
|
||||
var sourceFile = ts.getSourceFileOfNode(declaration);
|
||||
|
||||
var decorators = declaration.decorators && declaration.decorators.map(function(decorator) {
|
||||
|
@ -58,11 +58,17 @@ module.exports = function createCompilerHost(log) {
|
||||
return ts.sys.newLine;
|
||||
},
|
||||
fileExists: function(fileName) {
|
||||
var stats;
|
||||
fs.stat(fileName, function(err, s) {
|
||||
stats = s;
|
||||
});
|
||||
return !!stats;
|
||||
var resolvedPath = path.resolve(baseDir, fileName);
|
||||
try {
|
||||
fs.statSync(resolvedPath);
|
||||
return true;
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
},
|
||||
readFile: function(fileName) {
|
||||
var resolvedPath = path.resolve(baseDir, fileName);
|
||||
return fs.readFileSync(resolvedPath, { encoding: options.charset });
|
||||
}
|
||||
};
|
||||
};
|
||||
|
@ -4,9 +4,6 @@ var ts = require('typescript');
|
||||
module.exports = function getFileInfo(log) {
|
||||
|
||||
return function (symbol, basePath) {
|
||||
if (!symbol.declarations) {
|
||||
console.log("ouch", symbol);
|
||||
}
|
||||
var fileName = ts.getSourceFileOfNode(symbol.declarations[0]).fileName;
|
||||
|
||||
var file = path.resolve(basePath, fileName);
|
||||
|
Reference in New Issue
Block a user