Initial
This commit is contained in:
58
resources/app/node_modules/parseurl/HISTORY.md
generated
vendored
Normal file
58
resources/app/node_modules/parseurl/HISTORY.md
generated
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
1.3.3 / 2019-04-15
|
||||
==================
|
||||
|
||||
* Fix Node.js 0.8 return value inconsistencies
|
||||
|
||||
1.3.2 / 2017-09-09
|
||||
==================
|
||||
|
||||
* perf: reduce overhead for full URLs
|
||||
* perf: unroll the "fast-path" `RegExp`
|
||||
|
||||
1.3.1 / 2016-01-17
|
||||
==================
|
||||
|
||||
* perf: enable strict mode
|
||||
|
||||
1.3.0 / 2014-08-09
|
||||
==================
|
||||
|
||||
* Add `parseurl.original` for parsing `req.originalUrl` with fallback
|
||||
* Return `undefined` if `req.url` is `undefined`
|
||||
|
||||
1.2.0 / 2014-07-21
|
||||
==================
|
||||
|
||||
* Cache URLs based on original value
|
||||
* Remove no-longer-needed URL mis-parse work-around
|
||||
* Simplify the "fast-path" `RegExp`
|
||||
|
||||
1.1.3 / 2014-07-08
|
||||
==================
|
||||
|
||||
* Fix typo
|
||||
|
||||
1.1.2 / 2014-07-08
|
||||
==================
|
||||
|
||||
* Seriously fix Node.js 0.8 compatibility
|
||||
|
||||
1.1.1 / 2014-07-08
|
||||
==================
|
||||
|
||||
* Fix Node.js 0.8 compatibility
|
||||
|
||||
1.1.0 / 2014-07-08
|
||||
==================
|
||||
|
||||
* Incorporate URL href-only parse fast-path
|
||||
|
||||
1.0.1 / 2014-03-08
|
||||
==================
|
||||
|
||||
* Add missing `require`
|
||||
|
||||
1.0.0 / 2014-03-08
|
||||
==================
|
||||
|
||||
* Genesis from `connect`
|
||||
24
resources/app/node_modules/parseurl/LICENSE
generated
vendored
Normal file
24
resources/app/node_modules/parseurl/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
|
||||
(The MIT License)
|
||||
|
||||
Copyright (c) 2014 Jonathan Ong <me@jongleberry.com>
|
||||
Copyright (c) 2014-2017 Douglas Christopher Wilson <doug@somethingdoug.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
'Software'), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
158
resources/app/node_modules/parseurl/index.js
generated
vendored
Normal file
158
resources/app/node_modules/parseurl/index.js
generated
vendored
Normal file
@@ -0,0 +1,158 @@
|
||||
/*!
|
||||
* parseurl
|
||||
* Copyright(c) 2014 Jonathan Ong
|
||||
* Copyright(c) 2014-2017 Douglas Christopher Wilson
|
||||
* MIT Licensed
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
/**
|
||||
* Module dependencies.
|
||||
* @private
|
||||
*/
|
||||
|
||||
var url = require('url')
|
||||
var parse = url.parse
|
||||
var Url = url.Url
|
||||
|
||||
/**
|
||||
* Module exports.
|
||||
* @public
|
||||
*/
|
||||
|
||||
module.exports = parseurl
|
||||
module.exports.original = originalurl
|
||||
|
||||
/**
|
||||
* Parse the `req` url with memoization.
|
||||
*
|
||||
* @param {ServerRequest} req
|
||||
* @return {Object}
|
||||
* @public
|
||||
*/
|
||||
|
||||
function parseurl (req) {
|
||||
var url = req.url
|
||||
|
||||
if (url === undefined) {
|
||||
// URL is undefined
|
||||
return undefined
|
||||
}
|
||||
|
||||
var parsed = req._parsedUrl
|
||||
|
||||
if (fresh(url, parsed)) {
|
||||
// Return cached URL parse
|
||||
return parsed
|
||||
}
|
||||
|
||||
// Parse the URL
|
||||
parsed = fastparse(url)
|
||||
parsed._raw = url
|
||||
|
||||
return (req._parsedUrl = parsed)
|
||||
};
|
||||
|
||||
/**
|
||||
* Parse the `req` original url with fallback and memoization.
|
||||
*
|
||||
* @param {ServerRequest} req
|
||||
* @return {Object}
|
||||
* @public
|
||||
*/
|
||||
|
||||
function originalurl (req) {
|
||||
var url = req.originalUrl
|
||||
|
||||
if (typeof url !== 'string') {
|
||||
// Fallback
|
||||
return parseurl(req)
|
||||
}
|
||||
|
||||
var parsed = req._parsedOriginalUrl
|
||||
|
||||
if (fresh(url, parsed)) {
|
||||
// Return cached URL parse
|
||||
return parsed
|
||||
}
|
||||
|
||||
// Parse the URL
|
||||
parsed = fastparse(url)
|
||||
parsed._raw = url
|
||||
|
||||
return (req._parsedOriginalUrl = parsed)
|
||||
};
|
||||
|
||||
/**
|
||||
* Parse the `str` url with fast-path short-cut.
|
||||
*
|
||||
* @param {string} str
|
||||
* @return {Object}
|
||||
* @private
|
||||
*/
|
||||
|
||||
function fastparse (str) {
|
||||
if (typeof str !== 'string' || str.charCodeAt(0) !== 0x2f /* / */) {
|
||||
return parse(str)
|
||||
}
|
||||
|
||||
var pathname = str
|
||||
var query = null
|
||||
var search = null
|
||||
|
||||
// This takes the regexp from https://github.com/joyent/node/pull/7878
|
||||
// Which is /^(\/[^?#\s]*)(\?[^#\s]*)?$/
|
||||
// And unrolls it into a for loop
|
||||
for (var i = 1; i < str.length; i++) {
|
||||
switch (str.charCodeAt(i)) {
|
||||
case 0x3f: /* ? */
|
||||
if (search === null) {
|
||||
pathname = str.substring(0, i)
|
||||
query = str.substring(i + 1)
|
||||
search = str.substring(i)
|
||||
}
|
||||
break
|
||||
case 0x09: /* \t */
|
||||
case 0x0a: /* \n */
|
||||
case 0x0c: /* \f */
|
||||
case 0x0d: /* \r */
|
||||
case 0x20: /* */
|
||||
case 0x23: /* # */
|
||||
case 0xa0:
|
||||
case 0xfeff:
|
||||
return parse(str)
|
||||
}
|
||||
}
|
||||
|
||||
var url = Url !== undefined
|
||||
? new Url()
|
||||
: {}
|
||||
|
||||
url.path = str
|
||||
url.href = str
|
||||
url.pathname = pathname
|
||||
|
||||
if (search !== null) {
|
||||
url.query = query
|
||||
url.search = search
|
||||
}
|
||||
|
||||
return url
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if parsed is still fresh for url.
|
||||
*
|
||||
* @param {string} url
|
||||
* @param {object} parsedUrl
|
||||
* @return {boolean}
|
||||
* @private
|
||||
*/
|
||||
|
||||
function fresh (url, parsedUrl) {
|
||||
return typeof parsedUrl === 'object' &&
|
||||
parsedUrl !== null &&
|
||||
(Url === undefined || parsedUrl instanceof Url) &&
|
||||
parsedUrl._raw === url
|
||||
}
|
||||
29
resources/app/node_modules/parseurl/package.json
generated
vendored
Normal file
29
resources/app/node_modules/parseurl/package.json
generated
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
{
|
||||
"name": "parseurl",
|
||||
"description": "parse a url with memoization",
|
||||
"version": "1.3.3",
|
||||
"repository": "pillarjs/parseurl",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"beautify-benchmark": "0.2.4",
|
||||
"benchmark": "2.1.4",
|
||||
"eslint": "5.16.0",
|
||||
"eslint-config-standard": "12.0.0",
|
||||
"eslint-plugin-import": "2.17.1",
|
||||
"eslint-plugin-node": "7.0.1",
|
||||
"eslint-plugin-promise": "4.1.1",
|
||||
"eslint-plugin-standard": "4.0.0",
|
||||
"fast-url-parser": "1.1.3",
|
||||
"istanbul": "0.4.5",
|
||||
"mocha": "6.1.3"
|
||||
},
|
||||
"files": [
|
||||
"LICENSE",
|
||||
"HISTORY.md",
|
||||
"README.md",
|
||||
"index.js"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user