Skip to content
This repository has been archived by the owner on Feb 16, 2024. It is now read-only.

Commit

Permalink
fix(parser): fix regex init
Browse files Browse the repository at this point in the history
  • Loading branch information
r4zendev committed Dec 21, 2023
1 parent f46cac6 commit 6b9b24f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions readme-parser/sync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ const findKeyLineRange = (yaml: string, key: string) => {
let startFound = false;

for (const [index, line] of splitYaml.entries()) {
if (startFound && line.match(/^[A-Za-z0-9_-]+:\s/)) {
if (startFound && /^[A-Za-z0-9_-]+:\s/.test(line)) {
fieldEndLine = index;
break;
}

if (line.match(`^${key}:\s`)) {
if (new RegExp(`^${key}:\s`).test(line)) {
fieldStartLine = index;
startFound = true;
}
Expand Down

0 comments on commit 6b9b24f

Please sign in to comment.