Use default exports & imports to try to avoid tree-shaking issues

This commit is contained in:
Starbeamrainbowlabs 2019-04-28 20:45:51 +01:00
parent c9539a956d
commit 1cf25bdc89
Signed by: sbrl
GPG Key ID: 1BE5172E637709C2
3 changed files with 3 additions and 5 deletions

View File

@ -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.

View File

@ -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.

View File

@ -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 };