From eabb5705bd3cd370d1806f2a010769b3ee15efd8 Mon Sep 17 00:00:00 2001 From: Timo Hocker Date: Wed, 8 Jan 2020 08:47:35 +0100 Subject: [PATCH] fix --- index.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 0523485..6e63e28 100644 --- a/index.js +++ b/index.js @@ -27,8 +27,12 @@ module.exports = function main ( for (const f of fs.readdirSync (modulefolder)) { const regex = /(?.*?)-(?.*?)\.js/u; const { groups } = regex.exec (f); - if ('undefined' !== typeof subdir) + + if ('undefined' === typeof subdir) + groups.url = `/${groups.url}/`; + else groups.url = `/${subdir}/${groups.url}/`; + groups.url = groups.url .replace (/^\/[^/]*\/root/iu, '/') .replace (/\./gu, '/')