From 6b9b24f6ccce1b815663740039571e6f9f6a7d26 Mon Sep 17 00:00:00 2001 From: Sasha Mysak Date: Thu, 21 Dec 2023 17:18:56 +0100 Subject: [PATCH] fix(parser): fix regex init --- readme-parser/sync.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/readme-parser/sync.ts b/readme-parser/sync.ts index 78c4d561..537dff58 100644 --- a/readme-parser/sync.ts +++ b/readme-parser/sync.ts @@ -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; }