summaryrefslogtreecommitdiff
path: root/packages/astro-parser/src/parse
diff options
context:
space:
mode:
authorGravatar Carter Snook <cartersnook04@gmail.com> 2021-07-17 14:39:11 -0500
committerGravatar GitHub <noreply@github.com> 2021-07-17 15:39:11 -0400
commitb8a90b1e7dd1f098ff855301cf1b09a324759ce4 (patch)
tree527e8e09b34fd1c0850e5eff84e34195dcbf99a4 /packages/astro-parser/src/parse
parent304e1c65e67b6fa8feccf9bd998dfd996669bf1d (diff)
downloadastro-b8a90b1e7dd1f098ff855301cf1b09a324759ce4.tar.gz
astro-b8a90b1e7dd1f098ff855301cf1b09a324759ce4.tar.zst
astro-b8a90b1e7dd1f098ff855301cf1b09a324759ce4.zip
feat(parser): remove trim utils (#728)
Diffstat (limited to 'packages/astro-parser/src/parse')
-rw-r--r--packages/astro-parser/src/parse/state/mustache.ts5
1 files changed, 2 insertions, 3 deletions
diff --git a/packages/astro-parser/src/parse/state/mustache.ts b/packages/astro-parser/src/parse/state/mustache.ts
index 79372d8d9..d07162049 100644
--- a/packages/astro-parser/src/parse/state/mustache.ts
+++ b/packages/astro-parser/src/parse/state/mustache.ts
@@ -2,7 +2,6 @@ import read_context from '../read/context.js';
import read_expression from '../read/expression.js';
import { closing_tag_omitted } from '../utils/html.js';
import { whitespace } from '../../utils/patterns.js';
-import { trim_start, trim_end } from '../../utils/trim.js';
import { to_string } from '../utils/node.js';
import { Parser } from '../index.js';
import { TemplateNode } from '../../interfaces.js';
@@ -16,12 +15,12 @@ function trim_whitespace(block: TemplateNode, trim_before: boolean, trim_after:
const last_child = block.children[block.children.length - 1];
if (first_child.type === 'Text' && trim_before) {
- first_child.data = trim_start(first_child.data);
+ first_child.data = first_child.data.trimStart();
if (!first_child.data) block.children.shift();
}
if (last_child.type === 'Text' && trim_after) {
- last_child.data = trim_end(last_child.data);
+ last_child.data = last_child.data.trimEnd();
if (!last_child.data) block.children.pop();
}