From 1cf25bdc894096d04c9f2fb3d80d91a17ee46ed6 Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Sun, 28 Apr 2019 20:45:51 +0100 Subject: [PATCH] Use default exports & imports to try to avoid tree-shaking issues --- Client/Router.mjs | 2 +- Server/Router.mjs | 2 +- Shared/Pathspec.mjs | 4 +--- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/Client/Router.mjs b/Client/Router.mjs index 4d1f2b0..afa0f26 100644 --- a/Client/Router.mjs +++ b/Client/Router.mjs @@ -2,7 +2,7 @@ import EventEmitter from 'event-emitter-es6'; -import { pathspec_to_regex } from '../Shared/Pathspec.mjs'; +import pathspec_to_regex from '../Shared/Pathspec.mjs'; /** * Client-side request router. diff --git a/Server/Router.mjs b/Server/Router.mjs index bf9fa06..281946e 100644 --- a/Server/Router.mjs +++ b/Server/Router.mjs @@ -1,7 +1,7 @@ "use strict"; import RouterContext from './RouterContext.mjs'; -import { pathspec_to_regex } from '../Shared/Pathspec.mjs'; +import pathspec_to_regex from '../Shared/Pathspec.mjs'; /** * A standalone HTTP router that's based on the principle of middleware. diff --git a/Shared/Pathspec.mjs b/Shared/Pathspec.mjs index 6aef43c..f00e0e0 100644 --- a/Shared/Pathspec.mjs +++ b/Shared/Pathspec.mjs @@ -5,7 +5,7 @@ * @param {Boolean} verbose Optional. Whether to be verbose and log some stuff to the console. Default: false * @return {RegExp} The resulting regular expression */ -function pathspec_to_regex(pathspec, verbose = false) { +export default function pathspec_to_regex(pathspec, verbose = false) { if(pathspec == "*") // Support wildcards return { regex: /^/, tokens: [] }; @@ -24,5 +24,3 @@ function pathspec_to_regex(pathspec, verbose = false) { return { regex, tokens }; } - -export { pathspec_to_regex };