-
Notifications
You must be signed in to change notification settings - Fork 256
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
4,628 additions
and
4,289 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
986 changes: 498 additions & 488 deletions
986
doc/real-world-samples/dependency-cruiser-dir-graph.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2,796 changes: 1,409 additions & 1,387 deletions
2,796
doc/real-world-samples/dependency-cruiser-without-node_modules.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2,796 changes: 1,409 additions & 1,387 deletions
2,796
docs/dependency-cruiser-dependency-graph.html
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/* eslint-disable no-magic-numbers */ | ||
/* eslint-disable no-console */ | ||
|
||
/* eslint-disable max-depth */ | ||
/* eslint-disable security/detect-object-injection */ | ||
|
||
import { createSourceFile, SyntaxKind } from "typescript"; | ||
|
||
function keyIsBoring(pKey) { | ||
return [ | ||
"parent", | ||
"pos", | ||
"end", | ||
"flags", | ||
"emitNode", | ||
"modifierFlagsCache", | ||
"transformFlags", | ||
"id", | ||
"flowNode", | ||
"symbol", | ||
"original", | ||
"__proto__", | ||
"constructor", | ||
].includes(pKey); | ||
} | ||
|
||
export function walkForPrinting(pObject) { | ||
if (Array.isArray(pObject)) { | ||
return pObject.map((pValue) => walkForPrinting(pValue)); | ||
} | ||
if (typeof pObject === "object") { | ||
const lNewObject = {}; | ||
for (const lKey in pObject) { | ||
if (!keyIsBoring(lKey) && pObject[lKey]) { | ||
if (lKey === "kind") { | ||
lNewObject.kind = SyntaxKind[pObject.kind]; | ||
} else { | ||
lNewObject[lKey] = walkForPrinting(pObject[lKey]); | ||
} | ||
} | ||
} | ||
return lNewObject; | ||
} | ||
return pObject; | ||
} | ||
|
||
const lAST = createSourceFile( | ||
"xx", | ||
"/** @type {import('./hello.mjs')|import('./goodbye.mjs')} */", | ||
false, | ||
); | ||
|
||
console.log(JSON.stringify(walkForPrinting(lAST), null, 2)); |
Large diffs are not rendered by default.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.