Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
perf: replace startsWith with strict equality
  • Loading branch information
btea committed Sep 9, 2025
commit bbadc382b3327062e6454a69039948e153c4c772
2 changes: 1 addition & 1 deletion src/parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@ export default class Parser {
if (space.endsWith(' ') && rawSpace.endsWith(' ')) {
spaces.before = space.slice(0, space.length - 1);
raws.spaces.before = rawSpace.slice(0, rawSpace.length - 1);
} else if (space.startsWith(' ') && rawSpace.startsWith(' ')) {
} else if (space[0] === ' ' && rawSpace[0] === ' ') {
spaces.after = space.slice(1);
raws.spaces.after = rawSpace.slice(1);
} else {
Expand Down