Skip to content

Commit

Permalink
switch to regex-based replace
Browse files Browse the repository at this point in the history
  • Loading branch information
BolajiOlajide committed Nov 28, 2023
1 parent dd52e1f commit 45df4ca
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions src/utils.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,3 @@
export function stripTestPlanFromPRBody(body: string): string {
const startDelimiter = '<!--';
const endDelimiter = '-->';

let startIndex = body.indexOf(startDelimiter);
if (startIndex === -1) {
return body;
}

let endIndex = body.indexOf(endDelimiter, startIndex + startDelimiter.length);
if (endIndex === -1) {
return body;
}

return body.slice(0, startIndex) + body.slice(endIndex + endDelimiter.length);
return body.replace(/<!--[\s\S]*?-->/g, '');
};

0 comments on commit 45df4ca

Please sign in to comment.