mirror of
https://github.com/sbrl/powahroot.git
synced 2024-11-23 06:33:02 +00:00
Use default exports & imports to try to avoid tree-shaking issues
This commit is contained in:
parent
c9539a956d
commit
1cf25bdc89
3 changed files with 3 additions and 5 deletions
|
@ -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.
|
||||||
|
|
|
@ -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.
|
||||||
|
|
|
@ -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 };
|
|
||||||
|
|
Loading…
Reference in a new issue