Assert type of node object.

This commit is contained in:
Anton Vilhelm Ásgeirsson 2018-08-19 12:08:49 +00:00
parent 0908af9100
commit 4c856621c5

View file

@ -5,7 +5,9 @@ import * as commandLineArgs from "command-line-args"
/** True if this is visible outside this file, false otherwise */ /** True if this is visible outside this file, false otherwise */
function isNodeExported(node: ts.Node): boolean { function isNodeExported(node: ts.Node): boolean {
return ( return (
(ts.getCombinedModifierFlags(node) & ts.ModifierFlags.Export) !== 0 || (ts.getCombinedModifierFlags(<ts.Declaration>node) &
ts.ModifierFlags.Export) !==
0 ||
(!!node.parent && node.parent.kind === ts.SyntaxKind.SourceFile) (!!node.parent && node.parent.kind === ts.SyntaxKind.SourceFile)
) )
} }