Skip to content

Commit

Permalink
fix(logging): don't console log ModuleDeclarations
Browse files Browse the repository at this point in the history
  • Loading branch information
wessberg committed Apr 14, 2021
1 parent 1508ecc commit a513caa
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
Expand Up @@ -17,7 +17,7 @@ export function deconflictModuleDeclaration(options: DeconflicterVisitorOptions<
const {node, continuation, lexicalEnvironment, compatFactory, typescript, sourceFile, declarationToDeconflictedBindingMap} = options;
let nameContResult: TS.ModuleDeclaration["name"];
const id = getIdForNode(options);
const originalSourceFile = getOriginalSourceFile(node.name, sourceFile, typescript, true);
const originalSourceFile = getOriginalSourceFile(node.name, sourceFile, typescript);

// Check if it is a namespace ModuleDeclaration. If it is, its name can be deconflicted. If it isn't, it should augment and merge with any existing declarations for it
const isNamespace = (node.flags & typescript.NodeFlags.Namespace) !== 0;
Expand Down
Expand Up @@ -2,13 +2,11 @@ import {SafeNode} from "../../../../type/safe-node";
import {TS} from "../../../../type/ts";
import {getOriginalNode} from "./get-original-node";

export function getOriginalSourceFile<T extends SafeNode>(node: T, currentSourceFile: TS.SourceFile, typescript: typeof TS, print = false): TS.SourceFile {
export function getOriginalSourceFile<T extends SafeNode>(node: T, currentSourceFile: TS.SourceFile, typescript: typeof TS): TS.SourceFile {
const originalNode = getOriginalNode(node, typescript);
let sourceFile: TS.SourceFile|undefined = originalNode.getSourceFile();
if (sourceFile != null) return sourceFile;

if (print) console.log(originalNode);

if (originalNode._parent != null) {
if (originalNode._parent.kind === typescript.SyntaxKind.SourceFile) {
return originalNode._parent as TS.SourceFile;
Expand Down

0 comments on commit a513caa

Please sign in to comment.