diff --git a/index.js b/index.js index 9762d26..0523485 100644 --- a/index.js +++ b/index.js @@ -27,7 +27,8 @@ module.exports = function main ( for (const f of fs.readdirSync (modulefolder)) { const regex = /(?.*?)-(?.*?)\.js/u; const { groups } = regex.exec (f); - groups.url = `/${subdir}/${groups.url}/`; + if ('undefined' !== typeof subdir) + groups.url = `/${subdir}/${groups.url}/`; groups.url = groups.url .replace (/^\/[^/]*\/root/iu, '/') .replace (/\./gu, '/')