Skip to content

Commit 3da25fe

Browse files
authored
perf: replace startsWith with strict equality (#308)
1 parent b647f7c commit 3da25fe

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/parser.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,7 @@ export default class Parser {
581581
if (space.endsWith(' ') && rawSpace.endsWith(' ')) {
582582
spaces.before = space.slice(0, space.length - 1);
583583
raws.spaces.before = rawSpace.slice(0, rawSpace.length - 1);
584-
} else if (space.startsWith(' ') && rawSpace.startsWith(' ')) {
584+
} else if (space[0] === ' ' && rawSpace[0] === ' ') {
585585
spaces.after = space.slice(1);
586586
raws.spaces.after = rawSpace.slice(1);
587587
} else {

0 commit comments

Comments
 (0)