From ef2bbc9812461fdb2fe99008d33c3d89fa490940 Mon Sep 17 00:00:00 2001 From: kts of kettek Date: Wed, 16 Mar 2022 17:13:59 -0700 Subject: [PATCH] Don't mutate crumbs --- plugins/srd-aedifex-router/route.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/srd-aedifex-router/route.js b/plugins/srd-aedifex-router/route.js index 60d5e53..7d7f5ca 100644 --- a/plugins/srd-aedifex-router/route.js +++ b/plugins/srd-aedifex-router/route.js @@ -43,7 +43,7 @@ module.exports = (plugin, app) => { // build the location let loc = ''+app.live.conf['shortname']+'' let crumbs = req.path.split('/') - let title = crumbs.reverse().filter(v=>v!==''&&v!=='db').map(v=>v.charAt(0).toUpperCase()+v.slice(1)).join(' - ') + let title = [...crumbs].reverse().filter(v=>v!==''&&v!=='db').map(v=>v.charAt(0).toUpperCase()+v.slice(1)).join(' - ') for (let i = 1; i < crumbs.length; i++) { if (crumbs[i] == '') continue loc += ' → '+(crumbs[i].replace('-', ' '))+''