summaryrefslogtreecommitdiff
path: root/src/parser/utils/trim.ts
diff options
context:
space:
mode:
authorGravatar Drew Powers <1369770+drwpow@users.noreply.github.com> 2021-04-01 10:25:28 -0600
committerGravatar GitHub <noreply@github.com> 2021-04-01 10:25:28 -0600
commitc26c244ca2634d462616d6cf71072fbe26becba2 (patch)
tree1bd5e83eff9ca88200aacb272c84439f192015ec /src/parser/utils/trim.ts
parentf6a7ac67befff863e34133673efb78ea7ac0fe48 (diff)
downloadastro-c26c244ca2634d462616d6cf71072fbe26becba2.tar.gz
astro-c26c244ca2634d462616d6cf71072fbe26becba2.tar.zst
astro-c26c244ca2634d462616d6cf71072fbe26becba2.zip
Annoying Lint PR #2 (#47)
Diffstat (limited to 'src/parser/utils/trim.ts')
-rw-r--r--src/parser/utils/trim.ts2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/parser/utils/trim.ts b/src/parser/utils/trim.ts
index 406a8c97f..480cc99a8 100644
--- a/src/parser/utils/trim.ts
+++ b/src/parser/utils/trim.ts
@@ -1,5 +1,6 @@
import { whitespace } from './patterns.js';
+/** Trim whitespace from start of string */
export function trim_start(str: string) {
let i = 0;
while (whitespace.test(str[i])) i += 1;
@@ -7,6 +8,7 @@ export function trim_start(str: string) {
return str.slice(i);
}
+/** Trim whitespace from end of string */
export function trim_end(str: string) {
let i = str.length;
while (whitespace.test(str[i - 1])) i -= 1;