1
0
Fork 0
mirror of https://github.com/sbrl/powahroot.git synced 2024-11-27 00:13:01 +00:00

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 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. * Client-side request router.

View file

@ -1,7 +1,7 @@
"use strict"; "use strict";
import RouterContext from './RouterContext.mjs'; 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. * 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 * @param {Boolean} verbose Optional. Whether to be verbose and log some stuff to the console. Default: false
* @return {RegExp} The resulting regular expression * @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 if(pathspec == "*") // Support wildcards
return { regex: /^/, tokens: [] }; return { regex: /^/, tokens: [] };
@ -24,5 +24,3 @@ function pathspec_to_regex(pathspec, verbose = false) {
return { regex, tokens }; return { regex, tokens };
} }
export { pathspec_to_regex };