From bed627ad825c5395fff984d161eaa63861d03d30 Mon Sep 17 00:00:00 2001 From: Timo Hocker Date: Wed, 8 Jan 2020 08:42:55 +0100 Subject: [PATCH] fix --- index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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, '/')