use directories for structure

This commit is contained in:
s2
2020-05-26 10:37:57 +02:00
parent 66580d4847
commit ae4aaf2668
1287 changed files with 92093 additions and 13113 deletions

21
node_modules/page/page.mjs generated vendored
View File

@@ -879,7 +879,6 @@ pathToRegexp_1.tokensToRegExp = tokensToRegExp_1;
* @param {string} href
* @api public
*/
Page.prototype.sameOrigin = function(href) {
if(!href || !isLocation) return false;
@@ -887,9 +886,18 @@ pathToRegexp_1.tokensToRegExp = tokensToRegExp_1;
var window = this._window;
var loc = window.location;
/*
When the port is the default http port 80 for http, or 443 for
https, internet explorer 11 returns an empty string for loc.port,
so we need to compare loc.port with an empty string if url.port
is the default port 80 or 443.
Also the comparition with `port` is changed from `===` to `==` because
`port` can be a string sometimes. This only applies to ie11.
*/
return loc.protocol === url.protocol &&
loc.hostname === url.hostname &&
loc.port === url.port;
(loc.port === url.port || loc.port === '' && (url.port == 80 || url.port == 443)); // jshint ignore:line
};
/**
@@ -1137,7 +1145,7 @@ pathToRegexp_1.tokensToRegExp = tokensToRegExp_1;
function Route(path, options, page) {
var _page = this.page = page || globalPage;
var opts = options || {};
opts.strict = opts.strict || page._strict;
opts.strict = opts.strict || _page._strict;
this.path = (path === '*') ? '(.*)' : path;
this.method = 'GET';
this.regexp = pathToRegexp_1(this.path, this.keys = [], opts);
@@ -1155,7 +1163,10 @@ pathToRegexp_1.tokensToRegExp = tokensToRegExp_1;
Route.prototype.middleware = function(fn) {
var self = this;
return function(ctx, next) {
if (self.match(ctx.path, ctx.params)) return fn(ctx, next);
if (self.match(ctx.path, ctx.params)) {
ctx.routePath = self.path;
return fn(ctx, next);
}
next();
};
};
@@ -1178,6 +1189,8 @@ pathToRegexp_1.tokensToRegExp = tokensToRegExp_1;
if (!m) return false;
delete params[0];
for (var i = 1, len = m.length; i < len; ++i) {
var key = keys[i - 1];
var val = this.page._decodeURLEncodedURIComponent(m[i]);