Template Upload
This commit is contained in:
47
node_modules/parseurl/HISTORY.md
generated
vendored
Normal file
47
node_modules/parseurl/HISTORY.md
generated
vendored
Normal file
@ -0,0 +1,47 @@
|
||||
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
node_modules/parseurl/LICENSE
generated
vendored
Normal file
24
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 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.
|
120
node_modules/parseurl/README.md
generated
vendored
Normal file
120
node_modules/parseurl/README.md
generated
vendored
Normal file
@ -0,0 +1,120 @@
|
||||
# parseurl
|
||||
|
||||
[![NPM Version][npm-image]][npm-url]
|
||||
[![NPM Downloads][downloads-image]][downloads-url]
|
||||
[![Node.js Version][node-version-image]][node-version-url]
|
||||
[![Build Status][travis-image]][travis-url]
|
||||
[![Test Coverage][coveralls-image]][coveralls-url]
|
||||
|
||||
Parse a URL with memoization.
|
||||
|
||||
## Install
|
||||
|
||||
```bash
|
||||
$ npm install parseurl
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
```js
|
||||
var parseurl = require('parseurl')
|
||||
```
|
||||
|
||||
### parseurl(req)
|
||||
|
||||
Parse the URL of the given request object (looks at the `req.url` property)
|
||||
and return the result. The result is the same as `url.parse` in Node.js core.
|
||||
Calling this function multiple times on the same `req` where `req.url` does
|
||||
not change will return a cached parsed object, rather than parsing again.
|
||||
|
||||
### parseurl.original(req)
|
||||
|
||||
Parse the original URL of the given request object and return the result.
|
||||
This works by trying to parse `req.originalUrl` if it is a string, otherwise
|
||||
parses `req.url`. The result is the same as `url.parse` in Node.js core.
|
||||
Calling this function multiple times on the same `req` where `req.originalUrl`
|
||||
does not change will return a cached parsed object, rather than parsing again.
|
||||
|
||||
## Benchmark
|
||||
|
||||
```bash
|
||||
$ npm run-script bench
|
||||
|
||||
> parseurl@1.3.1 bench nodejs-parseurl
|
||||
> node benchmark/index.js
|
||||
|
||||
> node benchmark/fullurl.js
|
||||
|
||||
Parsing URL "http://localhost:8888/foo/bar?user=tj&pet=fluffy"
|
||||
|
||||
1 test completed.
|
||||
2 tests completed.
|
||||
3 tests completed.
|
||||
|
||||
fasturl x 1,290,780 ops/sec ±0.46% (195 runs sampled)
|
||||
nativeurl x 56,401 ops/sec ±0.22% (196 runs sampled)
|
||||
parseurl x 55,231 ops/sec ±0.22% (194 runs sampled)
|
||||
|
||||
> node benchmark/pathquery.js
|
||||
|
||||
Parsing URL "/foo/bar?user=tj&pet=fluffy"
|
||||
|
||||
1 test completed.
|
||||
2 tests completed.
|
||||
3 tests completed.
|
||||
|
||||
fasturl x 1,986,668 ops/sec ±0.27% (190 runs sampled)
|
||||
nativeurl x 98,740 ops/sec ±0.21% (195 runs sampled)
|
||||
parseurl x 2,628,171 ops/sec ±0.36% (195 runs sampled)
|
||||
|
||||
> node benchmark/samerequest.js
|
||||
|
||||
Parsing URL "/foo/bar?user=tj&pet=fluffy" on same request object
|
||||
|
||||
1 test completed.
|
||||
2 tests completed.
|
||||
3 tests completed.
|
||||
|
||||
fasturl x 2,184,468 ops/sec ±0.40% (194 runs sampled)
|
||||
nativeurl x 99,437 ops/sec ±0.71% (194 runs sampled)
|
||||
parseurl x 10,498,005 ops/sec ±0.61% (186 runs sampled)
|
||||
|
||||
> node benchmark/simplepath.js
|
||||
|
||||
Parsing URL "/foo/bar"
|
||||
|
||||
1 test completed.
|
||||
2 tests completed.
|
||||
3 tests completed.
|
||||
|
||||
fasturl x 4,535,825 ops/sec ±0.27% (191 runs sampled)
|
||||
nativeurl x 98,769 ops/sec ±0.54% (191 runs sampled)
|
||||
parseurl x 4,164,865 ops/sec ±0.34% (192 runs sampled)
|
||||
|
||||
> node benchmark/slash.js
|
||||
|
||||
Parsing URL "/"
|
||||
|
||||
1 test completed.
|
||||
2 tests completed.
|
||||
3 tests completed.
|
||||
|
||||
fasturl x 4,908,405 ops/sec ±0.42% (191 runs sampled)
|
||||
nativeurl x 100,945 ops/sec ±0.59% (188 runs sampled)
|
||||
parseurl x 4,333,208 ops/sec ±0.27% (194 runs sampled)
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
[MIT](LICENSE)
|
||||
|
||||
[npm-image]: https://img.shields.io/npm/v/parseurl.svg
|
||||
[npm-url]: https://npmjs.org/package/parseurl
|
||||
[node-version-image]: https://img.shields.io/node/v/parseurl.svg
|
||||
[node-version-url]: http://nodejs.org/download/
|
||||
[travis-image]: https://img.shields.io/travis/pillarjs/parseurl/master.svg
|
||||
[travis-url]: https://travis-ci.org/pillarjs/parseurl
|
||||
[coveralls-image]: https://img.shields.io/coveralls/pillarjs/parseurl/master.svg
|
||||
[coveralls-url]: https://coveralls.io/r/pillarjs/parseurl?branch=master
|
||||
[downloads-image]: https://img.shields.io/npm/dm/parseurl.svg
|
||||
[downloads-url]: https://npmjs.org/package/parseurl
|
138
node_modules/parseurl/index.js
generated
vendored
Normal file
138
node_modules/parseurl/index.js
generated
vendored
Normal file
@ -0,0 +1,138 @@
|
||||
/*!
|
||||
* parseurl
|
||||
* Copyright(c) 2014 Jonathan Ong
|
||||
* Copyright(c) 2014 Douglas Christopher Wilson
|
||||
* MIT Licensed
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
/**
|
||||
* Module dependencies.
|
||||
*/
|
||||
|
||||
var url = require('url')
|
||||
var parse = url.parse
|
||||
var Url = url.Url
|
||||
|
||||
/**
|
||||
* Pattern for a simple path case.
|
||||
* See: https://github.com/joyent/node/pull/7878
|
||||
*/
|
||||
|
||||
var simplePathRegExp = /^(\/\/?(?!\/)[^\?#\s]*)(\?[^#\s]*)?$/
|
||||
|
||||
/**
|
||||
* Exports.
|
||||
*/
|
||||
|
||||
module.exports = parseurl
|
||||
module.exports.original = originalurl
|
||||
|
||||
/**
|
||||
* Parse the `req` url with memoization.
|
||||
*
|
||||
* @param {ServerRequest} req
|
||||
* @return {Object}
|
||||
* @api 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}
|
||||
* @api 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}
|
||||
* @api private
|
||||
*/
|
||||
|
||||
function fastparse(str) {
|
||||
// Try fast path regexp
|
||||
// See: https://github.com/joyent/node/pull/7878
|
||||
var simplePath = typeof str === 'string' && simplePathRegExp.exec(str)
|
||||
|
||||
// Construct simple URL
|
||||
if (simplePath) {
|
||||
var pathname = simplePath[1]
|
||||
var search = simplePath[2] || null
|
||||
var url = Url !== undefined
|
||||
? new Url()
|
||||
: {}
|
||||
url.path = str
|
||||
url.href = str
|
||||
url.pathname = pathname
|
||||
url.search = search
|
||||
url.query = search && search.substr(1)
|
||||
|
||||
return url
|
||||
}
|
||||
|
||||
return parse(str)
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if parsed is still fresh for url.
|
||||
*
|
||||
* @param {string} url
|
||||
* @param {object} parsedUrl
|
||||
* @return {boolean}
|
||||
* @api private
|
||||
*/
|
||||
|
||||
function fresh(url, parsedUrl) {
|
||||
return typeof parsedUrl === 'object'
|
||||
&& parsedUrl !== null
|
||||
&& (Url === undefined || parsedUrl instanceof Url)
|
||||
&& parsedUrl._raw === url
|
||||
}
|
116
node_modules/parseurl/package.json
generated
vendored
Normal file
116
node_modules/parseurl/package.json
generated
vendored
Normal file
@ -0,0 +1,116 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"parseurl@~1.3.1",
|
||||
"C:\\Users\\x2mjbyrn\\Source\\Repos\\Skeleton\\node_modules\\connect"
|
||||
]
|
||||
],
|
||||
"_from": "parseurl@>=1.3.1-0 <1.4.0-0",
|
||||
"_id": "parseurl@1.3.1",
|
||||
"_inCache": true,
|
||||
"_location": "/parseurl",
|
||||
"_npmUser": {
|
||||
"email": "doug@somethingdoug.com",
|
||||
"name": "dougwilson"
|
||||
},
|
||||
"_npmVersion": "1.4.28",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"name": "parseurl",
|
||||
"raw": "parseurl@~1.3.1",
|
||||
"rawSpec": "~1.3.1",
|
||||
"scope": null,
|
||||
"spec": ">=1.3.1-0 <1.4.0-0",
|
||||
"type": "range"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/connect",
|
||||
"/serve-index",
|
||||
"/serve-static"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.1.tgz",
|
||||
"_shasum": "c8ab8c9223ba34888aa64a297b28853bec18da56",
|
||||
"_shrinkwrap": null,
|
||||
"_spec": "parseurl@~1.3.1",
|
||||
"_where": "C:\\Users\\x2mjbyrn\\Source\\Repos\\Skeleton\\node_modules\\connect",
|
||||
"author": {
|
||||
"email": "me@jongleberry.com",
|
||||
"name": "Jonathan Ong",
|
||||
"url": "http://jongleberry.com"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/pillarjs/parseurl/issues"
|
||||
},
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Douglas Christopher Wilson",
|
||||
"email": "doug@somethingdoug.com"
|
||||
}
|
||||
],
|
||||
"dependencies": {},
|
||||
"description": "parse a url with memoization",
|
||||
"devDependencies": {
|
||||
"beautify-benchmark": "0.2.4",
|
||||
"benchmark": "2.0.0",
|
||||
"fast-url-parser": "1.1.3",
|
||||
"istanbul": "0.4.2",
|
||||
"mocha": "~1.21.5"
|
||||
},
|
||||
"directories": {},
|
||||
"dist": {
|
||||
"shasum": "c8ab8c9223ba34888aa64a297b28853bec18da56",
|
||||
"tarball": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.1.tgz"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
},
|
||||
"files": [
|
||||
"HISTORY.md",
|
||||
"LICENSE",
|
||||
"README.md",
|
||||
"index.js"
|
||||
],
|
||||
"gitHead": "6d22d376d75b927ab2b5347ce3a1d6735133dd43",
|
||||
"homepage": "https://github.com/pillarjs/parseurl",
|
||||
"installable": true,
|
||||
"license": "MIT",
|
||||
"maintainers": [
|
||||
{
|
||||
"name": "jongleberry",
|
||||
"email": "jonathanrichardong@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "dougwilson",
|
||||
"email": "doug@somethingdoug.com"
|
||||
},
|
||||
{
|
||||
"name": "tjholowaychuk",
|
||||
"email": "tj@vision-media.ca"
|
||||
},
|
||||
{
|
||||
"name": "mscdex",
|
||||
"email": "mscdex@mscdex.net"
|
||||
},
|
||||
{
|
||||
"name": "fishrock123",
|
||||
"email": "fishrock123@rocketmail.com"
|
||||
},
|
||||
{
|
||||
"name": "defunctzombie",
|
||||
"email": "shtylman@gmail.com"
|
||||
}
|
||||
],
|
||||
"name": "parseurl",
|
||||
"optionalDependencies": {},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/pillarjs/parseurl"
|
||||
},
|
||||
"scripts": {
|
||||
"bench": "node benchmark/index.js",
|
||||
"test": "mocha --check-leaks --bail --reporter spec test/",
|
||||
"test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --check-leaks --reporter dot test/",
|
||||
"test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --check-leaks --reporter spec test/"
|
||||
},
|
||||
"version": "1.3.1"
|
||||
}
|
Reference in New Issue
Block a user