mirror of
https://github.com/kevin-DL/sapper.git
synced 2026-01-12 03:05:12 +00:00
always create valid route id
This commit is contained in:
@@ -8,7 +8,7 @@ module.exports = function create_matchers(files) {
|
||||
const parts = file.replace(/\.(html|js|mjs)$/, '').split(path.sep);
|
||||
if (parts[parts.length - 1] === 'index') parts.pop();
|
||||
|
||||
const id = parts.join('_').replace(/[[\]]/g, '$');
|
||||
const id = parts.join('_').replace(/[[\]]/g, '$') || '_';
|
||||
|
||||
const dynamic = parts
|
||||
.filter(part => part[0] === '[')
|
||||
|
||||
Reference in New Issue
Block a user