Skip to content

Commit

Permalink
use replace function to handle comma match scenarious
Browse files Browse the repository at this point in the history
  • Loading branch information
bumblehead committed Jan 14, 2024
1 parent 9ec57fd commit 1168a89
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/esmockModule.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@ const esmockModuleCreate = async (treeid, def, id, fileURL, opt) => {
'isfound=' + Boolean(fileURL),
'isesm=' + esmockModuleIsESM(fileURL),
'exportNames=' + Object.keys(def).sort().join()
.replace(reservedKeywordsFoundInWild, '')
.replace(reservedKeywordsFoundInWild, a => (
a.startsWith(',') && a.endsWith(',') ? ',' : ''))
].join('&')

if (isJSONExtnRe.test(fileURL)) {
Expand Down

0 comments on commit 1168a89

Please sign in to comment.