Skip to content

Commit

Permalink
simplify function
Browse files Browse the repository at this point in the history
  • Loading branch information
bumblehead committed Feb 25, 2024
1 parent 1ce346f commit e507623
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions resolvewithplus.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ const getesmkeyvalglobreplaced = (esmkey, esmval, pathlocal) => {
// ex,
// ('./mystuff', './*', './src/*/index.js') => './src/mystuff/index.js'
// ('./mystuff/index', './*', './src/*.js') => './src/mystuff/index.js'
const getesmkeyidpathrefpathexpanded = (idpath, esmkey, refpath, xp = null) => {
const getesmkeyidpathrefpathexpanded = (idpath, esmkey, refpath) => {
const asteriskIndex = esmkey.indexOf('*') || 0
const asteriskBefore = esmkey.slice(0, asteriskIndex)
const asteriskAfter = esmkey.slice(asteriskIndex + 1)
Expand All @@ -216,9 +216,7 @@ const getesmkeyidpathrefpathexpanded = (idpath, esmkey, refpath, xp = null) => {
.slice(-asteriskAfter)
.slice(asteriskBefore.length)

xp = refpath.replace('*', asteriskFromIdPath)

return xp
return refpath.replace('*', asteriskFromIdPath)
}

// esm patterns may have globby key AND path values as in this example,
Expand Down

0 comments on commit e507623

Please sign in to comment.