diff --git a/package.json b/package.json index edf927e..2d0c3e2 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,6 @@ "eslint": "^4.13.1", "eslint-plugin-import": "^2.8.0", "express": "^4.16.3", - "get-port": "^3.2.0", "mocha": "^5.0.4", "nightmare": "^3.0.0", "npm-run-all": "^4.1.2", @@ -60,7 +59,6 @@ "serve-static": "^1.13.2", "svelte": "^2.4.4", "svelte-loader": "^2.9.0", - "ts-node": "^6.0.2", "typescript": "^2.8.3", "walk-sync": "^0.3.2", "webpack": "^4.1.0" diff --git a/src/core/create_routes.ts b/src/core/create_routes.ts index a5195d7..276cc97 100644 --- a/src/core/create_routes.ts +++ b/src/core/create_routes.ts @@ -23,6 +23,7 @@ export default function create_routes({ files } = { files: glob.sync('**/*.*', { parts }; }) + .filter(Boolean) .filter((a, index, array) => { const found = array.slice(index + 1).find(b => a.base === b.base); if (found) found.files.push(...a.files); diff --git a/test/unit/create_routes.test.js b/test/unit/create_routes.test.js index 29ec452..e4e33f6 100644 --- a/test/unit/create_routes.test.js +++ b/test/unit/create_routes.test.js @@ -20,11 +20,11 @@ describe('create_routes', () => { file: 'foo.html' } ] - ] - ) - }); - - it('encodes caharcters not allowed in path', () => { + ] + ) + }); + + it('encodes characters not allowed in path', () => { const routes = create_routes({ files: [ '"', @@ -178,7 +178,7 @@ describe('create_routes', () => { }); assert.deepEqual( - routes.map(r => r.file), + routes.map(r => r.handlers[0].file), ['.well-known'] ); });