use directories for structure
This commit is contained in:
21
node_modules/page/index.js
generated
vendored
21
node_modules/page/index.js
generated
vendored
@@ -485,7 +485,6 @@
|
||||
* @param {string} href
|
||||
* @api public
|
||||
*/
|
||||
|
||||
Page.prototype.sameOrigin = function(href) {
|
||||
if(!href || !isLocation) return false;
|
||||
|
||||
@@ -493,9 +492,18 @@
|
||||
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
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -743,7 +751,7 @@
|
||||
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(this.path, this.keys = [], opts);
|
||||
@@ -761,7 +769,10 @@
|
||||
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();
|
||||
};
|
||||
};
|
||||
@@ -784,6 +795,8 @@
|
||||
|
||||
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]);
|
||||
|
24
node_modules/page/package.json
generated
vendored
24
node_modules/page/package.json
generated
vendored
@@ -1,28 +1,28 @@
|
||||
{
|
||||
"_from": "page@1.11.5",
|
||||
"_id": "page@1.11.5",
|
||||
"_from": "page@1.11.6",
|
||||
"_id": "page@1.11.6",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-0JXUHc7Y8p1cPJQbhZSwaKO3p+bU3Rgny+OM5gJMKHWHvJKan/fsE5RUzEjRQolv9DzPOSVWfSOHz0lLxK19eA==",
|
||||
"_integrity": "sha512-P6e2JfzkBrPeFCIPplLP7vDDiU84RUUZMrWdsH4ZBGJ8OosnwFkcUkBHp1DTIjuipLliw9yQn/ZJsXZvarsO+g==",
|
||||
"_location": "/page",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "page@1.11.5",
|
||||
"raw": "page@1.11.6",
|
||||
"name": "page",
|
||||
"escapedName": "page",
|
||||
"rawSpec": "1.11.5",
|
||||
"rawSpec": "1.11.6",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "1.11.5"
|
||||
"fetchSpec": "1.11.6"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"#USER",
|
||||
"/"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/page/-/page-1.11.5.tgz",
|
||||
"_shasum": "0cfc8608be337f26f4377f31df0787aef0ca1af7",
|
||||
"_spec": "page@1.11.5",
|
||||
"_where": "/home/s2/Code/vanillajs-seed",
|
||||
"_resolved": "https://registry.npmjs.org/page/-/page-1.11.6.tgz",
|
||||
"_shasum": "5ef4efc7073749b8085ccdaa0dcd7c9e0de12fe3",
|
||||
"_spec": "page@1.11.6",
|
||||
"_where": "D:\\Projects\\siag\\vanillajs-seed",
|
||||
"browser": "page.js",
|
||||
"bugs": {
|
||||
"url": "https://github.com/visionmedia/page.js/issues"
|
||||
@@ -81,9 +81,9 @@
|
||||
"scripts": {
|
||||
"engine-deps": "install-engine-dependencies",
|
||||
"make": "rollup -c rollup.config.js",
|
||||
"serve": "serve test",
|
||||
"serve": "serve test --symlinks",
|
||||
"test": "jshint index.js test/tests.js && mocha test/tests.js",
|
||||
"test-cov": "jscoverage index.js index-cov.js; PAGE_COV=1 mocha test/tests.js -R html-cov > coverage.html"
|
||||
},
|
||||
"version": "1.11.5"
|
||||
"version": "1.11.6"
|
||||
}
|
||||
|
30
node_modules/page/page.js
generated
vendored
30
node_modules/page/page.js
generated
vendored
@@ -406,7 +406,7 @@ pathToRegexp_1.tokensToRegExp = tokensToRegExp_1;
|
||||
* Module dependencies.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Short-cuts for global-object checks
|
||||
@@ -885,7 +885,6 @@ pathToRegexp_1.tokensToRegExp = tokensToRegExp_1;
|
||||
* @param {string} href
|
||||
* @api public
|
||||
*/
|
||||
|
||||
Page.prototype.sameOrigin = function(href) {
|
||||
if(!href || !isLocation) return false;
|
||||
|
||||
@@ -895,13 +894,16 @@ pathToRegexp_1.tokensToRegExp = tokensToRegExp_1;
|
||||
var loc = window.location;
|
||||
|
||||
/*
|
||||
when the port is the default http port 80, 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.
|
||||
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 === 80);
|
||||
(loc.port === url.port || loc.port === '' && (url.port == 80 || url.port == 443)); // jshint ignore:line
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -1126,11 +1128,8 @@ pathToRegexp_1.tokensToRegExp = tokensToRegExp_1;
|
||||
Context.prototype.save = function() {
|
||||
var page = this.page;
|
||||
if (hasHistory) {
|
||||
var pathWithoutQuerystring = this.path.replace('?' + this.querystring, '');
|
||||
pathWithoutQuerystring = pathWithoutQuerystring === '' ? '/' : pathWithoutQuerystring;
|
||||
|
||||
page._window.history.replaceState(this.state, this.title,
|
||||
page._hashbang && pathWithoutQuerystring !== '/' || this.querystring !== '' ? page._window.location.pathname + '#!' + this.path : this.canonicalPath);
|
||||
page._window.history.replaceState(this.state, this.title,
|
||||
page._hashbang && this.path !== '/' ? '#!' + this.path : this.canonicalPath);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1152,7 +1151,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);
|
||||
@@ -1170,7 +1169,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();
|
||||
};
|
||||
};
|
||||
@@ -1193,7 +1195,7 @@ pathToRegexp_1.tokensToRegExp = tokensToRegExp_1;
|
||||
|
||||
if (!m) return false;
|
||||
|
||||
delete params[0]
|
||||
delete params[0];
|
||||
|
||||
for (var i = 1, len = m.length; i < len; ++i) {
|
||||
var key = keys[i - 1];
|
||||
|
21
node_modules/page/page.mjs
generated
vendored
21
node_modules/page/page.mjs
generated
vendored
@@ -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]);
|
||||
|
Reference in New Issue
Block a user