* change root dit and change way to import modules * update deps to latest versions * use latest tools for building bundles * rewrite webpack config * use nomodule technique for loading modern bundle * inject polyfills by babel usebuiltins * update eslint rules * rename all style files to CSS * use postcss preset env for building styles * proper typescript typing * put all html files to templates folder * etc
23 lines
513 B
TypeScript
23 lines
513 B
TypeScript
import { Node } from 'common/types';
|
|
|
|
/**
|
|
* Function to debug node tree.
|
|
*/
|
|
export function debugNode(n: Node): Node {
|
|
const d = (n: Node, level: number): void => {
|
|
// eslint-disable-next-line no-console
|
|
console.log(
|
|
`${' '.repeat(level)}${n.comment.text.trim()} | id: ${n.comment.id} | delete: ${n.comment.delete} | pin: ${
|
|
n.comment.pin
|
|
}`
|
|
);
|
|
if (n.replies) {
|
|
for (const node of n.replies) {
|
|
d(node, level + 1);
|
|
}
|
|
}
|
|
};
|
|
d(n, 0);
|
|
return n;
|
|
}
|