summaryrefslogtreecommitdiff
path: root/src/compiler/optimize
diff options
context:
space:
mode:
authorGravatar matthewp <matthewp@users.noreply.github.com> 2021-03-30 14:52:09 +0000
committerGravatar GitHub Actions <actions@github.com> 2021-03-30 14:52:09 +0000
commitd267fa461b73586118437e190b92b9956f9add73 (patch)
tree50ea72167bb016146fc007abe99c4d72d7e1cd49 /src/compiler/optimize
parent3b27eaac4384e82e7f08122f0797a9671470781a (diff)
downloadastro-d267fa461b73586118437e190b92b9956f9add73.tar.gz
astro-d267fa461b73586118437e190b92b9956f9add73.tar.zst
astro-d267fa461b73586118437e190b92b9956f9add73.zip
[ci] npm run format
Diffstat (limited to 'src/compiler/optimize')
-rw-r--r--src/compiler/optimize/doctype.ts21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/compiler/optimize/doctype.ts b/src/compiler/optimize/doctype.ts
index a666876bf..fdf6c4078 100644
--- a/src/compiler/optimize/doctype.ts
+++ b/src/compiler/optimize/doctype.ts
@@ -8,26 +8,27 @@ export default function (_opts: { filename: string; fileID: string }): Optimizer
html: {
Element: {
enter(node, parent, _key, index) {
- if(node.name === '!doctype') {
+ if (node.name === '!doctype') {
hasDoctype = true;
}
- if(node.name === 'html' && !hasDoctype) {
+ if (node.name === 'html' && !hasDoctype) {
const dtNode = {
- start: 0, end: 0,
+ start: 0,
+ end: 0,
attributes: [{ type: 'Attribute', name: 'html', value: true, start: 0, end: 0 }],
children: [],
name: '!doctype',
- type: 'Element'
+ type: 'Element',
};
parent.children!.splice(index, 0, dtNode);
hasDoctype = true;
}
- }
- }
- }
+ },
+ },
+ },
},
async finalize() {
// Nothing happening here.
- }
- }
-} \ No newline at end of file
+ },
+ };
+}