Skip to content

Commit

Permalink
πŸ› fix unterminated group in regex
Browse files Browse the repository at this point in the history
  • Loading branch information
nberlette committed Aug 7, 2022
1 parent b5cb2e2 commit 0433b7a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,11 @@ export async function prepublish(version: string) {
const filename of [
"README.md",
"mod.ts",
"types.d.ts",
]
) {
await bump(filename, version);
}

return false;
}

/** `postpublish` will be invoked after publish */
Expand All @@ -29,7 +28,7 @@ export function postpublish(version: string) {
async function bump(filename: string, version: string) {
try {
const module_regex = new RegExp(
`(?<=[/"'\s](${MODULE})[@]([{]{1,2}VERSION[}]{1,2}|\$VERSION|[^/"'\s]+)(?=[/"'\s])`,
`(?<=[/"'\s])(${MODULE})[@]([{]{1,2}VERSION[}]{1,2}|\$VERSION|[^/"'\s]+)(?=[/"'\s])`,
"ig",
);
const content = await Deno.readTextFile(filename);
Expand Down

0 comments on commit 0433b7a

Please sign in to comment.