Skip to content

Commit

Permalink
update return
Browse files Browse the repository at this point in the history
  • Loading branch information
CharlieGreenman committed Oct 25, 2023
1 parent a44b797 commit cd0e440
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/rz/angular/ast-to-html/ast-to-html.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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("");
}

Expand All @@ -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)}</${
node.name
}>`;
Expand Down
10 changes: 10 additions & 0 deletions tsconfig.spec.json
Original file line number Diff line number Diff line change
@@ -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"]
}

0 comments on commit cd0e440

Please sign in to comment.