From cd0e440593f2d95702ba3fc0d6004b8e33a8a8d2 Mon Sep 17 00:00:00 2001 From: Charlie Greenman Date: Wed, 25 Oct 2023 15:46:20 -0400 Subject: [PATCH] update return --- src/rz/angular/ast-to-html/ast-to-html.ts | 6 ++++-- tsconfig.spec.json | 10 ++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 tsconfig.spec.json diff --git a/src/rz/angular/ast-to-html/ast-to-html.ts b/src/rz/angular/ast-to-html/ast-to-html.ts index ef1d30e..ba7d082 100644 --- a/src/rz/angular/ast-to-html/ast-to-html.ts +++ b/src/rz/angular/ast-to-html/ast-to-html.ts @@ -9,7 +9,7 @@ // Text, // } from "angular-html-parser/lib/compiler/src/ml_parser/ast"; -export function astToHtml(rootNodes: any): string { +export function astToHtml(rootNodes: any): any { return rootNodes.map(nodeToString).join(""); } @@ -27,9 +27,11 @@ export function astToHtml(rootNodes: any): string { return docTypeToString(node); case "comment": return commentToString(node); + default: + return '' } } - function elementToString(node: any): string { + function elementToString(node: any): any { return `<${node.name}${astToHtml(node.attrs)}>${astToHtml(node.children)}`; diff --git a/tsconfig.spec.json b/tsconfig.spec.json new file mode 100644 index 0000000..958dfb3 --- /dev/null +++ b/tsconfig.spec.json @@ -0,0 +1,10 @@ +{ + "extends": "./tsconfig.base.json", + "compilerOptions": { + "outDir": "../../dist/out-tsc", + "module": "commonjs", + "types": ["jest", "node"] + }, + "include": ["**/*.spec.ts", "**/*.d.ts", "jest.config.ts"] + } + \ No newline at end of file