Added cors
Signed-off-by: walamana <joniogerg@gmail.com>
This commit is contained in:
parent
9195e7b9f6
commit
901f838551
91
app.js
91
app.js
@ -3,13 +3,24 @@ var cookieParser = require("cookie-parser");
|
||||
var path = require("path");
|
||||
var errorHandler = require("errorhandler");
|
||||
var app = express();
|
||||
var cors = require("cors");
|
||||
|
||||
|
||||
const corsWhitelist = ["http://minis.walamana.de"]
|
||||
|
||||
|
||||
var bodyParser = require('body-parser')
|
||||
app.use( bodyParser.json() ); // to support JSON-encoded bodies
|
||||
app.use(cors({
|
||||
origin: function (origin, callback) {
|
||||
if (corsWhitelist.indexOf(origin) !== -1) {
|
||||
callback(null, true)
|
||||
} else {
|
||||
callback(new Error('Not allowed by CORS'))
|
||||
}
|
||||
}
|
||||
}))
|
||||
app.use(cookieParser());
|
||||
app.use((req, res, next) => {
|
||||
res.setHeader("Access-Control-Allow-Origin", "*");
|
||||
return next();
|
||||
});
|
||||
app.use(express.static(path.join(process.cwd(), "StaticPages")));
|
||||
app.use(errorHandler({ dumpExceptions: true, showStack: true }));
|
||||
|
||||
@ -141,6 +152,10 @@ app.get("/gottesdienste", (req, res) => {
|
||||
var groupid = req.params.groupid;
|
||||
con.query("SELECT ID from gruppe ORDER BY ID DESC LIMIT 1", (err, result) => {
|
||||
if (err) throw err;
|
||||
if(result.length <= 0){
|
||||
res.send("null");
|
||||
return;
|
||||
}
|
||||
con.query("SELECT * from gottesdienst WHERE gruppe_ID='" + result[0]["ID"] + "' ORDER BY `gottesdienst`.`DATUM` ASC LIMIT 0 , 30 ", (err, result) => {
|
||||
if (err) throw err;
|
||||
res.send(JSON.stringify(result));
|
||||
@ -174,7 +189,6 @@ app.get("/groups", (req, res) => {
|
||||
});
|
||||
|
||||
app.get("/ministranten", (req, res) =>{
|
||||
console.log(req.header);
|
||||
tokenIsValid(req.cookies.user, req.cookies.loginToken).then(valid => {
|
||||
con.query("SELECT `ministranten`.`USERNAME`, `ministranten`.`VORNAME`, `ministranten`.`NACHNAME`, `anwesenheit`.`ANWESENHEIT`, `anwesenheit`.`gottesdienst_ID` FROM `ministranten` LEFT JOIN `anwesenheit` ON `anwesenheit`.`USERNAME` = `ministranten`.`USERNAME` ORDER BY `ministranten`.`NACHNAME`, `ministranten`.`VORNAME`, `anwesenheit`.`gottesdienst_ID` DESC LIMIT 30", (err, results) => {
|
||||
if (err) throw err;
|
||||
@ -210,6 +224,60 @@ app.get("/ministranten", (req, res) =>{
|
||||
|
||||
});
|
||||
|
||||
app.post("/add/group", (req, res) => {
|
||||
|
||||
validateAdmin(req.body.credentials.username, req.body.credentials.token).then(success => {
|
||||
if(success){
|
||||
var start = req.body.start;
|
||||
var end = req.body.end;
|
||||
|
||||
con.query("INSERT INTO `gruppe` (`ID`, `START`, `END`) VALUES (NULL, '" + start + "', '" + end + "');", (err, result) => {
|
||||
if (err) throw err;
|
||||
con.query("SELECT ID FROM `gruppe`", (err2, result2) => {
|
||||
res.send(JSON.stringify({id: result2[result2.length - 1].ID}));
|
||||
});
|
||||
})
|
||||
}else{
|
||||
res.send(JSON.stringify({err: "Not enough permissions"}));
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// con.query("SELECT * from gruppe ORDER BY `gruppe`.`ID` DESC LIMIT 0, 5", (err, result) => {
|
||||
// });
|
||||
});
|
||||
|
||||
app.post("/add/gottesdienst", (req, res) => {
|
||||
|
||||
|
||||
console.log(JSON.stringify(req.body));
|
||||
validateAdmin(req.body.credentials.username, req.body.credentials.token).then(success => {
|
||||
if(success){
|
||||
var name = req.body.data.name != undefined ? '"' + req.body.data.name + '"' : "NULL";
|
||||
var date = req.body.data.date != undefined ? req.body.data.date : "NULL";
|
||||
var time = req.body.data.time != undefined ? req.body.data.time : "NULL";
|
||||
var presence = req.body.data.presence != undefined ? '"' + req.body.data.presence + '"' : "NULL";
|
||||
var location = req.body.data.location != undefined ? '"' + req.body.data.location + '"' : "NULL";
|
||||
var trial = req.body.data.trial != undefined ? '"' + req.body.data.trial + '"' : "NULL";
|
||||
var group = req.body.data.group != undefined ? req.body.data.group : -1;
|
||||
|
||||
var finalDate = '"' + date + " " + time + '"';
|
||||
|
||||
con.query("INSERT INTO `gottesdienst` (`ID`, `NAME`, `DATUM`, `ANWESENHEIT`, `PROBE`, `ORT`, `gruppe_ID`, `FESTGESETZT`) VALUES (NULL, " + name + ", " + finalDate + ", " + presence + ", " + trial + ", " + location + ", " + group + ", '0');", (err, result) => {
|
||||
if (err) throw err;
|
||||
con.query("SELECT ID FROM `gottesdienst`", (err2, result2) => {
|
||||
res.send(JSON.stringify({id: result2[result2.length - 1].ID}));
|
||||
});
|
||||
})
|
||||
}else{
|
||||
res.send(JSON.stringify({err: "Not enough permissions"}));
|
||||
}
|
||||
});
|
||||
// con.query("SELECT * from gruppe ORDER BY `gruppe`.`ID` DESC LIMIT 0, 5", (err, result) => {
|
||||
// });
|
||||
});
|
||||
|
||||
|
||||
var attachToMini = function(mini, pos, then){
|
||||
mini.registered = [];
|
||||
con.query("SELECT * FROM `" + mini.Name.toLowerCase() + "` ORDER BY `" + mini.Name.toLowerCase() + "`.`GottesdienstIDs` DESC LIMIT 0 , 30", (err, data) => {
|
||||
@ -255,6 +323,19 @@ function tokenIsValid(username, token){
|
||||
})
|
||||
}
|
||||
|
||||
function validateAdmin(username, token){
|
||||
return new Promise((resolve, reject) => {
|
||||
if(username == "admin"){
|
||||
tokenIsValid(username, token).then(success => {
|
||||
console.log(success)
|
||||
resolve(success);
|
||||
});
|
||||
}else{
|
||||
console.log("wrong username")
|
||||
resolve(false);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function removeFromArrayByValue(value, array) {
|
||||
|
||||
20
node_modules/body-parser/HISTORY.md
generated
vendored
20
node_modules/body-parser/HISTORY.md
generated
vendored
@ -1,3 +1,23 @@
|
||||
1.18.3 / 2018-05-14
|
||||
===================
|
||||
|
||||
* Fix stack trace for strict json parse error
|
||||
* deps: depd@~1.1.2
|
||||
- perf: remove argument reassignment
|
||||
* deps: http-errors@~1.6.3
|
||||
- deps: depd@~1.1.2
|
||||
- deps: setprototypeof@1.1.0
|
||||
- deps: statuses@'>= 1.3.1 < 2'
|
||||
* deps: iconv-lite@0.4.23
|
||||
- Fix loading encoding with year appended
|
||||
- Fix deprecation warnings on Node.js 10+
|
||||
* deps: qs@6.5.2
|
||||
* deps: raw-body@2.3.3
|
||||
- deps: http-errors@1.6.3
|
||||
- deps: iconv-lite@0.4.23
|
||||
* deps: type-is@~1.6.16
|
||||
- deps: mime-types@~2.1.18
|
||||
|
||||
1.18.2 / 2017-09-22
|
||||
===================
|
||||
|
||||
|
||||
49
node_modules/body-parser/README.md
generated
vendored
49
node_modules/body-parser/README.md
generated
vendored
@ -4,13 +4,18 @@
|
||||
[![NPM Downloads][downloads-image]][downloads-url]
|
||||
[![Build Status][travis-image]][travis-url]
|
||||
[![Test Coverage][coveralls-image]][coveralls-url]
|
||||
[![Gratipay][gratipay-image]][gratipay-url]
|
||||
|
||||
Node.js body parsing middleware.
|
||||
|
||||
Parse incoming request bodies in a middleware before your handlers, available
|
||||
under the `req.body` property.
|
||||
|
||||
**Note** As `req.body`'s shape is based on user-controlled input, all
|
||||
properties and values in this object are untrusted and should be validated
|
||||
before trusting. For example, `req.body.foo.toString()` may fail in multiple
|
||||
ways, for example the `foo` property may not be there or may not be a string,
|
||||
and `toString` may not be a function and instead a string or other user input.
|
||||
|
||||
[Learn about the anatomy of an HTTP transaction in Node.js](https://nodejs.org/en/docs/guides/anatomy-of-an-http-transaction/).
|
||||
|
||||
_This does not handle multipart bodies_, due to their complex and typically
|
||||
@ -100,12 +105,13 @@ accept anything `JSON.parse` accepts. Defaults to `true`.
|
||||
##### type
|
||||
|
||||
The `type` option is used to determine what media type the middleware will
|
||||
parse. This option can be a function or a string. If a string, `type` option
|
||||
is passed directly to the [type-is](https://www.npmjs.org/package/type-is#readme)
|
||||
library and this can be an extension name (like `json`), a mime type (like
|
||||
`application/json`), or a mime type with a wildcard (like `*/*` or `*/json`).
|
||||
If a function, the `type` option is called as `fn(req)` and the request is
|
||||
parsed if it returns a truthy value. Defaults to `application/json`.
|
||||
parse. This option can be a string, array of strings, or a function. If not a
|
||||
function, `type` option is passed directly to the
|
||||
[type-is](https://www.npmjs.org/package/type-is#readme) library and this can
|
||||
be an extension name (like `json`), a mime type (like `application/json`), or
|
||||
a mime type with a wildcard (like `*/*` or `*/json`). If a function, the `type`
|
||||
option is called as `fn(req)` and the request is parsed if it returns a truthy
|
||||
value. Defaults to `application/json`.
|
||||
|
||||
##### verify
|
||||
|
||||
@ -143,9 +149,10 @@ to `'100kb'`.
|
||||
##### type
|
||||
|
||||
The `type` option is used to determine what media type the middleware will
|
||||
parse. This option can be a function or a string. If a string, `type` option
|
||||
is passed directly to the [type-is](https://www.npmjs.org/package/type-is#readme)
|
||||
library and this can be an extension name (like `bin`), a mime type (like
|
||||
parse. This option can be a string, array of strings, or a function.
|
||||
If not a function, `type` option is passed directly to the
|
||||
[type-is](https://www.npmjs.org/package/type-is#readme) library and this
|
||||
can be an extension name (like `bin`), a mime type (like
|
||||
`application/octet-stream`), or a mime type with a wildcard (like `*/*` or
|
||||
`application/*`). If a function, the `type` option is called as `fn(req)`
|
||||
and the request is parsed if it returns a truthy value. Defaults to
|
||||
@ -192,12 +199,13 @@ to `'100kb'`.
|
||||
##### type
|
||||
|
||||
The `type` option is used to determine what media type the middleware will
|
||||
parse. This option can be a function or a string. If a string, `type` option
|
||||
is passed directly to the [type-is](https://www.npmjs.org/package/type-is#readme)
|
||||
library and this can be an extension name (like `txt`), a mime type (like
|
||||
`text/plain`), or a mime type with a wildcard (like `*/*` or `text/*`).
|
||||
If a function, the `type` option is called as `fn(req)` and the request is
|
||||
parsed if it returns a truthy value. Defaults to `text/plain`.
|
||||
parse. This option can be a string, array of strings, or a function. If not
|
||||
a function, `type` option is passed directly to the
|
||||
[type-is](https://www.npmjs.org/package/type-is#readme) library and this can
|
||||
be an extension name (like `txt`), a mime type (like `text/plain`), or a mime
|
||||
type with a wildcard (like `*/*` or `text/*`). If a function, the `type`
|
||||
option is called as `fn(req)` and the request is parsed if it returns a
|
||||
truthy value. Defaults to `text/plain`.
|
||||
|
||||
##### verify
|
||||
|
||||
@ -256,9 +264,10 @@ than this value, a 413 will be returned to the client. Defaults to `1000`.
|
||||
##### type
|
||||
|
||||
The `type` option is used to determine what media type the middleware will
|
||||
parse. This option can be a function or a string. If a string, `type` option
|
||||
is passed directly to the [type-is](https://www.npmjs.org/package/type-is#readme)
|
||||
library and this can be an extension name (like `urlencoded`), a mime type (like
|
||||
parse. This option can be a string, array of strings, or a function. If not
|
||||
a function, `type` option is passed directly to the
|
||||
[type-is](https://www.npmjs.org/package/type-is#readme) library and this can
|
||||
be an extension name (like `urlencoded`), a mime type (like
|
||||
`application/x-www-form-urlencoded`), or a mime type with a wildcard (like
|
||||
`*/x-www-form-urlencoded`). If a function, the `type` option is called as
|
||||
`fn(req)` and the request is parsed if it returns a truthy value. Defaults
|
||||
@ -434,5 +443,3 @@ app.use(bodyParser.text({ type: 'text/html' }))
|
||||
[coveralls-url]: https://coveralls.io/r/expressjs/body-parser?branch=master
|
||||
[downloads-image]: https://img.shields.io/npm/dm/body-parser.svg
|
||||
[downloads-url]: https://npmjs.org/package/body-parser
|
||||
[gratipay-image]: https://img.shields.io/gratipay/dougwilson.svg
|
||||
[gratipay-url]: https://www.gratipay.com/dougwilson/
|
||||
|
||||
10
node_modules/body-parser/lib/types/json.js
generated
vendored
10
node_modules/body-parser/lib/types/json.js
generated
vendored
@ -89,6 +89,7 @@ function json (options) {
|
||||
return JSON.parse(body, reviver)
|
||||
} catch (e) {
|
||||
throw normalizeJsonSyntaxError(e, {
|
||||
message: e.message,
|
||||
stack: e.stack
|
||||
})
|
||||
}
|
||||
@ -208,12 +209,9 @@ function normalizeJsonSyntaxError (error, obj) {
|
||||
}
|
||||
}
|
||||
|
||||
var props = Object.keys(obj)
|
||||
|
||||
for (var j = 0; j < props.length; j++) {
|
||||
var prop = props[j]
|
||||
error[prop] = obj[prop]
|
||||
}
|
||||
// replace stack before message for Node.js 0.10 and below
|
||||
error.stack = obj.stack.replace(error.message, obj.message)
|
||||
error.message = obj.message
|
||||
|
||||
return error
|
||||
}
|
||||
|
||||
96
node_modules/body-parser/node_modules/depd/History.md
generated
vendored
Normal file
96
node_modules/body-parser/node_modules/depd/History.md
generated
vendored
Normal file
@ -0,0 +1,96 @@
|
||||
1.1.2 / 2018-01-11
|
||||
==================
|
||||
|
||||
* perf: remove argument reassignment
|
||||
* Support Node.js 0.6 to 9.x
|
||||
|
||||
1.1.1 / 2017-07-27
|
||||
==================
|
||||
|
||||
* Remove unnecessary `Buffer` loading
|
||||
* Support Node.js 0.6 to 8.x
|
||||
|
||||
1.1.0 / 2015-09-14
|
||||
==================
|
||||
|
||||
* Enable strict mode in more places
|
||||
* Support io.js 3.x
|
||||
* Support io.js 2.x
|
||||
* Support web browser loading
|
||||
- Requires bundler like Browserify or webpack
|
||||
|
||||
1.0.1 / 2015-04-07
|
||||
==================
|
||||
|
||||
* Fix `TypeError`s when under `'use strict'` code
|
||||
* Fix useless type name on auto-generated messages
|
||||
* Support io.js 1.x
|
||||
* Support Node.js 0.12
|
||||
|
||||
1.0.0 / 2014-09-17
|
||||
==================
|
||||
|
||||
* No changes
|
||||
|
||||
0.4.5 / 2014-09-09
|
||||
==================
|
||||
|
||||
* Improve call speed to functions using the function wrapper
|
||||
* Support Node.js 0.6
|
||||
|
||||
0.4.4 / 2014-07-27
|
||||
==================
|
||||
|
||||
* Work-around v8 generating empty stack traces
|
||||
|
||||
0.4.3 / 2014-07-26
|
||||
==================
|
||||
|
||||
* Fix exception when global `Error.stackTraceLimit` is too low
|
||||
|
||||
0.4.2 / 2014-07-19
|
||||
==================
|
||||
|
||||
* Correct call site for wrapped functions and properties
|
||||
|
||||
0.4.1 / 2014-07-19
|
||||
==================
|
||||
|
||||
* Improve automatic message generation for function properties
|
||||
|
||||
0.4.0 / 2014-07-19
|
||||
==================
|
||||
|
||||
* Add `TRACE_DEPRECATION` environment variable
|
||||
* Remove non-standard grey color from color output
|
||||
* Support `--no-deprecation` argument
|
||||
* Support `--trace-deprecation` argument
|
||||
* Support `deprecate.property(fn, prop, message)`
|
||||
|
||||
0.3.0 / 2014-06-16
|
||||
==================
|
||||
|
||||
* Add `NO_DEPRECATION` environment variable
|
||||
|
||||
0.2.0 / 2014-06-15
|
||||
==================
|
||||
|
||||
* Add `deprecate.property(obj, prop, message)`
|
||||
* Remove `supports-color` dependency for node.js 0.8
|
||||
|
||||
0.1.0 / 2014-06-15
|
||||
==================
|
||||
|
||||
* Add `deprecate.function(fn, message)`
|
||||
* Add `process.on('deprecation', fn)` emitter
|
||||
* Automatically generate message when omitted from `deprecate()`
|
||||
|
||||
0.0.1 / 2014-06-15
|
||||
==================
|
||||
|
||||
* Fix warning for dynamic calls at singe call site
|
||||
|
||||
0.0.0 / 2014-06-15
|
||||
==================
|
||||
|
||||
* Initial implementation
|
||||
22
node_modules/body-parser/node_modules/depd/LICENSE
generated
vendored
Normal file
22
node_modules/body-parser/node_modules/depd/LICENSE
generated
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
(The MIT License)
|
||||
|
||||
Copyright (c) 2014-2017 Douglas Christopher Wilson
|
||||
|
||||
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.
|
||||
280
node_modules/body-parser/node_modules/depd/Readme.md
generated
vendored
Normal file
280
node_modules/body-parser/node_modules/depd/Readme.md
generated
vendored
Normal file
@ -0,0 +1,280 @@
|
||||
# depd
|
||||
|
||||
[![NPM Version][npm-version-image]][npm-url]
|
||||
[![NPM Downloads][npm-downloads-image]][npm-url]
|
||||
[![Node.js Version][node-image]][node-url]
|
||||
[![Linux Build][travis-image]][travis-url]
|
||||
[![Windows Build][appveyor-image]][appveyor-url]
|
||||
[![Coverage Status][coveralls-image]][coveralls-url]
|
||||
|
||||
Deprecate all the things
|
||||
|
||||
> With great modules comes great responsibility; mark things deprecated!
|
||||
|
||||
## Install
|
||||
|
||||
This module is installed directly using `npm`:
|
||||
|
||||
```sh
|
||||
$ npm install depd
|
||||
```
|
||||
|
||||
This module can also be bundled with systems like
|
||||
[Browserify](http://browserify.org/) or [webpack](https://webpack.github.io/),
|
||||
though by default this module will alter it's API to no longer display or
|
||||
track deprecations.
|
||||
|
||||
## API
|
||||
|
||||
<!-- eslint-disable no-unused-vars -->
|
||||
|
||||
```js
|
||||
var deprecate = require('depd')('my-module')
|
||||
```
|
||||
|
||||
This library allows you to display deprecation messages to your users.
|
||||
This library goes above and beyond with deprecation warnings by
|
||||
introspection of the call stack (but only the bits that it is interested
|
||||
in).
|
||||
|
||||
Instead of just warning on the first invocation of a deprecated
|
||||
function and never again, this module will warn on the first invocation
|
||||
of a deprecated function per unique call site, making it ideal to alert
|
||||
users of all deprecated uses across the code base, rather than just
|
||||
whatever happens to execute first.
|
||||
|
||||
The deprecation warnings from this module also include the file and line
|
||||
information for the call into the module that the deprecated function was
|
||||
in.
|
||||
|
||||
**NOTE** this library has a similar interface to the `debug` module, and
|
||||
this module uses the calling file to get the boundary for the call stacks,
|
||||
so you should always create a new `deprecate` object in each file and not
|
||||
within some central file.
|
||||
|
||||
### depd(namespace)
|
||||
|
||||
Create a new deprecate function that uses the given namespace name in the
|
||||
messages and will display the call site prior to the stack entering the
|
||||
file this function was called from. It is highly suggested you use the
|
||||
name of your module as the namespace.
|
||||
|
||||
### deprecate(message)
|
||||
|
||||
Call this function from deprecated code to display a deprecation message.
|
||||
This message will appear once per unique caller site. Caller site is the
|
||||
first call site in the stack in a different file from the caller of this
|
||||
function.
|
||||
|
||||
If the message is omitted, a message is generated for you based on the site
|
||||
of the `deprecate()` call and will display the name of the function called,
|
||||
similar to the name displayed in a stack trace.
|
||||
|
||||
### deprecate.function(fn, message)
|
||||
|
||||
Call this function to wrap a given function in a deprecation message on any
|
||||
call to the function. An optional message can be supplied to provide a custom
|
||||
message.
|
||||
|
||||
### deprecate.property(obj, prop, message)
|
||||
|
||||
Call this function to wrap a given property on object in a deprecation message
|
||||
on any accessing or setting of the property. An optional message can be supplied
|
||||
to provide a custom message.
|
||||
|
||||
The method must be called on the object where the property belongs (not
|
||||
inherited from the prototype).
|
||||
|
||||
If the property is a data descriptor, it will be converted to an accessor
|
||||
descriptor in order to display the deprecation message.
|
||||
|
||||
### process.on('deprecation', fn)
|
||||
|
||||
This module will allow easy capturing of deprecation errors by emitting the
|
||||
errors as the type "deprecation" on the global `process`. If there are no
|
||||
listeners for this type, the errors are written to STDERR as normal, but if
|
||||
there are any listeners, nothing will be written to STDERR and instead only
|
||||
emitted. From there, you can write the errors in a different format or to a
|
||||
logging source.
|
||||
|
||||
The error represents the deprecation and is emitted only once with the same
|
||||
rules as writing to STDERR. The error has the following properties:
|
||||
|
||||
- `message` - This is the message given by the library
|
||||
- `name` - This is always `'DeprecationError'`
|
||||
- `namespace` - This is the namespace the deprecation came from
|
||||
- `stack` - This is the stack of the call to the deprecated thing
|
||||
|
||||
Example `error.stack` output:
|
||||
|
||||
```
|
||||
DeprecationError: my-cool-module deprecated oldfunction
|
||||
at Object.<anonymous> ([eval]-wrapper:6:22)
|
||||
at Module._compile (module.js:456:26)
|
||||
at evalScript (node.js:532:25)
|
||||
at startup (node.js:80:7)
|
||||
at node.js:902:3
|
||||
```
|
||||
|
||||
### process.env.NO_DEPRECATION
|
||||
|
||||
As a user of modules that are deprecated, the environment variable `NO_DEPRECATION`
|
||||
is provided as a quick solution to silencing deprecation warnings from being
|
||||
output. The format of this is similar to that of `DEBUG`:
|
||||
|
||||
```sh
|
||||
$ NO_DEPRECATION=my-module,othermod node app.js
|
||||
```
|
||||
|
||||
This will suppress deprecations from being output for "my-module" and "othermod".
|
||||
The value is a list of comma-separated namespaces. To suppress every warning
|
||||
across all namespaces, use the value `*` for a namespace.
|
||||
|
||||
Providing the argument `--no-deprecation` to the `node` executable will suppress
|
||||
all deprecations (only available in Node.js 0.8 or higher).
|
||||
|
||||
**NOTE** This will not suppress the deperecations given to any "deprecation"
|
||||
event listeners, just the output to STDERR.
|
||||
|
||||
### process.env.TRACE_DEPRECATION
|
||||
|
||||
As a user of modules that are deprecated, the environment variable `TRACE_DEPRECATION`
|
||||
is provided as a solution to getting more detailed location information in deprecation
|
||||
warnings by including the entire stack trace. The format of this is the same as
|
||||
`NO_DEPRECATION`:
|
||||
|
||||
```sh
|
||||
$ TRACE_DEPRECATION=my-module,othermod node app.js
|
||||
```
|
||||
|
||||
This will include stack traces for deprecations being output for "my-module" and
|
||||
"othermod". The value is a list of comma-separated namespaces. To trace every
|
||||
warning across all namespaces, use the value `*` for a namespace.
|
||||
|
||||
Providing the argument `--trace-deprecation` to the `node` executable will trace
|
||||
all deprecations (only available in Node.js 0.8 or higher).
|
||||
|
||||
**NOTE** This will not trace the deperecations silenced by `NO_DEPRECATION`.
|
||||
|
||||
## Display
|
||||
|
||||

|
||||
|
||||
When a user calls a function in your library that you mark deprecated, they
|
||||
will see the following written to STDERR (in the given colors, similar colors
|
||||
and layout to the `debug` module):
|
||||
|
||||
```
|
||||
bright cyan bright yellow
|
||||
| | reset cyan
|
||||
| | | |
|
||||
▼ ▼ ▼ ▼
|
||||
my-cool-module deprecated oldfunction [eval]-wrapper:6:22
|
||||
▲ ▲ ▲ ▲
|
||||
| | | |
|
||||
namespace | | location of mycoolmod.oldfunction() call
|
||||
| deprecation message
|
||||
the word "deprecated"
|
||||
```
|
||||
|
||||
If the user redirects their STDERR to a file or somewhere that does not support
|
||||
colors, they see (similar layout to the `debug` module):
|
||||
|
||||
```
|
||||
Sun, 15 Jun 2014 05:21:37 GMT my-cool-module deprecated oldfunction at [eval]-wrapper:6:22
|
||||
▲ ▲ ▲ ▲ ▲
|
||||
| | | | |
|
||||
timestamp of message namespace | | location of mycoolmod.oldfunction() call
|
||||
| deprecation message
|
||||
the word "deprecated"
|
||||
```
|
||||
|
||||
## Examples
|
||||
|
||||
### Deprecating all calls to a function
|
||||
|
||||
This will display a deprecated message about "oldfunction" being deprecated
|
||||
from "my-module" on STDERR.
|
||||
|
||||
```js
|
||||
var deprecate = require('depd')('my-cool-module')
|
||||
|
||||
// message automatically derived from function name
|
||||
// Object.oldfunction
|
||||
exports.oldfunction = deprecate.function(function oldfunction () {
|
||||
// all calls to function are deprecated
|
||||
})
|
||||
|
||||
// specific message
|
||||
exports.oldfunction = deprecate.function(function () {
|
||||
// all calls to function are deprecated
|
||||
}, 'oldfunction')
|
||||
```
|
||||
|
||||
### Conditionally deprecating a function call
|
||||
|
||||
This will display a deprecated message about "weirdfunction" being deprecated
|
||||
from "my-module" on STDERR when called with less than 2 arguments.
|
||||
|
||||
```js
|
||||
var deprecate = require('depd')('my-cool-module')
|
||||
|
||||
exports.weirdfunction = function () {
|
||||
if (arguments.length < 2) {
|
||||
// calls with 0 or 1 args are deprecated
|
||||
deprecate('weirdfunction args < 2')
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
When calling `deprecate` as a function, the warning is counted per call site
|
||||
within your own module, so you can display different deprecations depending
|
||||
on different situations and the users will still get all the warnings:
|
||||
|
||||
```js
|
||||
var deprecate = require('depd')('my-cool-module')
|
||||
|
||||
exports.weirdfunction = function () {
|
||||
if (arguments.length < 2) {
|
||||
// calls with 0 or 1 args are deprecated
|
||||
deprecate('weirdfunction args < 2')
|
||||
} else if (typeof arguments[0] !== 'string') {
|
||||
// calls with non-string first argument are deprecated
|
||||
deprecate('weirdfunction non-string first arg')
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Deprecating property access
|
||||
|
||||
This will display a deprecated message about "oldprop" being deprecated
|
||||
from "my-module" on STDERR when accessed. A deprecation will be displayed
|
||||
when setting the value and when getting the value.
|
||||
|
||||
```js
|
||||
var deprecate = require('depd')('my-cool-module')
|
||||
|
||||
exports.oldprop = 'something'
|
||||
|
||||
// message automatically derives from property name
|
||||
deprecate.property(exports, 'oldprop')
|
||||
|
||||
// explicit message
|
||||
deprecate.property(exports, 'oldprop', 'oldprop >= 0.10')
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
[MIT](LICENSE)
|
||||
|
||||
[npm-version-image]: https://img.shields.io/npm/v/depd.svg
|
||||
[npm-downloads-image]: https://img.shields.io/npm/dm/depd.svg
|
||||
[npm-url]: https://npmjs.org/package/depd
|
||||
[travis-image]: https://img.shields.io/travis/dougwilson/nodejs-depd/master.svg?label=linux
|
||||
[travis-url]: https://travis-ci.org/dougwilson/nodejs-depd
|
||||
[appveyor-image]: https://img.shields.io/appveyor/ci/dougwilson/nodejs-depd/master.svg?label=windows
|
||||
[appveyor-url]: https://ci.appveyor.com/project/dougwilson/nodejs-depd
|
||||
[coveralls-image]: https://img.shields.io/coveralls/dougwilson/nodejs-depd/master.svg
|
||||
[coveralls-url]: https://coveralls.io/r/dougwilson/nodejs-depd?branch=master
|
||||
[node-image]: https://img.shields.io/node/v/depd.svg
|
||||
[node-url]: https://nodejs.org/en/download/
|
||||
522
node_modules/body-parser/node_modules/depd/index.js
generated
vendored
Normal file
522
node_modules/body-parser/node_modules/depd/index.js
generated
vendored
Normal file
@ -0,0 +1,522 @@
|
||||
/*!
|
||||
* depd
|
||||
* Copyright(c) 2014-2017 Douglas Christopher Wilson
|
||||
* MIT Licensed
|
||||
*/
|
||||
|
||||
/**
|
||||
* Module dependencies.
|
||||
*/
|
||||
|
||||
var callSiteToString = require('./lib/compat').callSiteToString
|
||||
var eventListenerCount = require('./lib/compat').eventListenerCount
|
||||
var relative = require('path').relative
|
||||
|
||||
/**
|
||||
* Module exports.
|
||||
*/
|
||||
|
||||
module.exports = depd
|
||||
|
||||
/**
|
||||
* Get the path to base files on.
|
||||
*/
|
||||
|
||||
var basePath = process.cwd()
|
||||
|
||||
/**
|
||||
* Determine if namespace is contained in the string.
|
||||
*/
|
||||
|
||||
function containsNamespace (str, namespace) {
|
||||
var vals = str.split(/[ ,]+/)
|
||||
var ns = String(namespace).toLowerCase()
|
||||
|
||||
for (var i = 0; i < vals.length; i++) {
|
||||
var val = vals[i]
|
||||
|
||||
// namespace contained
|
||||
if (val && (val === '*' || val.toLowerCase() === ns)) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert a data descriptor to accessor descriptor.
|
||||
*/
|
||||
|
||||
function convertDataDescriptorToAccessor (obj, prop, message) {
|
||||
var descriptor = Object.getOwnPropertyDescriptor(obj, prop)
|
||||
var value = descriptor.value
|
||||
|
||||
descriptor.get = function getter () { return value }
|
||||
|
||||
if (descriptor.writable) {
|
||||
descriptor.set = function setter (val) { return (value = val) }
|
||||
}
|
||||
|
||||
delete descriptor.value
|
||||
delete descriptor.writable
|
||||
|
||||
Object.defineProperty(obj, prop, descriptor)
|
||||
|
||||
return descriptor
|
||||
}
|
||||
|
||||
/**
|
||||
* Create arguments string to keep arity.
|
||||
*/
|
||||
|
||||
function createArgumentsString (arity) {
|
||||
var str = ''
|
||||
|
||||
for (var i = 0; i < arity; i++) {
|
||||
str += ', arg' + i
|
||||
}
|
||||
|
||||
return str.substr(2)
|
||||
}
|
||||
|
||||
/**
|
||||
* Create stack string from stack.
|
||||
*/
|
||||
|
||||
function createStackString (stack) {
|
||||
var str = this.name + ': ' + this.namespace
|
||||
|
||||
if (this.message) {
|
||||
str += ' deprecated ' + this.message
|
||||
}
|
||||
|
||||
for (var i = 0; i < stack.length; i++) {
|
||||
str += '\n at ' + callSiteToString(stack[i])
|
||||
}
|
||||
|
||||
return str
|
||||
}
|
||||
|
||||
/**
|
||||
* Create deprecate for namespace in caller.
|
||||
*/
|
||||
|
||||
function depd (namespace) {
|
||||
if (!namespace) {
|
||||
throw new TypeError('argument namespace is required')
|
||||
}
|
||||
|
||||
var stack = getStack()
|
||||
var site = callSiteLocation(stack[1])
|
||||
var file = site[0]
|
||||
|
||||
function deprecate (message) {
|
||||
// call to self as log
|
||||
log.call(deprecate, message)
|
||||
}
|
||||
|
||||
deprecate._file = file
|
||||
deprecate._ignored = isignored(namespace)
|
||||
deprecate._namespace = namespace
|
||||
deprecate._traced = istraced(namespace)
|
||||
deprecate._warned = Object.create(null)
|
||||
|
||||
deprecate.function = wrapfunction
|
||||
deprecate.property = wrapproperty
|
||||
|
||||
return deprecate
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if namespace is ignored.
|
||||
*/
|
||||
|
||||
function isignored (namespace) {
|
||||
/* istanbul ignore next: tested in a child processs */
|
||||
if (process.noDeprecation) {
|
||||
// --no-deprecation support
|
||||
return true
|
||||
}
|
||||
|
||||
var str = process.env.NO_DEPRECATION || ''
|
||||
|
||||
// namespace ignored
|
||||
return containsNamespace(str, namespace)
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if namespace is traced.
|
||||
*/
|
||||
|
||||
function istraced (namespace) {
|
||||
/* istanbul ignore next: tested in a child processs */
|
||||
if (process.traceDeprecation) {
|
||||
// --trace-deprecation support
|
||||
return true
|
||||
}
|
||||
|
||||
var str = process.env.TRACE_DEPRECATION || ''
|
||||
|
||||
// namespace traced
|
||||
return containsNamespace(str, namespace)
|
||||
}
|
||||
|
||||
/**
|
||||
* Display deprecation message.
|
||||
*/
|
||||
|
||||
function log (message, site) {
|
||||
var haslisteners = eventListenerCount(process, 'deprecation') !== 0
|
||||
|
||||
// abort early if no destination
|
||||
if (!haslisteners && this._ignored) {
|
||||
return
|
||||
}
|
||||
|
||||
var caller
|
||||
var callFile
|
||||
var callSite
|
||||
var depSite
|
||||
var i = 0
|
||||
var seen = false
|
||||
var stack = getStack()
|
||||
var file = this._file
|
||||
|
||||
if (site) {
|
||||
// provided site
|
||||
depSite = site
|
||||
callSite = callSiteLocation(stack[1])
|
||||
callSite.name = depSite.name
|
||||
file = callSite[0]
|
||||
} else {
|
||||
// get call site
|
||||
i = 2
|
||||
depSite = callSiteLocation(stack[i])
|
||||
callSite = depSite
|
||||
}
|
||||
|
||||
// get caller of deprecated thing in relation to file
|
||||
for (; i < stack.length; i++) {
|
||||
caller = callSiteLocation(stack[i])
|
||||
callFile = caller[0]
|
||||
|
||||
if (callFile === file) {
|
||||
seen = true
|
||||
} else if (callFile === this._file) {
|
||||
file = this._file
|
||||
} else if (seen) {
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
var key = caller
|
||||
? depSite.join(':') + '__' + caller.join(':')
|
||||
: undefined
|
||||
|
||||
if (key !== undefined && key in this._warned) {
|
||||
// already warned
|
||||
return
|
||||
}
|
||||
|
||||
this._warned[key] = true
|
||||
|
||||
// generate automatic message from call site
|
||||
var msg = message
|
||||
if (!msg) {
|
||||
msg = callSite === depSite || !callSite.name
|
||||
? defaultMessage(depSite)
|
||||
: defaultMessage(callSite)
|
||||
}
|
||||
|
||||
// emit deprecation if listeners exist
|
||||
if (haslisteners) {
|
||||
var err = DeprecationError(this._namespace, msg, stack.slice(i))
|
||||
process.emit('deprecation', err)
|
||||
return
|
||||
}
|
||||
|
||||
// format and write message
|
||||
var format = process.stderr.isTTY
|
||||
? formatColor
|
||||
: formatPlain
|
||||
var output = format.call(this, msg, caller, stack.slice(i))
|
||||
process.stderr.write(output + '\n', 'utf8')
|
||||
}
|
||||
|
||||
/**
|
||||
* Get call site location as array.
|
||||
*/
|
||||
|
||||
function callSiteLocation (callSite) {
|
||||
var file = callSite.getFileName() || '<anonymous>'
|
||||
var line = callSite.getLineNumber()
|
||||
var colm = callSite.getColumnNumber()
|
||||
|
||||
if (callSite.isEval()) {
|
||||
file = callSite.getEvalOrigin() + ', ' + file
|
||||
}
|
||||
|
||||
var site = [file, line, colm]
|
||||
|
||||
site.callSite = callSite
|
||||
site.name = callSite.getFunctionName()
|
||||
|
||||
return site
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate a default message from the site.
|
||||
*/
|
||||
|
||||
function defaultMessage (site) {
|
||||
var callSite = site.callSite
|
||||
var funcName = site.name
|
||||
|
||||
// make useful anonymous name
|
||||
if (!funcName) {
|
||||
funcName = '<anonymous@' + formatLocation(site) + '>'
|
||||
}
|
||||
|
||||
var context = callSite.getThis()
|
||||
var typeName = context && callSite.getTypeName()
|
||||
|
||||
// ignore useless type name
|
||||
if (typeName === 'Object') {
|
||||
typeName = undefined
|
||||
}
|
||||
|
||||
// make useful type name
|
||||
if (typeName === 'Function') {
|
||||
typeName = context.name || typeName
|
||||
}
|
||||
|
||||
return typeName && callSite.getMethodName()
|
||||
? typeName + '.' + funcName
|
||||
: funcName
|
||||
}
|
||||
|
||||
/**
|
||||
* Format deprecation message without color.
|
||||
*/
|
||||
|
||||
function formatPlain (msg, caller, stack) {
|
||||
var timestamp = new Date().toUTCString()
|
||||
|
||||
var formatted = timestamp +
|
||||
' ' + this._namespace +
|
||||
' deprecated ' + msg
|
||||
|
||||
// add stack trace
|
||||
if (this._traced) {
|
||||
for (var i = 0; i < stack.length; i++) {
|
||||
formatted += '\n at ' + callSiteToString(stack[i])
|
||||
}
|
||||
|
||||
return formatted
|
||||
}
|
||||
|
||||
if (caller) {
|
||||
formatted += ' at ' + formatLocation(caller)
|
||||
}
|
||||
|
||||
return formatted
|
||||
}
|
||||
|
||||
/**
|
||||
* Format deprecation message with color.
|
||||
*/
|
||||
|
||||
function formatColor (msg, caller, stack) {
|
||||
var formatted = '\x1b[36;1m' + this._namespace + '\x1b[22;39m' + // bold cyan
|
||||
' \x1b[33;1mdeprecated\x1b[22;39m' + // bold yellow
|
||||
' \x1b[0m' + msg + '\x1b[39m' // reset
|
||||
|
||||
// add stack trace
|
||||
if (this._traced) {
|
||||
for (var i = 0; i < stack.length; i++) {
|
||||
formatted += '\n \x1b[36mat ' + callSiteToString(stack[i]) + '\x1b[39m' // cyan
|
||||
}
|
||||
|
||||
return formatted
|
||||
}
|
||||
|
||||
if (caller) {
|
||||
formatted += ' \x1b[36m' + formatLocation(caller) + '\x1b[39m' // cyan
|
||||
}
|
||||
|
||||
return formatted
|
||||
}
|
||||
|
||||
/**
|
||||
* Format call site location.
|
||||
*/
|
||||
|
||||
function formatLocation (callSite) {
|
||||
return relative(basePath, callSite[0]) +
|
||||
':' + callSite[1] +
|
||||
':' + callSite[2]
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the stack as array of call sites.
|
||||
*/
|
||||
|
||||
function getStack () {
|
||||
var limit = Error.stackTraceLimit
|
||||
var obj = {}
|
||||
var prep = Error.prepareStackTrace
|
||||
|
||||
Error.prepareStackTrace = prepareObjectStackTrace
|
||||
Error.stackTraceLimit = Math.max(10, limit)
|
||||
|
||||
// capture the stack
|
||||
Error.captureStackTrace(obj)
|
||||
|
||||
// slice this function off the top
|
||||
var stack = obj.stack.slice(1)
|
||||
|
||||
Error.prepareStackTrace = prep
|
||||
Error.stackTraceLimit = limit
|
||||
|
||||
return stack
|
||||
}
|
||||
|
||||
/**
|
||||
* Capture call site stack from v8.
|
||||
*/
|
||||
|
||||
function prepareObjectStackTrace (obj, stack) {
|
||||
return stack
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a wrapped function in a deprecation message.
|
||||
*/
|
||||
|
||||
function wrapfunction (fn, message) {
|
||||
if (typeof fn !== 'function') {
|
||||
throw new TypeError('argument fn must be a function')
|
||||
}
|
||||
|
||||
var args = createArgumentsString(fn.length)
|
||||
var deprecate = this // eslint-disable-line no-unused-vars
|
||||
var stack = getStack()
|
||||
var site = callSiteLocation(stack[1])
|
||||
|
||||
site.name = fn.name
|
||||
|
||||
// eslint-disable-next-line no-eval
|
||||
var deprecatedfn = eval('(function (' + args + ') {\n' +
|
||||
'"use strict"\n' +
|
||||
'log.call(deprecate, message, site)\n' +
|
||||
'return fn.apply(this, arguments)\n' +
|
||||
'})')
|
||||
|
||||
return deprecatedfn
|
||||
}
|
||||
|
||||
/**
|
||||
* Wrap property in a deprecation message.
|
||||
*/
|
||||
|
||||
function wrapproperty (obj, prop, message) {
|
||||
if (!obj || (typeof obj !== 'object' && typeof obj !== 'function')) {
|
||||
throw new TypeError('argument obj must be object')
|
||||
}
|
||||
|
||||
var descriptor = Object.getOwnPropertyDescriptor(obj, prop)
|
||||
|
||||
if (!descriptor) {
|
||||
throw new TypeError('must call property on owner object')
|
||||
}
|
||||
|
||||
if (!descriptor.configurable) {
|
||||
throw new TypeError('property must be configurable')
|
||||
}
|
||||
|
||||
var deprecate = this
|
||||
var stack = getStack()
|
||||
var site = callSiteLocation(stack[1])
|
||||
|
||||
// set site name
|
||||
site.name = prop
|
||||
|
||||
// convert data descriptor
|
||||
if ('value' in descriptor) {
|
||||
descriptor = convertDataDescriptorToAccessor(obj, prop, message)
|
||||
}
|
||||
|
||||
var get = descriptor.get
|
||||
var set = descriptor.set
|
||||
|
||||
// wrap getter
|
||||
if (typeof get === 'function') {
|
||||
descriptor.get = function getter () {
|
||||
log.call(deprecate, message, site)
|
||||
return get.apply(this, arguments)
|
||||
}
|
||||
}
|
||||
|
||||
// wrap setter
|
||||
if (typeof set === 'function') {
|
||||
descriptor.set = function setter () {
|
||||
log.call(deprecate, message, site)
|
||||
return set.apply(this, arguments)
|
||||
}
|
||||
}
|
||||
|
||||
Object.defineProperty(obj, prop, descriptor)
|
||||
}
|
||||
|
||||
/**
|
||||
* Create DeprecationError for deprecation
|
||||
*/
|
||||
|
||||
function DeprecationError (namespace, message, stack) {
|
||||
var error = new Error()
|
||||
var stackString
|
||||
|
||||
Object.defineProperty(error, 'constructor', {
|
||||
value: DeprecationError
|
||||
})
|
||||
|
||||
Object.defineProperty(error, 'message', {
|
||||
configurable: true,
|
||||
enumerable: false,
|
||||
value: message,
|
||||
writable: true
|
||||
})
|
||||
|
||||
Object.defineProperty(error, 'name', {
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
value: 'DeprecationError',
|
||||
writable: true
|
||||
})
|
||||
|
||||
Object.defineProperty(error, 'namespace', {
|
||||
configurable: true,
|
||||
enumerable: false,
|
||||
value: namespace,
|
||||
writable: true
|
||||
})
|
||||
|
||||
Object.defineProperty(error, 'stack', {
|
||||
configurable: true,
|
||||
enumerable: false,
|
||||
get: function () {
|
||||
if (stackString !== undefined) {
|
||||
return stackString
|
||||
}
|
||||
|
||||
// prepare stack trace
|
||||
return (stackString = createStackString.call(this, stack))
|
||||
},
|
||||
set: function setter (val) {
|
||||
stackString = val
|
||||
}
|
||||
})
|
||||
|
||||
return error
|
||||
}
|
||||
77
node_modules/body-parser/node_modules/depd/lib/browser/index.js
generated
vendored
Normal file
77
node_modules/body-parser/node_modules/depd/lib/browser/index.js
generated
vendored
Normal file
@ -0,0 +1,77 @@
|
||||
/*!
|
||||
* depd
|
||||
* Copyright(c) 2015 Douglas Christopher Wilson
|
||||
* MIT Licensed
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
/**
|
||||
* Module exports.
|
||||
* @public
|
||||
*/
|
||||
|
||||
module.exports = depd
|
||||
|
||||
/**
|
||||
* Create deprecate for namespace in caller.
|
||||
*/
|
||||
|
||||
function depd (namespace) {
|
||||
if (!namespace) {
|
||||
throw new TypeError('argument namespace is required')
|
||||
}
|
||||
|
||||
function deprecate (message) {
|
||||
// no-op in browser
|
||||
}
|
||||
|
||||
deprecate._file = undefined
|
||||
deprecate._ignored = true
|
||||
deprecate._namespace = namespace
|
||||
deprecate._traced = false
|
||||
deprecate._warned = Object.create(null)
|
||||
|
||||
deprecate.function = wrapfunction
|
||||
deprecate.property = wrapproperty
|
||||
|
||||
return deprecate
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a wrapped function in a deprecation message.
|
||||
*
|
||||
* This is a no-op version of the wrapper, which does nothing but call
|
||||
* validation.
|
||||
*/
|
||||
|
||||
function wrapfunction (fn, message) {
|
||||
if (typeof fn !== 'function') {
|
||||
throw new TypeError('argument fn must be a function')
|
||||
}
|
||||
|
||||
return fn
|
||||
}
|
||||
|
||||
/**
|
||||
* Wrap property in a deprecation message.
|
||||
*
|
||||
* This is a no-op version of the wrapper, which does nothing but call
|
||||
* validation.
|
||||
*/
|
||||
|
||||
function wrapproperty (obj, prop, message) {
|
||||
if (!obj || (typeof obj !== 'object' && typeof obj !== 'function')) {
|
||||
throw new TypeError('argument obj must be object')
|
||||
}
|
||||
|
||||
var descriptor = Object.getOwnPropertyDescriptor(obj, prop)
|
||||
|
||||
if (!descriptor) {
|
||||
throw new TypeError('must call property on owner object')
|
||||
}
|
||||
|
||||
if (!descriptor.configurable) {
|
||||
throw new TypeError('property must be configurable')
|
||||
}
|
||||
}
|
||||
103
node_modules/body-parser/node_modules/depd/lib/compat/callsite-tostring.js
generated
vendored
Normal file
103
node_modules/body-parser/node_modules/depd/lib/compat/callsite-tostring.js
generated
vendored
Normal file
@ -0,0 +1,103 @@
|
||||
/*!
|
||||
* depd
|
||||
* Copyright(c) 2014 Douglas Christopher Wilson
|
||||
* MIT Licensed
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
/**
|
||||
* Module exports.
|
||||
*/
|
||||
|
||||
module.exports = callSiteToString
|
||||
|
||||
/**
|
||||
* Format a CallSite file location to a string.
|
||||
*/
|
||||
|
||||
function callSiteFileLocation (callSite) {
|
||||
var fileName
|
||||
var fileLocation = ''
|
||||
|
||||
if (callSite.isNative()) {
|
||||
fileLocation = 'native'
|
||||
} else if (callSite.isEval()) {
|
||||
fileName = callSite.getScriptNameOrSourceURL()
|
||||
if (!fileName) {
|
||||
fileLocation = callSite.getEvalOrigin()
|
||||
}
|
||||
} else {
|
||||
fileName = callSite.getFileName()
|
||||
}
|
||||
|
||||
if (fileName) {
|
||||
fileLocation += fileName
|
||||
|
||||
var lineNumber = callSite.getLineNumber()
|
||||
if (lineNumber != null) {
|
||||
fileLocation += ':' + lineNumber
|
||||
|
||||
var columnNumber = callSite.getColumnNumber()
|
||||
if (columnNumber) {
|
||||
fileLocation += ':' + columnNumber
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return fileLocation || 'unknown source'
|
||||
}
|
||||
|
||||
/**
|
||||
* Format a CallSite to a string.
|
||||
*/
|
||||
|
||||
function callSiteToString (callSite) {
|
||||
var addSuffix = true
|
||||
var fileLocation = callSiteFileLocation(callSite)
|
||||
var functionName = callSite.getFunctionName()
|
||||
var isConstructor = callSite.isConstructor()
|
||||
var isMethodCall = !(callSite.isToplevel() || isConstructor)
|
||||
var line = ''
|
||||
|
||||
if (isMethodCall) {
|
||||
var methodName = callSite.getMethodName()
|
||||
var typeName = getConstructorName(callSite)
|
||||
|
||||
if (functionName) {
|
||||
if (typeName && functionName.indexOf(typeName) !== 0) {
|
||||
line += typeName + '.'
|
||||
}
|
||||
|
||||
line += functionName
|
||||
|
||||
if (methodName && functionName.lastIndexOf('.' + methodName) !== functionName.length - methodName.length - 1) {
|
||||
line += ' [as ' + methodName + ']'
|
||||
}
|
||||
} else {
|
||||
line += typeName + '.' + (methodName || '<anonymous>')
|
||||
}
|
||||
} else if (isConstructor) {
|
||||
line += 'new ' + (functionName || '<anonymous>')
|
||||
} else if (functionName) {
|
||||
line += functionName
|
||||
} else {
|
||||
addSuffix = false
|
||||
line += fileLocation
|
||||
}
|
||||
|
||||
if (addSuffix) {
|
||||
line += ' (' + fileLocation + ')'
|
||||
}
|
||||
|
||||
return line
|
||||
}
|
||||
|
||||
/**
|
||||
* Get constructor name of reviver.
|
||||
*/
|
||||
|
||||
function getConstructorName (obj) {
|
||||
var receiver = obj.receiver
|
||||
return (receiver.constructor && receiver.constructor.name) || null
|
||||
}
|
||||
22
node_modules/body-parser/node_modules/depd/lib/compat/event-listener-count.js
generated
vendored
Normal file
22
node_modules/body-parser/node_modules/depd/lib/compat/event-listener-count.js
generated
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
/*!
|
||||
* depd
|
||||
* Copyright(c) 2015 Douglas Christopher Wilson
|
||||
* MIT Licensed
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
/**
|
||||
* Module exports.
|
||||
* @public
|
||||
*/
|
||||
|
||||
module.exports = eventListenerCount
|
||||
|
||||
/**
|
||||
* Get the count of listeners on an event emitter of a specific type.
|
||||
*/
|
||||
|
||||
function eventListenerCount (emitter, type) {
|
||||
return emitter.listeners(type).length
|
||||
}
|
||||
79
node_modules/body-parser/node_modules/depd/lib/compat/index.js
generated
vendored
Normal file
79
node_modules/body-parser/node_modules/depd/lib/compat/index.js
generated
vendored
Normal file
@ -0,0 +1,79 @@
|
||||
/*!
|
||||
* depd
|
||||
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
||||
* MIT Licensed
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
/**
|
||||
* Module dependencies.
|
||||
* @private
|
||||
*/
|
||||
|
||||
var EventEmitter = require('events').EventEmitter
|
||||
|
||||
/**
|
||||
* Module exports.
|
||||
* @public
|
||||
*/
|
||||
|
||||
lazyProperty(module.exports, 'callSiteToString', function callSiteToString () {
|
||||
var limit = Error.stackTraceLimit
|
||||
var obj = {}
|
||||
var prep = Error.prepareStackTrace
|
||||
|
||||
function prepareObjectStackTrace (obj, stack) {
|
||||
return stack
|
||||
}
|
||||
|
||||
Error.prepareStackTrace = prepareObjectStackTrace
|
||||
Error.stackTraceLimit = 2
|
||||
|
||||
// capture the stack
|
||||
Error.captureStackTrace(obj)
|
||||
|
||||
// slice the stack
|
||||
var stack = obj.stack.slice()
|
||||
|
||||
Error.prepareStackTrace = prep
|
||||
Error.stackTraceLimit = limit
|
||||
|
||||
return stack[0].toString ? toString : require('./callsite-tostring')
|
||||
})
|
||||
|
||||
lazyProperty(module.exports, 'eventListenerCount', function eventListenerCount () {
|
||||
return EventEmitter.listenerCount || require('./event-listener-count')
|
||||
})
|
||||
|
||||
/**
|
||||
* Define a lazy property.
|
||||
*/
|
||||
|
||||
function lazyProperty (obj, prop, getter) {
|
||||
function get () {
|
||||
var val = getter()
|
||||
|
||||
Object.defineProperty(obj, prop, {
|
||||
configurable: true,
|
||||
enumerable: true,
|
||||
value: val
|
||||
})
|
||||
|
||||
return val
|
||||
}
|
||||
|
||||
Object.defineProperty(obj, prop, {
|
||||
configurable: true,
|
||||
enumerable: true,
|
||||
get: get
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Call toString() on the obj
|
||||
*/
|
||||
|
||||
function toString (obj) {
|
||||
return obj.toString()
|
||||
}
|
||||
77
node_modules/body-parser/node_modules/depd/package.json
generated
vendored
Normal file
77
node_modules/body-parser/node_modules/depd/package.json
generated
vendored
Normal file
@ -0,0 +1,77 @@
|
||||
{
|
||||
"_from": "depd@~1.1.2",
|
||||
"_id": "depd@1.1.2",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=",
|
||||
"_location": "/body-parser/depd",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "depd@~1.1.2",
|
||||
"name": "depd",
|
||||
"escapedName": "depd",
|
||||
"rawSpec": "~1.1.2",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "~1.1.2"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/body-parser",
|
||||
"/body-parser/http-errors"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz",
|
||||
"_shasum": "9bcd52e14c097763e749b274c4346ed2e560b5a9",
|
||||
"_spec": "depd@~1.1.2",
|
||||
"_where": "C:\\Users\\jonio\\Documents\\Programmieren\\Miniportal\\Neu\\MiniportalAPI\\node_modules\\body-parser",
|
||||
"author": {
|
||||
"name": "Douglas Christopher Wilson",
|
||||
"email": "doug@somethingdoug.com"
|
||||
},
|
||||
"browser": "lib/browser/index.js",
|
||||
"bugs": {
|
||||
"url": "https://github.com/dougwilson/nodejs-depd/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"deprecated": false,
|
||||
"description": "Deprecate all the things",
|
||||
"devDependencies": {
|
||||
"beautify-benchmark": "0.2.4",
|
||||
"benchmark": "2.1.4",
|
||||
"eslint": "3.19.0",
|
||||
"eslint-config-standard": "7.1.0",
|
||||
"eslint-plugin-markdown": "1.0.0-beta.7",
|
||||
"eslint-plugin-promise": "3.6.0",
|
||||
"eslint-plugin-standard": "3.0.1",
|
||||
"istanbul": "0.4.5",
|
||||
"mocha": "~1.21.5"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
},
|
||||
"files": [
|
||||
"lib/",
|
||||
"History.md",
|
||||
"LICENSE",
|
||||
"index.js",
|
||||
"Readme.md"
|
||||
],
|
||||
"homepage": "https://github.com/dougwilson/nodejs-depd#readme",
|
||||
"keywords": [
|
||||
"deprecate",
|
||||
"deprecated"
|
||||
],
|
||||
"license": "MIT",
|
||||
"name": "depd",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/dougwilson/nodejs-depd.git"
|
||||
},
|
||||
"scripts": {
|
||||
"bench": "node benchmark/index.js",
|
||||
"lint": "eslint --plugin markdown --ext js,md .",
|
||||
"test": "mocha --reporter spec --bail test/",
|
||||
"test-ci": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --no-exit test/",
|
||||
"test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot test/"
|
||||
},
|
||||
"version": "1.1.2"
|
||||
}
|
||||
132
node_modules/body-parser/node_modules/http-errors/HISTORY.md
generated
vendored
Normal file
132
node_modules/body-parser/node_modules/http-errors/HISTORY.md
generated
vendored
Normal file
@ -0,0 +1,132 @@
|
||||
2018-03-29 / 1.6.3
|
||||
==================
|
||||
|
||||
* deps: depd@~1.1.2
|
||||
- perf: remove argument reassignment
|
||||
* deps: setprototypeof@1.1.0
|
||||
* deps: statuses@'>= 1.3.1 < 2'
|
||||
|
||||
2017-08-04 / 1.6.2
|
||||
==================
|
||||
|
||||
* deps: depd@1.1.1
|
||||
- Remove unnecessary `Buffer` loading
|
||||
|
||||
2017-02-20 / 1.6.1
|
||||
==================
|
||||
|
||||
* deps: setprototypeof@1.0.3
|
||||
- Fix shim for old browsers
|
||||
|
||||
2017-02-14 / 1.6.0
|
||||
==================
|
||||
|
||||
* Accept custom 4xx and 5xx status codes in factory
|
||||
* Add deprecation message to `"I'mateapot"` export
|
||||
* Deprecate passing status code as anything except first argument in factory
|
||||
* Deprecate using non-error status codes
|
||||
* Make `message` property enumerable for `HttpError`s
|
||||
|
||||
2016-11-16 / 1.5.1
|
||||
==================
|
||||
|
||||
* deps: inherits@2.0.3
|
||||
- Fix issue loading in browser
|
||||
* deps: setprototypeof@1.0.2
|
||||
* deps: statuses@'>= 1.3.1 < 2'
|
||||
|
||||
2016-05-18 / 1.5.0
|
||||
==================
|
||||
|
||||
* Support new code `421 Misdirected Request`
|
||||
* Use `setprototypeof` module to replace `__proto__` setting
|
||||
* deps: statuses@'>= 1.3.0 < 2'
|
||||
- Add `421 Misdirected Request`
|
||||
- perf: enable strict mode
|
||||
* perf: enable strict mode
|
||||
|
||||
2016-01-28 / 1.4.0
|
||||
==================
|
||||
|
||||
* Add `HttpError` export, for `err instanceof createError.HttpError`
|
||||
* deps: inherits@2.0.1
|
||||
* deps: statuses@'>= 1.2.1 < 2'
|
||||
- Fix message for status 451
|
||||
- Remove incorrect nginx status code
|
||||
|
||||
2015-02-02 / 1.3.1
|
||||
==================
|
||||
|
||||
* Fix regression where status can be overwritten in `createError` `props`
|
||||
|
||||
2015-02-01 / 1.3.0
|
||||
==================
|
||||
|
||||
* Construct errors using defined constructors from `createError`
|
||||
* Fix error names that are not identifiers
|
||||
- `createError["I'mateapot"]` is now `createError.ImATeapot`
|
||||
* Set a meaningful `name` property on constructed errors
|
||||
|
||||
2014-12-09 / 1.2.8
|
||||
==================
|
||||
|
||||
* Fix stack trace from exported function
|
||||
* Remove `arguments.callee` usage
|
||||
|
||||
2014-10-14 / 1.2.7
|
||||
==================
|
||||
|
||||
* Remove duplicate line
|
||||
|
||||
2014-10-02 / 1.2.6
|
||||
==================
|
||||
|
||||
* Fix `expose` to be `true` for `ClientError` constructor
|
||||
|
||||
2014-09-28 / 1.2.5
|
||||
==================
|
||||
|
||||
* deps: statuses@1
|
||||
|
||||
2014-09-21 / 1.2.4
|
||||
==================
|
||||
|
||||
* Fix dependency version to work with old `npm`s
|
||||
|
||||
2014-09-21 / 1.2.3
|
||||
==================
|
||||
|
||||
* deps: statuses@~1.1.0
|
||||
|
||||
2014-09-21 / 1.2.2
|
||||
==================
|
||||
|
||||
* Fix publish error
|
||||
|
||||
2014-09-21 / 1.2.1
|
||||
==================
|
||||
|
||||
* Support Node.js 0.6
|
||||
* Use `inherits` instead of `util`
|
||||
|
||||
2014-09-09 / 1.2.0
|
||||
==================
|
||||
|
||||
* Fix the way inheriting functions
|
||||
* Support `expose` being provided in properties argument
|
||||
|
||||
2014-09-08 / 1.1.0
|
||||
==================
|
||||
|
||||
* Default status to 500
|
||||
* Support provided `error` to extend
|
||||
|
||||
2014-09-08 / 1.0.1
|
||||
==================
|
||||
|
||||
* Fix accepting string message
|
||||
|
||||
2014-09-08 / 1.0.0
|
||||
==================
|
||||
|
||||
* Initial release
|
||||
23
node_modules/body-parser/node_modules/http-errors/LICENSE
generated
vendored
Normal file
23
node_modules/body-parser/node_modules/http-errors/LICENSE
generated
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014 Jonathan Ong me@jongleberry.com
|
||||
Copyright (c) 2016 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.
|
||||
135
node_modules/body-parser/node_modules/http-errors/README.md
generated
vendored
Normal file
135
node_modules/body-parser/node_modules/http-errors/README.md
generated
vendored
Normal file
@ -0,0 +1,135 @@
|
||||
# http-errors
|
||||
|
||||
[![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]
|
||||
|
||||
Create HTTP errors for Express, Koa, Connect, etc. with ease.
|
||||
|
||||
## Install
|
||||
|
||||
This is a [Node.js](https://nodejs.org/en/) module available through the
|
||||
[npm registry](https://www.npmjs.com/). Installation is done using the
|
||||
[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):
|
||||
|
||||
```bash
|
||||
$ npm install http-errors
|
||||
```
|
||||
|
||||
## Example
|
||||
|
||||
```js
|
||||
var createError = require('http-errors')
|
||||
var express = require('express')
|
||||
var app = express()
|
||||
|
||||
app.use(function (req, res, next) {
|
||||
if (!req.user) return next(createError(401, 'Please login to view this page.'))
|
||||
next()
|
||||
})
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
This is the current API, currently extracted from Koa and subject to change.
|
||||
|
||||
All errors inherit from JavaScript `Error` and the exported `createError.HttpError`.
|
||||
|
||||
### Error Properties
|
||||
|
||||
- `expose` - can be used to signal if `message` should be sent to the client,
|
||||
defaulting to `false` when `status` >= 500
|
||||
- `headers` - can be an object of header names to values to be sent to the
|
||||
client, defaulting to `undefined`. When defined, the key names should all
|
||||
be lower-cased
|
||||
- `message` - the traditional error message, which should be kept short and all
|
||||
single line
|
||||
- `status` - the status code of the error, mirroring `statusCode` for general
|
||||
compatibility
|
||||
- `statusCode` - the status code of the error, defaulting to `500`
|
||||
|
||||
### createError([status], [message], [properties])
|
||||
|
||||
<!-- eslint-disable no-undef, no-unused-vars -->
|
||||
|
||||
```js
|
||||
var err = createError(404, 'This video does not exist!')
|
||||
```
|
||||
|
||||
- `status: 500` - the status code as a number
|
||||
- `message` - the message of the error, defaulting to node's text for that status code.
|
||||
- `properties` - custom properties to attach to the object
|
||||
|
||||
### new createError\[code || name\](\[msg]\))
|
||||
|
||||
<!-- eslint-disable no-undef, no-unused-vars -->
|
||||
|
||||
```js
|
||||
var err = new createError.NotFound()
|
||||
```
|
||||
|
||||
- `code` - the status code as a number
|
||||
- `name` - the name of the error as a "bumpy case", i.e. `NotFound` or `InternalServerError`.
|
||||
|
||||
#### List of all constructors
|
||||
|
||||
|Status Code|Constructor Name |
|
||||
|-----------|-----------------------------|
|
||||
|400 |BadRequest |
|
||||
|401 |Unauthorized |
|
||||
|402 |PaymentRequired |
|
||||
|403 |Forbidden |
|
||||
|404 |NotFound |
|
||||
|405 |MethodNotAllowed |
|
||||
|406 |NotAcceptable |
|
||||
|407 |ProxyAuthenticationRequired |
|
||||
|408 |RequestTimeout |
|
||||
|409 |Conflict |
|
||||
|410 |Gone |
|
||||
|411 |LengthRequired |
|
||||
|412 |PreconditionFailed |
|
||||
|413 |PayloadTooLarge |
|
||||
|414 |URITooLong |
|
||||
|415 |UnsupportedMediaType |
|
||||
|416 |RangeNotSatisfiable |
|
||||
|417 |ExpectationFailed |
|
||||
|418 |ImATeapot |
|
||||
|421 |MisdirectedRequest |
|
||||
|422 |UnprocessableEntity |
|
||||
|423 |Locked |
|
||||
|424 |FailedDependency |
|
||||
|425 |UnorderedCollection |
|
||||
|426 |UpgradeRequired |
|
||||
|428 |PreconditionRequired |
|
||||
|429 |TooManyRequests |
|
||||
|431 |RequestHeaderFieldsTooLarge |
|
||||
|451 |UnavailableForLegalReasons |
|
||||
|500 |InternalServerError |
|
||||
|501 |NotImplemented |
|
||||
|502 |BadGateway |
|
||||
|503 |ServiceUnavailable |
|
||||
|504 |GatewayTimeout |
|
||||
|505 |HTTPVersionNotSupported |
|
||||
|506 |VariantAlsoNegotiates |
|
||||
|507 |InsufficientStorage |
|
||||
|508 |LoopDetected |
|
||||
|509 |BandwidthLimitExceeded |
|
||||
|510 |NotExtended |
|
||||
|511 |NetworkAuthenticationRequired|
|
||||
|
||||
## License
|
||||
|
||||
[MIT](LICENSE)
|
||||
|
||||
[npm-image]: https://img.shields.io/npm/v/http-errors.svg
|
||||
[npm-url]: https://npmjs.org/package/http-errors
|
||||
[node-version-image]: https://img.shields.io/node/v/http-errors.svg
|
||||
[node-version-url]: https://nodejs.org/en/download/
|
||||
[travis-image]: https://img.shields.io/travis/jshttp/http-errors.svg
|
||||
[travis-url]: https://travis-ci.org/jshttp/http-errors
|
||||
[coveralls-image]: https://img.shields.io/coveralls/jshttp/http-errors.svg
|
||||
[coveralls-url]: https://coveralls.io/r/jshttp/http-errors
|
||||
[downloads-image]: https://img.shields.io/npm/dm/http-errors.svg
|
||||
[downloads-url]: https://npmjs.org/package/http-errors
|
||||
260
node_modules/body-parser/node_modules/http-errors/index.js
generated
vendored
Normal file
260
node_modules/body-parser/node_modules/http-errors/index.js
generated
vendored
Normal file
@ -0,0 +1,260 @@
|
||||
/*!
|
||||
* http-errors
|
||||
* Copyright(c) 2014 Jonathan Ong
|
||||
* Copyright(c) 2016 Douglas Christopher Wilson
|
||||
* MIT Licensed
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
/**
|
||||
* Module dependencies.
|
||||
* @private
|
||||
*/
|
||||
|
||||
var deprecate = require('depd')('http-errors')
|
||||
var setPrototypeOf = require('setprototypeof')
|
||||
var statuses = require('statuses')
|
||||
var inherits = require('inherits')
|
||||
|
||||
/**
|
||||
* Module exports.
|
||||
* @public
|
||||
*/
|
||||
|
||||
module.exports = createError
|
||||
module.exports.HttpError = createHttpErrorConstructor()
|
||||
|
||||
// Populate exports for all constructors
|
||||
populateConstructorExports(module.exports, statuses.codes, module.exports.HttpError)
|
||||
|
||||
/**
|
||||
* Get the code class of a status code.
|
||||
* @private
|
||||
*/
|
||||
|
||||
function codeClass (status) {
|
||||
return Number(String(status).charAt(0) + '00')
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new HTTP Error.
|
||||
*
|
||||
* @returns {Error}
|
||||
* @public
|
||||
*/
|
||||
|
||||
function createError () {
|
||||
// so much arity going on ~_~
|
||||
var err
|
||||
var msg
|
||||
var status = 500
|
||||
var props = {}
|
||||
for (var i = 0; i < arguments.length; i++) {
|
||||
var arg = arguments[i]
|
||||
if (arg instanceof Error) {
|
||||
err = arg
|
||||
status = err.status || err.statusCode || status
|
||||
continue
|
||||
}
|
||||
switch (typeof arg) {
|
||||
case 'string':
|
||||
msg = arg
|
||||
break
|
||||
case 'number':
|
||||
status = arg
|
||||
if (i !== 0) {
|
||||
deprecate('non-first-argument status code; replace with createError(' + arg + ', ...)')
|
||||
}
|
||||
break
|
||||
case 'object':
|
||||
props = arg
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
if (typeof status === 'number' && (status < 400 || status >= 600)) {
|
||||
deprecate('non-error status code; use only 4xx or 5xx status codes')
|
||||
}
|
||||
|
||||
if (typeof status !== 'number' ||
|
||||
(!statuses[status] && (status < 400 || status >= 600))) {
|
||||
status = 500
|
||||
}
|
||||
|
||||
// constructor
|
||||
var HttpError = createError[status] || createError[codeClass(status)]
|
||||
|
||||
if (!err) {
|
||||
// create error
|
||||
err = HttpError
|
||||
? new HttpError(msg)
|
||||
: new Error(msg || statuses[status])
|
||||
Error.captureStackTrace(err, createError)
|
||||
}
|
||||
|
||||
if (!HttpError || !(err instanceof HttpError) || err.status !== status) {
|
||||
// add properties to generic error
|
||||
err.expose = status < 500
|
||||
err.status = err.statusCode = status
|
||||
}
|
||||
|
||||
for (var key in props) {
|
||||
if (key !== 'status' && key !== 'statusCode') {
|
||||
err[key] = props[key]
|
||||
}
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
/**
|
||||
* Create HTTP error abstract base class.
|
||||
* @private
|
||||
*/
|
||||
|
||||
function createHttpErrorConstructor () {
|
||||
function HttpError () {
|
||||
throw new TypeError('cannot construct abstract class')
|
||||
}
|
||||
|
||||
inherits(HttpError, Error)
|
||||
|
||||
return HttpError
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a constructor for a client error.
|
||||
* @private
|
||||
*/
|
||||
|
||||
function createClientErrorConstructor (HttpError, name, code) {
|
||||
var className = name.match(/Error$/) ? name : name + 'Error'
|
||||
|
||||
function ClientError (message) {
|
||||
// create the error object
|
||||
var msg = message != null ? message : statuses[code]
|
||||
var err = new Error(msg)
|
||||
|
||||
// capture a stack trace to the construction point
|
||||
Error.captureStackTrace(err, ClientError)
|
||||
|
||||
// adjust the [[Prototype]]
|
||||
setPrototypeOf(err, ClientError.prototype)
|
||||
|
||||
// redefine the error message
|
||||
Object.defineProperty(err, 'message', {
|
||||
enumerable: true,
|
||||
configurable: true,
|
||||
value: msg,
|
||||
writable: true
|
||||
})
|
||||
|
||||
// redefine the error name
|
||||
Object.defineProperty(err, 'name', {
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
value: className,
|
||||
writable: true
|
||||
})
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
inherits(ClientError, HttpError)
|
||||
|
||||
ClientError.prototype.status = code
|
||||
ClientError.prototype.statusCode = code
|
||||
ClientError.prototype.expose = true
|
||||
|
||||
return ClientError
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a constructor for a server error.
|
||||
* @private
|
||||
*/
|
||||
|
||||
function createServerErrorConstructor (HttpError, name, code) {
|
||||
var className = name.match(/Error$/) ? name : name + 'Error'
|
||||
|
||||
function ServerError (message) {
|
||||
// create the error object
|
||||
var msg = message != null ? message : statuses[code]
|
||||
var err = new Error(msg)
|
||||
|
||||
// capture a stack trace to the construction point
|
||||
Error.captureStackTrace(err, ServerError)
|
||||
|
||||
// adjust the [[Prototype]]
|
||||
setPrototypeOf(err, ServerError.prototype)
|
||||
|
||||
// redefine the error message
|
||||
Object.defineProperty(err, 'message', {
|
||||
enumerable: true,
|
||||
configurable: true,
|
||||
value: msg,
|
||||
writable: true
|
||||
})
|
||||
|
||||
// redefine the error name
|
||||
Object.defineProperty(err, 'name', {
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
value: className,
|
||||
writable: true
|
||||
})
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
inherits(ServerError, HttpError)
|
||||
|
||||
ServerError.prototype.status = code
|
||||
ServerError.prototype.statusCode = code
|
||||
ServerError.prototype.expose = false
|
||||
|
||||
return ServerError
|
||||
}
|
||||
|
||||
/**
|
||||
* Populate the exports object with constructors for every error class.
|
||||
* @private
|
||||
*/
|
||||
|
||||
function populateConstructorExports (exports, codes, HttpError) {
|
||||
codes.forEach(function forEachCode (code) {
|
||||
var CodeError
|
||||
var name = toIdentifier(statuses[code])
|
||||
|
||||
switch (codeClass(code)) {
|
||||
case 400:
|
||||
CodeError = createClientErrorConstructor(HttpError, name, code)
|
||||
break
|
||||
case 500:
|
||||
CodeError = createServerErrorConstructor(HttpError, name, code)
|
||||
break
|
||||
}
|
||||
|
||||
if (CodeError) {
|
||||
// export the constructor
|
||||
exports[code] = CodeError
|
||||
exports[name] = CodeError
|
||||
}
|
||||
})
|
||||
|
||||
// backwards-compatibility
|
||||
exports["I'mateapot"] = deprecate.function(exports.ImATeapot,
|
||||
'"I\'mateapot"; use "ImATeapot" instead')
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert a string of words to a JavaScript identifier.
|
||||
* @private
|
||||
*/
|
||||
|
||||
function toIdentifier (str) {
|
||||
return str.split(' ').map(function (token) {
|
||||
return token.slice(0, 1).toUpperCase() + token.slice(1)
|
||||
}).join('').replace(/[^ _0-9a-z]/gi, '')
|
||||
}
|
||||
90
node_modules/body-parser/node_modules/http-errors/package.json
generated
vendored
Normal file
90
node_modules/body-parser/node_modules/http-errors/package.json
generated
vendored
Normal file
@ -0,0 +1,90 @@
|
||||
{
|
||||
"_from": "http-errors@~1.6.3",
|
||||
"_id": "http-errors@1.6.3",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0=",
|
||||
"_location": "/body-parser/http-errors",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "http-errors@~1.6.3",
|
||||
"name": "http-errors",
|
||||
"escapedName": "http-errors",
|
||||
"rawSpec": "~1.6.3",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "~1.6.3"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/body-parser"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz",
|
||||
"_shasum": "8b55680bb4be283a0b5bf4ea2e38580be1d9320d",
|
||||
"_spec": "http-errors@~1.6.3",
|
||||
"_where": "C:\\Users\\jonio\\Documents\\Programmieren\\Miniportal\\Neu\\MiniportalAPI\\node_modules\\body-parser",
|
||||
"author": {
|
||||
"name": "Jonathan Ong",
|
||||
"email": "me@jongleberry.com",
|
||||
"url": "http://jongleberry.com"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/jshttp/http-errors/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Alan Plum",
|
||||
"email": "me@pluma.io"
|
||||
},
|
||||
{
|
||||
"name": "Douglas Christopher Wilson",
|
||||
"email": "doug@somethingdoug.com"
|
||||
}
|
||||
],
|
||||
"dependencies": {
|
||||
"depd": "~1.1.2",
|
||||
"inherits": "2.0.3",
|
||||
"setprototypeof": "1.1.0",
|
||||
"statuses": ">= 1.4.0 < 2"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "Create HTTP error objects",
|
||||
"devDependencies": {
|
||||
"eslint": "4.18.1",
|
||||
"eslint-config-standard": "11.0.0",
|
||||
"eslint-plugin-import": "2.9.0",
|
||||
"eslint-plugin-markdown": "1.0.0-beta.6",
|
||||
"eslint-plugin-node": "6.0.1",
|
||||
"eslint-plugin-promise": "3.6.0",
|
||||
"eslint-plugin-standard": "3.0.1",
|
||||
"istanbul": "0.4.5",
|
||||
"mocha": "1.21.5"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
"HISTORY.md",
|
||||
"LICENSE",
|
||||
"README.md"
|
||||
],
|
||||
"homepage": "https://github.com/jshttp/http-errors#readme",
|
||||
"keywords": [
|
||||
"http",
|
||||
"error"
|
||||
],
|
||||
"license": "MIT",
|
||||
"name": "http-errors",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/jshttp/http-errors.git"
|
||||
},
|
||||
"scripts": {
|
||||
"lint": "eslint --plugin markdown --ext js,md .",
|
||||
"test": "mocha --reporter spec --bail",
|
||||
"test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot",
|
||||
"test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter dot"
|
||||
},
|
||||
"version": "1.6.3"
|
||||
}
|
||||
384
node_modules/body-parser/node_modules/mime-db/HISTORY.md
generated
vendored
Normal file
384
node_modules/body-parser/node_modules/mime-db/HISTORY.md
generated
vendored
Normal file
@ -0,0 +1,384 @@
|
||||
1.35.0 / 2018-07-15
|
||||
===================
|
||||
|
||||
* Add extension `.owl` to `application/rdf+xml`
|
||||
* Add new upstream MIME types
|
||||
- Removes extension `.woff` from `application/font-woff`
|
||||
|
||||
1.34.0 / 2018-06-03
|
||||
===================
|
||||
|
||||
* Add extension `.csl` to `application/vnd.citationstyles.style+xml`
|
||||
* Add extension `.es` to `application/ecmascript`
|
||||
* Add new upstream MIME types
|
||||
* Add `UTF-8` as default charset for `text/turtle`
|
||||
* Mark all XML-derived types as compressible
|
||||
|
||||
1.33.0 / 2018-02-15
|
||||
===================
|
||||
|
||||
* Add extensions from IANA for `message/*` types
|
||||
* Add new upstream MIME types
|
||||
* Fix some incorrect OOXML types
|
||||
* Remove `application/font-woff2`
|
||||
|
||||
1.32.0 / 2017-11-29
|
||||
===================
|
||||
|
||||
* Add new upstream MIME types
|
||||
* Update `text/hjson` to registered `application/hjson`
|
||||
* Add `text/shex` with extension `.shex`
|
||||
|
||||
1.31.0 / 2017-10-25
|
||||
===================
|
||||
|
||||
* Add `application/raml+yaml` with extension `.raml`
|
||||
* Add `application/wasm` with extension `.wasm`
|
||||
* Add new `font` type from IANA
|
||||
* Add new upstream font extensions
|
||||
* Add new upstream MIME types
|
||||
* Add extensions for JPEG-2000 images
|
||||
|
||||
1.30.0 / 2017-08-27
|
||||
===================
|
||||
|
||||
* Add `application/vnd.ms-outlook`
|
||||
* Add `application/x-arj`
|
||||
* Add extension `.mjs` to `application/javascript`
|
||||
* Add glTF types and extensions
|
||||
* Add new upstream MIME types
|
||||
* Add `text/x-org`
|
||||
* Add VirtualBox MIME types
|
||||
* Fix `source` records for `video/*` types that are IANA
|
||||
* Update `font/opentype` to registered `font/otf`
|
||||
|
||||
1.29.0 / 2017-07-10
|
||||
===================
|
||||
|
||||
* Add `application/fido.trusted-apps+json`
|
||||
* Add extension `.wadl` to `application/vnd.sun.wadl+xml`
|
||||
* Add new upstream MIME types
|
||||
* Add `UTF-8` as default charset for `text/css`
|
||||
|
||||
1.28.0 / 2017-05-14
|
||||
===================
|
||||
|
||||
* Add new upstream MIME types
|
||||
* Add extension `.gz` to `application/gzip`
|
||||
* Update extensions `.md` and `.markdown` to be `text/markdown`
|
||||
|
||||
1.27.0 / 2017-03-16
|
||||
===================
|
||||
|
||||
* Add new upstream MIME types
|
||||
* Add `image/apng` with extension `.apng`
|
||||
|
||||
1.26.0 / 2017-01-14
|
||||
===================
|
||||
|
||||
* Add new upstream MIME types
|
||||
* Add extension `.geojson` to `application/geo+json`
|
||||
|
||||
1.25.0 / 2016-11-11
|
||||
===================
|
||||
|
||||
* Add new upstream MIME types
|
||||
|
||||
1.24.0 / 2016-09-18
|
||||
===================
|
||||
|
||||
* Add `audio/mp3`
|
||||
* Add new upstream MIME types
|
||||
|
||||
1.23.0 / 2016-05-01
|
||||
===================
|
||||
|
||||
* Add new upstream MIME types
|
||||
* Add extension `.3gpp` to `audio/3gpp`
|
||||
|
||||
1.22.0 / 2016-02-15
|
||||
===================
|
||||
|
||||
* Add `text/slim`
|
||||
* Add extension `.rng` to `application/xml`
|
||||
* Add new upstream MIME types
|
||||
* Fix extension of `application/dash+xml` to be `.mpd`
|
||||
* Update primary extension to `.m4a` for `audio/mp4`
|
||||
|
||||
1.21.0 / 2016-01-06
|
||||
===================
|
||||
|
||||
* Add Google document types
|
||||
* Add new upstream MIME types
|
||||
|
||||
1.20.0 / 2015-11-10
|
||||
===================
|
||||
|
||||
* Add `text/x-suse-ymp`
|
||||
* Add new upstream MIME types
|
||||
|
||||
1.19.0 / 2015-09-17
|
||||
===================
|
||||
|
||||
* Add `application/vnd.apple.pkpass`
|
||||
* Add new upstream MIME types
|
||||
|
||||
1.18.0 / 2015-09-03
|
||||
===================
|
||||
|
||||
* Add new upstream MIME types
|
||||
|
||||
1.17.0 / 2015-08-13
|
||||
===================
|
||||
|
||||
* Add `application/x-msdos-program`
|
||||
* Add `audio/g711-0`
|
||||
* Add `image/vnd.mozilla.apng`
|
||||
* Add extension `.exe` to `application/x-msdos-program`
|
||||
|
||||
1.16.0 / 2015-07-29
|
||||
===================
|
||||
|
||||
* Add `application/vnd.uri-map`
|
||||
|
||||
1.15.0 / 2015-07-13
|
||||
===================
|
||||
|
||||
* Add `application/x-httpd-php`
|
||||
|
||||
1.14.0 / 2015-06-25
|
||||
===================
|
||||
|
||||
* Add `application/scim+json`
|
||||
* Add `application/vnd.3gpp.ussd+xml`
|
||||
* Add `application/vnd.biopax.rdf+xml`
|
||||
* Add `text/x-processing`
|
||||
|
||||
1.13.0 / 2015-06-07
|
||||
===================
|
||||
|
||||
* Add nginx as a source
|
||||
* Add `application/x-cocoa`
|
||||
* Add `application/x-java-archive-diff`
|
||||
* Add `application/x-makeself`
|
||||
* Add `application/x-perl`
|
||||
* Add `application/x-pilot`
|
||||
* Add `application/x-redhat-package-manager`
|
||||
* Add `application/x-sea`
|
||||
* Add `audio/x-m4a`
|
||||
* Add `audio/x-realaudio`
|
||||
* Add `image/x-jng`
|
||||
* Add `text/mathml`
|
||||
|
||||
1.12.0 / 2015-06-05
|
||||
===================
|
||||
|
||||
* Add `application/bdoc`
|
||||
* Add `application/vnd.hyperdrive+json`
|
||||
* Add `application/x-bdoc`
|
||||
* Add extension `.rtf` to `text/rtf`
|
||||
|
||||
1.11.0 / 2015-05-31
|
||||
===================
|
||||
|
||||
* Add `audio/wav`
|
||||
* Add `audio/wave`
|
||||
* Add extension `.litcoffee` to `text/coffeescript`
|
||||
* Add extension `.sfd-hdstx` to `application/vnd.hydrostatix.sof-data`
|
||||
* Add extension `.n-gage` to `application/vnd.nokia.n-gage.symbian.install`
|
||||
|
||||
1.10.0 / 2015-05-19
|
||||
===================
|
||||
|
||||
* Add `application/vnd.balsamiq.bmpr`
|
||||
* Add `application/vnd.microsoft.portable-executable`
|
||||
* Add `application/x-ns-proxy-autoconfig`
|
||||
|
||||
1.9.1 / 2015-04-19
|
||||
==================
|
||||
|
||||
* Remove `.json` extension from `application/manifest+json`
|
||||
- This is causing bugs downstream
|
||||
|
||||
1.9.0 / 2015-04-19
|
||||
==================
|
||||
|
||||
* Add `application/manifest+json`
|
||||
* Add `application/vnd.micro+json`
|
||||
* Add `image/vnd.zbrush.pcx`
|
||||
* Add `image/x-ms-bmp`
|
||||
|
||||
1.8.0 / 2015-03-13
|
||||
==================
|
||||
|
||||
* Add `application/vnd.citationstyles.style+xml`
|
||||
* Add `application/vnd.fastcopy-disk-image`
|
||||
* Add `application/vnd.gov.sk.xmldatacontainer+xml`
|
||||
* Add extension `.jsonld` to `application/ld+json`
|
||||
|
||||
1.7.0 / 2015-02-08
|
||||
==================
|
||||
|
||||
* Add `application/vnd.gerber`
|
||||
* Add `application/vnd.msa-disk-image`
|
||||
|
||||
1.6.1 / 2015-02-05
|
||||
==================
|
||||
|
||||
* Community extensions ownership transferred from `node-mime`
|
||||
|
||||
1.6.0 / 2015-01-29
|
||||
==================
|
||||
|
||||
* Add `application/jose`
|
||||
* Add `application/jose+json`
|
||||
* Add `application/json-seq`
|
||||
* Add `application/jwk+json`
|
||||
* Add `application/jwk-set+json`
|
||||
* Add `application/jwt`
|
||||
* Add `application/rdap+json`
|
||||
* Add `application/vnd.gov.sk.e-form+xml`
|
||||
* Add `application/vnd.ims.imsccv1p3`
|
||||
|
||||
1.5.0 / 2014-12-30
|
||||
==================
|
||||
|
||||
* Add `application/vnd.oracle.resource+json`
|
||||
* Fix various invalid MIME type entries
|
||||
- `application/mbox+xml`
|
||||
- `application/oscp-response`
|
||||
- `application/vwg-multiplexed`
|
||||
- `audio/g721`
|
||||
|
||||
1.4.0 / 2014-12-21
|
||||
==================
|
||||
|
||||
* Add `application/vnd.ims.imsccv1p2`
|
||||
* Fix various invalid MIME type entries
|
||||
- `application/vnd-acucobol`
|
||||
- `application/vnd-curl`
|
||||
- `application/vnd-dart`
|
||||
- `application/vnd-dxr`
|
||||
- `application/vnd-fdf`
|
||||
- `application/vnd-mif`
|
||||
- `application/vnd-sema`
|
||||
- `application/vnd-wap-wmlc`
|
||||
- `application/vnd.adobe.flash-movie`
|
||||
- `application/vnd.dece-zip`
|
||||
- `application/vnd.dvb_service`
|
||||
- `application/vnd.micrografx-igx`
|
||||
- `application/vnd.sealed-doc`
|
||||
- `application/vnd.sealed-eml`
|
||||
- `application/vnd.sealed-mht`
|
||||
- `application/vnd.sealed-ppt`
|
||||
- `application/vnd.sealed-tiff`
|
||||
- `application/vnd.sealed-xls`
|
||||
- `application/vnd.sealedmedia.softseal-html`
|
||||
- `application/vnd.sealedmedia.softseal-pdf`
|
||||
- `application/vnd.wap-slc`
|
||||
- `application/vnd.wap-wbxml`
|
||||
- `audio/vnd.sealedmedia.softseal-mpeg`
|
||||
- `image/vnd-djvu`
|
||||
- `image/vnd-svf`
|
||||
- `image/vnd-wap-wbmp`
|
||||
- `image/vnd.sealed-png`
|
||||
- `image/vnd.sealedmedia.softseal-gif`
|
||||
- `image/vnd.sealedmedia.softseal-jpg`
|
||||
- `model/vnd-dwf`
|
||||
- `model/vnd.parasolid.transmit-binary`
|
||||
- `model/vnd.parasolid.transmit-text`
|
||||
- `text/vnd-a`
|
||||
- `text/vnd-curl`
|
||||
- `text/vnd.wap-wml`
|
||||
* Remove example template MIME types
|
||||
- `application/example`
|
||||
- `audio/example`
|
||||
- `image/example`
|
||||
- `message/example`
|
||||
- `model/example`
|
||||
- `multipart/example`
|
||||
- `text/example`
|
||||
- `video/example`
|
||||
|
||||
1.3.1 / 2014-12-16
|
||||
==================
|
||||
|
||||
* Fix missing extensions
|
||||
- `application/json5`
|
||||
- `text/hjson`
|
||||
|
||||
1.3.0 / 2014-12-07
|
||||
==================
|
||||
|
||||
* Add `application/a2l`
|
||||
* Add `application/aml`
|
||||
* Add `application/atfx`
|
||||
* Add `application/atxml`
|
||||
* Add `application/cdfx+xml`
|
||||
* Add `application/dii`
|
||||
* Add `application/json5`
|
||||
* Add `application/lxf`
|
||||
* Add `application/mf4`
|
||||
* Add `application/vnd.apache.thrift.compact`
|
||||
* Add `application/vnd.apache.thrift.json`
|
||||
* Add `application/vnd.coffeescript`
|
||||
* Add `application/vnd.enphase.envoy`
|
||||
* Add `application/vnd.ims.imsccv1p1`
|
||||
* Add `text/csv-schema`
|
||||
* Add `text/hjson`
|
||||
* Add `text/markdown`
|
||||
* Add `text/yaml`
|
||||
|
||||
1.2.0 / 2014-11-09
|
||||
==================
|
||||
|
||||
* Add `application/cea`
|
||||
* Add `application/dit`
|
||||
* Add `application/vnd.gov.sk.e-form+zip`
|
||||
* Add `application/vnd.tmd.mediaflex.api+xml`
|
||||
* Type `application/epub+zip` is now IANA-registered
|
||||
|
||||
1.1.2 / 2014-10-23
|
||||
==================
|
||||
|
||||
* Rebuild database for `application/x-www-form-urlencoded` change
|
||||
|
||||
1.1.1 / 2014-10-20
|
||||
==================
|
||||
|
||||
* Mark `application/x-www-form-urlencoded` as compressible.
|
||||
|
||||
1.1.0 / 2014-09-28
|
||||
==================
|
||||
|
||||
* Add `application/font-woff2`
|
||||
|
||||
1.0.3 / 2014-09-25
|
||||
==================
|
||||
|
||||
* Fix engine requirement in package
|
||||
|
||||
1.0.2 / 2014-09-25
|
||||
==================
|
||||
|
||||
* Add `application/coap-group+json`
|
||||
* Add `application/dcd`
|
||||
* Add `application/vnd.apache.thrift.binary`
|
||||
* Add `image/vnd.tencent.tap`
|
||||
* Mark all JSON-derived types as compressible
|
||||
* Update `text/vtt` data
|
||||
|
||||
1.0.1 / 2014-08-30
|
||||
==================
|
||||
|
||||
* Fix extension ordering
|
||||
|
||||
1.0.0 / 2014-08-30
|
||||
==================
|
||||
|
||||
* Add `application/atf`
|
||||
* Add `application/merge-patch+json`
|
||||
* Add `multipart/x-mixed-replace`
|
||||
* Add `source: 'apache'` metadata
|
||||
* Add `source: 'iana'` metadata
|
||||
* Remove badly-assumed charset data
|
||||
22
node_modules/body-parser/node_modules/mime-db/LICENSE
generated
vendored
Normal file
22
node_modules/body-parser/node_modules/mime-db/LICENSE
generated
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014 Jonathan Ong me@jongleberry.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.
|
||||
94
node_modules/body-parser/node_modules/mime-db/README.md
generated
vendored
Normal file
94
node_modules/body-parser/node_modules/mime-db/README.md
generated
vendored
Normal file
@ -0,0 +1,94 @@
|
||||
# mime-db
|
||||
|
||||
[![NPM Version][npm-version-image]][npm-url]
|
||||
[![NPM Downloads][npm-downloads-image]][npm-url]
|
||||
[![Node.js Version][node-image]][node-url]
|
||||
[![Build Status][travis-image]][travis-url]
|
||||
[![Coverage Status][coveralls-image]][coveralls-url]
|
||||
|
||||
This is a database of all mime types.
|
||||
It consists of a single, public JSON file and does not include any logic,
|
||||
allowing it to remain as un-opinionated as possible with an API.
|
||||
It aggregates data from the following sources:
|
||||
|
||||
- http://www.iana.org/assignments/media-types/media-types.xhtml
|
||||
- http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types
|
||||
- http://hg.nginx.org/nginx/raw-file/default/conf/mime.types
|
||||
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
npm install mime-db
|
||||
```
|
||||
|
||||
### Database Download
|
||||
|
||||
If you're crazy enough to use this in the browser, you can just grab the
|
||||
JSON file using [RawGit](https://rawgit.com/). It is recommended to replace
|
||||
`master` with [a release tag](https://github.com/jshttp/mime-db/tags) as the
|
||||
JSON format may change in the future.
|
||||
|
||||
```
|
||||
https://cdn.rawgit.com/jshttp/mime-db/master/db.json
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
var db = require('mime-db');
|
||||
|
||||
// grab data on .js files
|
||||
var data = db['application/javascript'];
|
||||
```
|
||||
|
||||
## Data Structure
|
||||
|
||||
The JSON file is a map lookup for lowercased mime types.
|
||||
Each mime type has the following properties:
|
||||
|
||||
- `.source` - where the mime type is defined.
|
||||
If not set, it's probably a custom media type.
|
||||
- `apache` - [Apache common media types](http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types)
|
||||
- `iana` - [IANA-defined media types](http://www.iana.org/assignments/media-types/media-types.xhtml)
|
||||
- `nginx` - [nginx media types](http://hg.nginx.org/nginx/raw-file/default/conf/mime.types)
|
||||
- `.extensions[]` - known extensions associated with this mime type.
|
||||
- `.compressible` - whether a file of this type can be gzipped.
|
||||
- `.charset` - the default charset associated with this type, if any.
|
||||
|
||||
If unknown, every property could be `undefined`.
|
||||
|
||||
## Contributing
|
||||
|
||||
To edit the database, only make PRs against `src/custom.json` or
|
||||
`src/custom-suffix.json`.
|
||||
|
||||
The `src/custom.json` file is a JSON object with the MIME type as the keys
|
||||
and the values being an object with the following keys:
|
||||
|
||||
- `compressible` - leave out if you don't know, otherwise `true`/`false` to
|
||||
indicate whether the data represented by the type is typically compressible.
|
||||
- `extensions` - include an array of file extensions that are associated with
|
||||
the type.
|
||||
- `notes` - human-readable notes about the type, typically what the type is.
|
||||
- `sources` - include an array of URLs of where the MIME type and the associated
|
||||
extensions are sourced from. This needs to be a [primary source](https://en.wikipedia.org/wiki/Primary_source);
|
||||
links to type aggregating sites and Wikipedia are _not acceptable_.
|
||||
|
||||
To update the build, run `npm run build`.
|
||||
|
||||
## Adding Custom Media Types
|
||||
|
||||
The best way to get new media types included in this library is to register
|
||||
them with the IANA. The community registration procedure is outlined in
|
||||
[RFC 6838 section 5](http://tools.ietf.org/html/rfc6838#section-5). Types
|
||||
registered with the IANA are automatically pulled into this library.
|
||||
|
||||
[npm-version-image]: https://img.shields.io/npm/v/mime-db.svg
|
||||
[npm-downloads-image]: https://img.shields.io/npm/dm/mime-db.svg
|
||||
[npm-url]: https://npmjs.org/package/mime-db
|
||||
[travis-image]: https://img.shields.io/travis/jshttp/mime-db/master.svg
|
||||
[travis-url]: https://travis-ci.org/jshttp/mime-db
|
||||
[coveralls-image]: https://img.shields.io/coveralls/jshttp/mime-db/master.svg
|
||||
[coveralls-url]: https://coveralls.io/r/jshttp/mime-db?branch=master
|
||||
[node-image]: https://img.shields.io/node/v/mime-db.svg
|
||||
[node-url]: https://nodejs.org/en/download/
|
||||
7621
node_modules/body-parser/node_modules/mime-db/db.json
generated
vendored
Normal file
7621
node_modules/body-parser/node_modules/mime-db/db.json
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
11
node_modules/body-parser/node_modules/mime-db/index.js
generated
vendored
Normal file
11
node_modules/body-parser/node_modules/mime-db/index.js
generated
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
/*!
|
||||
* mime-db
|
||||
* Copyright(c) 2014 Jonathan Ong
|
||||
* MIT Licensed
|
||||
*/
|
||||
|
||||
/**
|
||||
* Module exports.
|
||||
*/
|
||||
|
||||
module.exports = require('./db.json')
|
||||
100
node_modules/body-parser/node_modules/mime-db/package.json
generated
vendored
Normal file
100
node_modules/body-parser/node_modules/mime-db/package.json
generated
vendored
Normal file
@ -0,0 +1,100 @@
|
||||
{
|
||||
"_from": "mime-db@~1.35.0",
|
||||
"_id": "mime-db@1.35.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-JWT/IcCTsB0Io3AhWUMjRqucrHSPsSf2xKLaRldJVULioggvkJvggZ3VXNNSRkCddE6D+BUI4HEIZIA2OjwIvg==",
|
||||
"_location": "/body-parser/mime-db",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "mime-db@~1.35.0",
|
||||
"name": "mime-db",
|
||||
"escapedName": "mime-db",
|
||||
"rawSpec": "~1.35.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "~1.35.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/body-parser/mime-types"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.35.0.tgz",
|
||||
"_shasum": "0569d657466491283709663ad379a99b90d9ab47",
|
||||
"_spec": "mime-db@~1.35.0",
|
||||
"_where": "C:\\Users\\jonio\\Documents\\Programmieren\\Miniportal\\Neu\\MiniportalAPI\\node_modules\\body-parser\\node_modules\\mime-types",
|
||||
"bugs": {
|
||||
"url": "https://github.com/jshttp/mime-db/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Douglas Christopher Wilson",
|
||||
"email": "doug@somethingdoug.com"
|
||||
},
|
||||
{
|
||||
"name": "Jonathan Ong",
|
||||
"email": "me@jongleberry.com",
|
||||
"url": "http://jongleberry.com"
|
||||
},
|
||||
{
|
||||
"name": "Robert Kieffer",
|
||||
"email": "robert@broofa.com",
|
||||
"url": "http://github.com/broofa"
|
||||
}
|
||||
],
|
||||
"deprecated": false,
|
||||
"description": "Media Type Database",
|
||||
"devDependencies": {
|
||||
"bluebird": "3.5.1",
|
||||
"co": "4.6.0",
|
||||
"cogent": "1.0.1",
|
||||
"csv-parse": "2.5.0",
|
||||
"eslint": "4.19.1",
|
||||
"eslint-config-standard": "11.0.0",
|
||||
"eslint-plugin-import": "2.13.0",
|
||||
"eslint-plugin-node": "6.0.1",
|
||||
"eslint-plugin-promise": "3.8.0",
|
||||
"eslint-plugin-standard": "3.1.0",
|
||||
"gnode": "0.1.2",
|
||||
"mocha": "1.21.5",
|
||||
"nyc": "11.8.0",
|
||||
"raw-body": "2.3.3",
|
||||
"stream-to-array": "2.3.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
},
|
||||
"files": [
|
||||
"HISTORY.md",
|
||||
"LICENSE",
|
||||
"README.md",
|
||||
"db.json",
|
||||
"index.js"
|
||||
],
|
||||
"homepage": "https://github.com/jshttp/mime-db#readme",
|
||||
"keywords": [
|
||||
"mime",
|
||||
"db",
|
||||
"type",
|
||||
"types",
|
||||
"database",
|
||||
"charset",
|
||||
"charsets"
|
||||
],
|
||||
"license": "MIT",
|
||||
"name": "mime-db",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/jshttp/mime-db.git"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "node scripts/build",
|
||||
"fetch": "node scripts/fetch-apache && gnode scripts/fetch-iana && node scripts/fetch-nginx",
|
||||
"lint": "eslint .",
|
||||
"test": "mocha --reporter spec --bail --check-leaks test/",
|
||||
"test-cov": "nyc --reporter=html --reporter=text npm test",
|
||||
"test-travis": "nyc --reporter=text npm test",
|
||||
"update": "npm run fetch && npm run build"
|
||||
},
|
||||
"version": "1.35.0"
|
||||
}
|
||||
270
node_modules/body-parser/node_modules/mime-types/HISTORY.md
generated
vendored
Normal file
270
node_modules/body-parser/node_modules/mime-types/HISTORY.md
generated
vendored
Normal file
@ -0,0 +1,270 @@
|
||||
2.1.19 / 2018-07-17
|
||||
===================
|
||||
|
||||
* deps: mime-db@~1.35.0
|
||||
- Add extension `.csl` to `application/vnd.citationstyles.style+xml`
|
||||
- Add extension `.es` to `application/ecmascript`
|
||||
- Add extension `.owl` to `application/rdf+xml`
|
||||
- Add new upstream MIME types
|
||||
- Add UTF-8 as default charset for `text/turtle`
|
||||
|
||||
2.1.18 / 2018-02-16
|
||||
===================
|
||||
|
||||
* deps: mime-db@~1.33.0
|
||||
- Add `application/raml+yaml` with extension `.raml`
|
||||
- Add `application/wasm` with extension `.wasm`
|
||||
- Add `text/shex` with extension `.shex`
|
||||
- Add extensions for JPEG-2000 images
|
||||
- Add extensions from IANA for `message/*` types
|
||||
- Add new upstream MIME types
|
||||
- Update font MIME types
|
||||
- Update `text/hjson` to registered `application/hjson`
|
||||
|
||||
2.1.17 / 2017-09-01
|
||||
===================
|
||||
|
||||
* deps: mime-db@~1.30.0
|
||||
- Add `application/vnd.ms-outlook`
|
||||
- Add `application/x-arj`
|
||||
- Add extension `.mjs` to `application/javascript`
|
||||
- Add glTF types and extensions
|
||||
- Add new upstream MIME types
|
||||
- Add `text/x-org`
|
||||
- Add VirtualBox MIME types
|
||||
- Fix `source` records for `video/*` types that are IANA
|
||||
- Update `font/opentype` to registered `font/otf`
|
||||
|
||||
2.1.16 / 2017-07-24
|
||||
===================
|
||||
|
||||
* deps: mime-db@~1.29.0
|
||||
- Add `application/fido.trusted-apps+json`
|
||||
- Add extension `.wadl` to `application/vnd.sun.wadl+xml`
|
||||
- Add extension `.gz` to `application/gzip`
|
||||
- Add new upstream MIME types
|
||||
- Update extensions `.md` and `.markdown` to be `text/markdown`
|
||||
|
||||
2.1.15 / 2017-03-23
|
||||
===================
|
||||
|
||||
* deps: mime-db@~1.27.0
|
||||
- Add new mime types
|
||||
- Add `image/apng`
|
||||
|
||||
2.1.14 / 2017-01-14
|
||||
===================
|
||||
|
||||
* deps: mime-db@~1.26.0
|
||||
- Add new mime types
|
||||
|
||||
2.1.13 / 2016-11-18
|
||||
===================
|
||||
|
||||
* deps: mime-db@~1.25.0
|
||||
- Add new mime types
|
||||
|
||||
2.1.12 / 2016-09-18
|
||||
===================
|
||||
|
||||
* deps: mime-db@~1.24.0
|
||||
- Add new mime types
|
||||
- Add `audio/mp3`
|
||||
|
||||
2.1.11 / 2016-05-01
|
||||
===================
|
||||
|
||||
* deps: mime-db@~1.23.0
|
||||
- Add new mime types
|
||||
|
||||
2.1.10 / 2016-02-15
|
||||
===================
|
||||
|
||||
* deps: mime-db@~1.22.0
|
||||
- Add new mime types
|
||||
- Fix extension of `application/dash+xml`
|
||||
- Update primary extension for `audio/mp4`
|
||||
|
||||
2.1.9 / 2016-01-06
|
||||
==================
|
||||
|
||||
* deps: mime-db@~1.21.0
|
||||
- Add new mime types
|
||||
|
||||
2.1.8 / 2015-11-30
|
||||
==================
|
||||
|
||||
* deps: mime-db@~1.20.0
|
||||
- Add new mime types
|
||||
|
||||
2.1.7 / 2015-09-20
|
||||
==================
|
||||
|
||||
* deps: mime-db@~1.19.0
|
||||
- Add new mime types
|
||||
|
||||
2.1.6 / 2015-09-03
|
||||
==================
|
||||
|
||||
* deps: mime-db@~1.18.0
|
||||
- Add new mime types
|
||||
|
||||
2.1.5 / 2015-08-20
|
||||
==================
|
||||
|
||||
* deps: mime-db@~1.17.0
|
||||
- Add new mime types
|
||||
|
||||
2.1.4 / 2015-07-30
|
||||
==================
|
||||
|
||||
* deps: mime-db@~1.16.0
|
||||
- Add new mime types
|
||||
|
||||
2.1.3 / 2015-07-13
|
||||
==================
|
||||
|
||||
* deps: mime-db@~1.15.0
|
||||
- Add new mime types
|
||||
|
||||
2.1.2 / 2015-06-25
|
||||
==================
|
||||
|
||||
* deps: mime-db@~1.14.0
|
||||
- Add new mime types
|
||||
|
||||
2.1.1 / 2015-06-08
|
||||
==================
|
||||
|
||||
* perf: fix deopt during mapping
|
||||
|
||||
2.1.0 / 2015-06-07
|
||||
==================
|
||||
|
||||
* Fix incorrectly treating extension-less file name as extension
|
||||
- i.e. `'path/to/json'` will no longer return `application/json`
|
||||
* Fix `.charset(type)` to accept parameters
|
||||
* Fix `.charset(type)` to match case-insensitive
|
||||
* Improve generation of extension to MIME mapping
|
||||
* Refactor internals for readability and no argument reassignment
|
||||
* Prefer `application/*` MIME types from the same source
|
||||
* Prefer any type over `application/octet-stream`
|
||||
* deps: mime-db@~1.13.0
|
||||
- Add nginx as a source
|
||||
- Add new mime types
|
||||
|
||||
2.0.14 / 2015-06-06
|
||||
===================
|
||||
|
||||
* deps: mime-db@~1.12.0
|
||||
- Add new mime types
|
||||
|
||||
2.0.13 / 2015-05-31
|
||||
===================
|
||||
|
||||
* deps: mime-db@~1.11.0
|
||||
- Add new mime types
|
||||
|
||||
2.0.12 / 2015-05-19
|
||||
===================
|
||||
|
||||
* deps: mime-db@~1.10.0
|
||||
- Add new mime types
|
||||
|
||||
2.0.11 / 2015-05-05
|
||||
===================
|
||||
|
||||
* deps: mime-db@~1.9.1
|
||||
- Add new mime types
|
||||
|
||||
2.0.10 / 2015-03-13
|
||||
===================
|
||||
|
||||
* deps: mime-db@~1.8.0
|
||||
- Add new mime types
|
||||
|
||||
2.0.9 / 2015-02-09
|
||||
==================
|
||||
|
||||
* deps: mime-db@~1.7.0
|
||||
- Add new mime types
|
||||
- Community extensions ownership transferred from `node-mime`
|
||||
|
||||
2.0.8 / 2015-01-29
|
||||
==================
|
||||
|
||||
* deps: mime-db@~1.6.0
|
||||
- Add new mime types
|
||||
|
||||
2.0.7 / 2014-12-30
|
||||
==================
|
||||
|
||||
* deps: mime-db@~1.5.0
|
||||
- Add new mime types
|
||||
- Fix various invalid MIME type entries
|
||||
|
||||
2.0.6 / 2014-12-30
|
||||
==================
|
||||
|
||||
* deps: mime-db@~1.4.0
|
||||
- Add new mime types
|
||||
- Fix various invalid MIME type entries
|
||||
- Remove example template MIME types
|
||||
|
||||
2.0.5 / 2014-12-29
|
||||
==================
|
||||
|
||||
* deps: mime-db@~1.3.1
|
||||
- Fix missing extensions
|
||||
|
||||
2.0.4 / 2014-12-10
|
||||
==================
|
||||
|
||||
* deps: mime-db@~1.3.0
|
||||
- Add new mime types
|
||||
|
||||
2.0.3 / 2014-11-09
|
||||
==================
|
||||
|
||||
* deps: mime-db@~1.2.0
|
||||
- Add new mime types
|
||||
|
||||
2.0.2 / 2014-09-28
|
||||
==================
|
||||
|
||||
* deps: mime-db@~1.1.0
|
||||
- Add new mime types
|
||||
- Add additional compressible
|
||||
- Update charsets
|
||||
|
||||
2.0.1 / 2014-09-07
|
||||
==================
|
||||
|
||||
* Support Node.js 0.6
|
||||
|
||||
2.0.0 / 2014-09-02
|
||||
==================
|
||||
|
||||
* Use `mime-db`
|
||||
* Remove `.define()`
|
||||
|
||||
1.0.2 / 2014-08-04
|
||||
==================
|
||||
|
||||
* Set charset=utf-8 for `text/javascript`
|
||||
|
||||
1.0.1 / 2014-06-24
|
||||
==================
|
||||
|
||||
* Add `text/jsx` type
|
||||
|
||||
1.0.0 / 2014-05-12
|
||||
==================
|
||||
|
||||
* Return `false` for unknown types
|
||||
* Set charset=utf-8 for `application/json`
|
||||
|
||||
0.1.0 / 2014-05-02
|
||||
==================
|
||||
|
||||
* Initial release
|
||||
23
node_modules/body-parser/node_modules/mime-types/LICENSE
generated
vendored
Normal file
23
node_modules/body-parser/node_modules/mime-types/LICENSE
generated
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
(The MIT License)
|
||||
|
||||
Copyright (c) 2014 Jonathan Ong <me@jongleberry.com>
|
||||
Copyright (c) 2015 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.
|
||||
108
node_modules/body-parser/node_modules/mime-types/README.md
generated
vendored
Normal file
108
node_modules/body-parser/node_modules/mime-types/README.md
generated
vendored
Normal file
@ -0,0 +1,108 @@
|
||||
# mime-types
|
||||
|
||||
[![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]
|
||||
|
||||
The ultimate javascript content-type utility.
|
||||
|
||||
Similar to [the `mime@1.x` module](https://www.npmjs.com/package/mime), except:
|
||||
|
||||
- __No fallbacks.__ Instead of naively returning the first available type,
|
||||
`mime-types` simply returns `false`, so do
|
||||
`var type = mime.lookup('unrecognized') || 'application/octet-stream'`.
|
||||
- No `new Mime()` business, so you could do `var lookup = require('mime-types').lookup`.
|
||||
- No `.define()` functionality
|
||||
- Bug fixes for `.lookup(path)`
|
||||
|
||||
Otherwise, the API is compatible with `mime` 1.x.
|
||||
|
||||
## Install
|
||||
|
||||
This is a [Node.js](https://nodejs.org/en/) module available through the
|
||||
[npm registry](https://www.npmjs.com/). Installation is done using the
|
||||
[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):
|
||||
|
||||
```sh
|
||||
$ npm install mime-types
|
||||
```
|
||||
|
||||
## Adding Types
|
||||
|
||||
All mime types are based on [mime-db](https://www.npmjs.com/package/mime-db),
|
||||
so open a PR there if you'd like to add mime types.
|
||||
|
||||
## API
|
||||
|
||||
```js
|
||||
var mime = require('mime-types')
|
||||
```
|
||||
|
||||
All functions return `false` if input is invalid or not found.
|
||||
|
||||
### mime.lookup(path)
|
||||
|
||||
Lookup the content-type associated with a file.
|
||||
|
||||
```js
|
||||
mime.lookup('json') // 'application/json'
|
||||
mime.lookup('.md') // 'text/markdown'
|
||||
mime.lookup('file.html') // 'text/html'
|
||||
mime.lookup('folder/file.js') // 'application/javascript'
|
||||
mime.lookup('folder/.htaccess') // false
|
||||
|
||||
mime.lookup('cats') // false
|
||||
```
|
||||
|
||||
### mime.contentType(type)
|
||||
|
||||
Create a full content-type header given a content-type or extension.
|
||||
|
||||
```js
|
||||
mime.contentType('markdown') // 'text/x-markdown; charset=utf-8'
|
||||
mime.contentType('file.json') // 'application/json; charset=utf-8'
|
||||
|
||||
// from a full path
|
||||
mime.contentType(path.extname('/path/to/file.json')) // 'application/json; charset=utf-8'
|
||||
```
|
||||
|
||||
### mime.extension(type)
|
||||
|
||||
Get the default extension for a content-type.
|
||||
|
||||
```js
|
||||
mime.extension('application/octet-stream') // 'bin'
|
||||
```
|
||||
|
||||
### mime.charset(type)
|
||||
|
||||
Lookup the implied default charset of a content-type.
|
||||
|
||||
```js
|
||||
mime.charset('text/markdown') // 'UTF-8'
|
||||
```
|
||||
|
||||
### var type = mime.types[extension]
|
||||
|
||||
A map of content-types by extension.
|
||||
|
||||
### [extensions...] = mime.extensions[type]
|
||||
|
||||
A map of extensions by content-type.
|
||||
|
||||
## License
|
||||
|
||||
[MIT](LICENSE)
|
||||
|
||||
[npm-image]: https://img.shields.io/npm/v/mime-types.svg
|
||||
[npm-url]: https://npmjs.org/package/mime-types
|
||||
[node-version-image]: https://img.shields.io/node/v/mime-types.svg
|
||||
[node-version-url]: https://nodejs.org/en/download/
|
||||
[travis-image]: https://img.shields.io/travis/jshttp/mime-types/master.svg
|
||||
[travis-url]: https://travis-ci.org/jshttp/mime-types
|
||||
[coveralls-image]: https://img.shields.io/coveralls/jshttp/mime-types/master.svg
|
||||
[coveralls-url]: https://coveralls.io/r/jshttp/mime-types
|
||||
[downloads-image]: https://img.shields.io/npm/dm/mime-types.svg
|
||||
[downloads-url]: https://npmjs.org/package/mime-types
|
||||
188
node_modules/body-parser/node_modules/mime-types/index.js
generated
vendored
Normal file
188
node_modules/body-parser/node_modules/mime-types/index.js
generated
vendored
Normal file
@ -0,0 +1,188 @@
|
||||
/*!
|
||||
* mime-types
|
||||
* Copyright(c) 2014 Jonathan Ong
|
||||
* Copyright(c) 2015 Douglas Christopher Wilson
|
||||
* MIT Licensed
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
/**
|
||||
* Module dependencies.
|
||||
* @private
|
||||
*/
|
||||
|
||||
var db = require('mime-db')
|
||||
var extname = require('path').extname
|
||||
|
||||
/**
|
||||
* Module variables.
|
||||
* @private
|
||||
*/
|
||||
|
||||
var EXTRACT_TYPE_REGEXP = /^\s*([^;\s]*)(?:;|\s|$)/
|
||||
var TEXT_TYPE_REGEXP = /^text\//i
|
||||
|
||||
/**
|
||||
* Module exports.
|
||||
* @public
|
||||
*/
|
||||
|
||||
exports.charset = charset
|
||||
exports.charsets = { lookup: charset }
|
||||
exports.contentType = contentType
|
||||
exports.extension = extension
|
||||
exports.extensions = Object.create(null)
|
||||
exports.lookup = lookup
|
||||
exports.types = Object.create(null)
|
||||
|
||||
// Populate the extensions/types maps
|
||||
populateMaps(exports.extensions, exports.types)
|
||||
|
||||
/**
|
||||
* Get the default charset for a MIME type.
|
||||
*
|
||||
* @param {string} type
|
||||
* @return {boolean|string}
|
||||
*/
|
||||
|
||||
function charset (type) {
|
||||
if (!type || typeof type !== 'string') {
|
||||
return false
|
||||
}
|
||||
|
||||
// TODO: use media-typer
|
||||
var match = EXTRACT_TYPE_REGEXP.exec(type)
|
||||
var mime = match && db[match[1].toLowerCase()]
|
||||
|
||||
if (mime && mime.charset) {
|
||||
return mime.charset
|
||||
}
|
||||
|
||||
// default text/* to utf-8
|
||||
if (match && TEXT_TYPE_REGEXP.test(match[1])) {
|
||||
return 'UTF-8'
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a full Content-Type header given a MIME type or extension.
|
||||
*
|
||||
* @param {string} str
|
||||
* @return {boolean|string}
|
||||
*/
|
||||
|
||||
function contentType (str) {
|
||||
// TODO: should this even be in this module?
|
||||
if (!str || typeof str !== 'string') {
|
||||
return false
|
||||
}
|
||||
|
||||
var mime = str.indexOf('/') === -1
|
||||
? exports.lookup(str)
|
||||
: str
|
||||
|
||||
if (!mime) {
|
||||
return false
|
||||
}
|
||||
|
||||
// TODO: use content-type or other module
|
||||
if (mime.indexOf('charset') === -1) {
|
||||
var charset = exports.charset(mime)
|
||||
if (charset) mime += '; charset=' + charset.toLowerCase()
|
||||
}
|
||||
|
||||
return mime
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the default extension for a MIME type.
|
||||
*
|
||||
* @param {string} type
|
||||
* @return {boolean|string}
|
||||
*/
|
||||
|
||||
function extension (type) {
|
||||
if (!type || typeof type !== 'string') {
|
||||
return false
|
||||
}
|
||||
|
||||
// TODO: use media-typer
|
||||
var match = EXTRACT_TYPE_REGEXP.exec(type)
|
||||
|
||||
// get extensions
|
||||
var exts = match && exports.extensions[match[1].toLowerCase()]
|
||||
|
||||
if (!exts || !exts.length) {
|
||||
return false
|
||||
}
|
||||
|
||||
return exts[0]
|
||||
}
|
||||
|
||||
/**
|
||||
* Lookup the MIME type for a file path/extension.
|
||||
*
|
||||
* @param {string} path
|
||||
* @return {boolean|string}
|
||||
*/
|
||||
|
||||
function lookup (path) {
|
||||
if (!path || typeof path !== 'string') {
|
||||
return false
|
||||
}
|
||||
|
||||
// get the extension ("ext" or ".ext" or full path)
|
||||
var extension = extname('x.' + path)
|
||||
.toLowerCase()
|
||||
.substr(1)
|
||||
|
||||
if (!extension) {
|
||||
return false
|
||||
}
|
||||
|
||||
return exports.types[extension] || false
|
||||
}
|
||||
|
||||
/**
|
||||
* Populate the extensions and types maps.
|
||||
* @private
|
||||
*/
|
||||
|
||||
function populateMaps (extensions, types) {
|
||||
// source preference (least -> most)
|
||||
var preference = ['nginx', 'apache', undefined, 'iana']
|
||||
|
||||
Object.keys(db).forEach(function forEachMimeType (type) {
|
||||
var mime = db[type]
|
||||
var exts = mime.extensions
|
||||
|
||||
if (!exts || !exts.length) {
|
||||
return
|
||||
}
|
||||
|
||||
// mime -> extensions
|
||||
extensions[type] = exts
|
||||
|
||||
// extension -> mime
|
||||
for (var i = 0; i < exts.length; i++) {
|
||||
var extension = exts[i]
|
||||
|
||||
if (types[extension]) {
|
||||
var from = preference.indexOf(db[types[extension]].source)
|
||||
var to = preference.indexOf(mime.source)
|
||||
|
||||
if (types[extension] !== 'application/octet-stream' &&
|
||||
(from > to || (from === to && types[extension].substr(0, 12) === 'application/'))) {
|
||||
// skip the remapping
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
||||
// set the extension -> mime
|
||||
types[extension] = type
|
||||
}
|
||||
})
|
||||
}
|
||||
86
node_modules/body-parser/node_modules/mime-types/package.json
generated
vendored
Normal file
86
node_modules/body-parser/node_modules/mime-types/package.json
generated
vendored
Normal file
@ -0,0 +1,86 @@
|
||||
{
|
||||
"_from": "mime-types@~2.1.18",
|
||||
"_id": "mime-types@2.1.19",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-P1tKYHVSZ6uFo26mtnve4HQFE3koh1UWVkp8YUC+ESBHe945xWSoXuHHiGarDqcEZ+whpCDnlNw5LON0kLo+sw==",
|
||||
"_location": "/body-parser/mime-types",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "mime-types@~2.1.18",
|
||||
"name": "mime-types",
|
||||
"escapedName": "mime-types",
|
||||
"rawSpec": "~2.1.18",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "~2.1.18"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/body-parser/type-is"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.19.tgz",
|
||||
"_shasum": "71e464537a7ef81c15f2db9d97e913fc0ff606f0",
|
||||
"_spec": "mime-types@~2.1.18",
|
||||
"_where": "C:\\Users\\jonio\\Documents\\Programmieren\\Miniportal\\Neu\\MiniportalAPI\\node_modules\\body-parser\\node_modules\\type-is",
|
||||
"bugs": {
|
||||
"url": "https://github.com/jshttp/mime-types/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Douglas Christopher Wilson",
|
||||
"email": "doug@somethingdoug.com"
|
||||
},
|
||||
{
|
||||
"name": "Jeremiah Senkpiel",
|
||||
"email": "fishrock123@rocketmail.com",
|
||||
"url": "https://searchbeam.jit.su"
|
||||
},
|
||||
{
|
||||
"name": "Jonathan Ong",
|
||||
"email": "me@jongleberry.com",
|
||||
"url": "http://jongleberry.com"
|
||||
}
|
||||
],
|
||||
"dependencies": {
|
||||
"mime-db": "~1.35.0"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "The ultimate javascript content-type utility.",
|
||||
"devDependencies": {
|
||||
"eslint": "4.19.1",
|
||||
"eslint-config-standard": "11.0.0",
|
||||
"eslint-plugin-import": "2.13.0",
|
||||
"eslint-plugin-node": "6.0.1",
|
||||
"eslint-plugin-promise": "3.8.0",
|
||||
"eslint-plugin-standard": "3.1.0",
|
||||
"istanbul": "0.4.5",
|
||||
"mocha": "1.21.5"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
},
|
||||
"files": [
|
||||
"HISTORY.md",
|
||||
"LICENSE",
|
||||
"index.js"
|
||||
],
|
||||
"homepage": "https://github.com/jshttp/mime-types#readme",
|
||||
"keywords": [
|
||||
"mime",
|
||||
"types"
|
||||
],
|
||||
"license": "MIT",
|
||||
"name": "mime-types",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/jshttp/mime-types.git"
|
||||
},
|
||||
"scripts": {
|
||||
"lint": "eslint .",
|
||||
"test": "mocha --reporter spec test/test.js",
|
||||
"test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot test/test.js",
|
||||
"test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter dot test/test.js"
|
||||
},
|
||||
"version": "2.1.19"
|
||||
}
|
||||
30
node_modules/body-parser/node_modules/qs/.editorconfig
generated
vendored
Normal file
30
node_modules/body-parser/node_modules/qs/.editorconfig
generated
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
root = true
|
||||
|
||||
[*]
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
end_of_line = lf
|
||||
charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
max_line_length = 140
|
||||
|
||||
[test/*]
|
||||
max_line_length = off
|
||||
|
||||
[*.md]
|
||||
max_line_length = off
|
||||
|
||||
[*.json]
|
||||
max_line_length = off
|
||||
|
||||
[Makefile]
|
||||
max_line_length = off
|
||||
|
||||
[CHANGELOG.md]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
[LICENSE]
|
||||
indent_size = 2
|
||||
max_line_length = off
|
||||
1
node_modules/body-parser/node_modules/qs/.eslintignore
generated
vendored
Normal file
1
node_modules/body-parser/node_modules/qs/.eslintignore
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
dist
|
||||
19
node_modules/body-parser/node_modules/qs/.eslintrc
generated
vendored
Normal file
19
node_modules/body-parser/node_modules/qs/.eslintrc
generated
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
{
|
||||
"root": true,
|
||||
|
||||
"extends": "@ljharb",
|
||||
|
||||
"rules": {
|
||||
"complexity": 0,
|
||||
"consistent-return": 1,
|
||||
"func-name-matching": 0,
|
||||
"id-length": [2, { "min": 1, "max": 25, "properties": "never" }],
|
||||
"indent": [2, 4],
|
||||
"max-params": [2, 12],
|
||||
"max-statements": [2, 45],
|
||||
"no-continue": 1,
|
||||
"no-magic-numbers": 0,
|
||||
"no-restricted-syntax": [2, "BreakStatement", "DebuggerStatement", "ForInStatement", "LabeledStatement", "WithStatement"],
|
||||
"operator-linebreak": [2, "before"],
|
||||
}
|
||||
}
|
||||
226
node_modules/body-parser/node_modules/qs/CHANGELOG.md
generated
vendored
Normal file
226
node_modules/body-parser/node_modules/qs/CHANGELOG.md
generated
vendored
Normal file
@ -0,0 +1,226 @@
|
||||
## **6.5.2**
|
||||
- [Fix] use `safer-buffer` instead of `Buffer` constructor
|
||||
- [Refactor] utils: `module.exports` one thing, instead of mutating `exports` (#230)
|
||||
- [Dev Deps] update `browserify`, `eslint`, `iconv-lite`, `safer-buffer`, `tape`, `browserify`
|
||||
|
||||
## **6.5.1**
|
||||
- [Fix] Fix parsing & compacting very deep objects (#224)
|
||||
- [Refactor] name utils functions
|
||||
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `tape`
|
||||
- [Tests] up to `node` `v8.4`; use `nvm install-latest-npm` so newer npm doesn’t break older node
|
||||
- [Tests] Use precise dist for Node.js 0.6 runtime (#225)
|
||||
- [Tests] make 0.6 required, now that it’s passing
|
||||
- [Tests] on `node` `v8.2`; fix npm on node 0.6
|
||||
|
||||
## **6.5.0**
|
||||
- [New] add `utils.assign`
|
||||
- [New] pass default encoder/decoder to custom encoder/decoder functions (#206)
|
||||
- [New] `parse`/`stringify`: add `ignoreQueryPrefix`/`addQueryPrefix` options, respectively (#213)
|
||||
- [Fix] Handle stringifying empty objects with addQueryPrefix (#217)
|
||||
- [Fix] do not mutate `options` argument (#207)
|
||||
- [Refactor] `parse`: cache index to reuse in else statement (#182)
|
||||
- [Docs] add various badges to readme (#208)
|
||||
- [Dev Deps] update `eslint`, `browserify`, `iconv-lite`, `tape`
|
||||
- [Tests] up to `node` `v8.1`, `v7.10`, `v6.11`; npm v4.6 breaks on node < v1; npm v5+ breaks on node < v4
|
||||
- [Tests] add `editorconfig-tools`
|
||||
|
||||
## **6.4.0**
|
||||
- [New] `qs.stringify`: add `encodeValuesOnly` option
|
||||
- [Fix] follow `allowPrototypes` option during merge (#201, #201)
|
||||
- [Fix] support keys starting with brackets (#202, #200)
|
||||
- [Fix] chmod a-x
|
||||
- [Dev Deps] update `eslint`
|
||||
- [Tests] up to `node` `v7.7`, `v6.10`,` v4.8`; disable osx builds since they block linux builds
|
||||
- [eslint] reduce warnings
|
||||
|
||||
## **6.3.2**
|
||||
- [Fix] follow `allowPrototypes` option during merge (#201, #200)
|
||||
- [Dev Deps] update `eslint`
|
||||
- [Fix] chmod a-x
|
||||
- [Fix] support keys starting with brackets (#202, #200)
|
||||
- [Tests] up to `node` `v7.7`, `v6.10`,` v4.8`; disable osx builds since they block linux builds
|
||||
|
||||
## **6.3.1**
|
||||
- [Fix] ensure that `allowPrototypes: false` does not ever shadow Object.prototype properties (thanks, @snyk!)
|
||||
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `browserify`, `iconv-lite`, `qs-iconv`, `tape`
|
||||
- [Tests] on all node minors; improve test matrix
|
||||
- [Docs] document stringify option `allowDots` (#195)
|
||||
- [Docs] add empty object and array values example (#195)
|
||||
- [Docs] Fix minor inconsistency/typo (#192)
|
||||
- [Docs] document stringify option `sort` (#191)
|
||||
- [Refactor] `stringify`: throw faster with an invalid encoder
|
||||
- [Refactor] remove unnecessary escapes (#184)
|
||||
- Remove contributing.md, since `qs` is no longer part of `hapi` (#183)
|
||||
|
||||
## **6.3.0**
|
||||
- [New] Add support for RFC 1738 (#174, #173)
|
||||
- [New] `stringify`: Add `serializeDate` option to customize Date serialization (#159)
|
||||
- [Fix] ensure `utils.merge` handles merging two arrays
|
||||
- [Refactor] only constructors should be capitalized
|
||||
- [Refactor] capitalized var names are for constructors only
|
||||
- [Refactor] avoid using a sparse array
|
||||
- [Robustness] `formats`: cache `String#replace`
|
||||
- [Dev Deps] update `browserify`, `eslint`, `@ljharb/eslint-config`; add `safe-publish-latest`
|
||||
- [Tests] up to `node` `v6.8`, `v4.6`; improve test matrix
|
||||
- [Tests] flesh out arrayLimit/arrayFormat tests (#107)
|
||||
- [Tests] skip Object.create tests when null objects are not available
|
||||
- [Tests] Turn on eslint for test files (#175)
|
||||
|
||||
## **6.2.3**
|
||||
- [Fix] follow `allowPrototypes` option during merge (#201, #200)
|
||||
- [Fix] chmod a-x
|
||||
- [Fix] support keys starting with brackets (#202, #200)
|
||||
- [Tests] up to `node` `v7.7`, `v6.10`,` v4.8`; disable osx builds since they block linux builds
|
||||
|
||||
## **6.2.2**
|
||||
- [Fix] ensure that `allowPrototypes: false` does not ever shadow Object.prototype properties
|
||||
|
||||
## **6.2.1**
|
||||
- [Fix] ensure `key[]=x&key[]&key[]=y` results in 3, not 2, values
|
||||
- [Refactor] Be explicit and use `Object.prototype.hasOwnProperty.call`
|
||||
- [Tests] remove `parallelshell` since it does not reliably report failures
|
||||
- [Tests] up to `node` `v6.3`, `v5.12`
|
||||
- [Dev Deps] update `tape`, `eslint`, `@ljharb/eslint-config`, `qs-iconv`
|
||||
|
||||
## [**6.2.0**](https://github.com/ljharb/qs/issues?milestone=36&state=closed)
|
||||
- [New] pass Buffers to the encoder/decoder directly (#161)
|
||||
- [New] add "encoder" and "decoder" options, for custom param encoding/decoding (#160)
|
||||
- [Fix] fix compacting of nested sparse arrays (#150)
|
||||
|
||||
## **6.1.2
|
||||
- [Fix] follow `allowPrototypes` option during merge (#201, #200)
|
||||
- [Fix] chmod a-x
|
||||
- [Fix] support keys starting with brackets (#202, #200)
|
||||
- [Tests] up to `node` `v7.7`, `v6.10`,` v4.8`; disable osx builds since they block linux builds
|
||||
|
||||
## **6.1.1**
|
||||
- [Fix] ensure that `allowPrototypes: false` does not ever shadow Object.prototype properties
|
||||
|
||||
## [**6.1.0**](https://github.com/ljharb/qs/issues?milestone=35&state=closed)
|
||||
- [New] allowDots option for `stringify` (#151)
|
||||
- [Fix] "sort" option should work at a depth of 3 or more (#151)
|
||||
- [Fix] Restore `dist` directory; will be removed in v7 (#148)
|
||||
|
||||
## **6.0.4**
|
||||
- [Fix] follow `allowPrototypes` option during merge (#201, #200)
|
||||
- [Fix] chmod a-x
|
||||
- [Fix] support keys starting with brackets (#202, #200)
|
||||
- [Tests] up to `node` `v7.7`, `v6.10`,` v4.8`; disable osx builds since they block linux builds
|
||||
|
||||
## **6.0.3**
|
||||
- [Fix] ensure that `allowPrototypes: false` does not ever shadow Object.prototype properties
|
||||
- [Fix] Restore `dist` directory; will be removed in v7 (#148)
|
||||
|
||||
## [**6.0.2**](https://github.com/ljharb/qs/issues?milestone=33&state=closed)
|
||||
- Revert ES6 requirement and restore support for node down to v0.8.
|
||||
|
||||
## [**6.0.1**](https://github.com/ljharb/qs/issues?milestone=32&state=closed)
|
||||
- [**#127**](https://github.com/ljharb/qs/pull/127) Fix engines definition in package.json
|
||||
|
||||
## [**6.0.0**](https://github.com/ljharb/qs/issues?milestone=31&state=closed)
|
||||
- [**#124**](https://github.com/ljharb/qs/issues/124) Use ES6 and drop support for node < v4
|
||||
|
||||
## **5.2.1**
|
||||
- [Fix] ensure `key[]=x&key[]&key[]=y` results in 3, not 2, values
|
||||
|
||||
## [**5.2.0**](https://github.com/ljharb/qs/issues?milestone=30&state=closed)
|
||||
- [**#64**](https://github.com/ljharb/qs/issues/64) Add option to sort object keys in the query string
|
||||
|
||||
## [**5.1.0**](https://github.com/ljharb/qs/issues?milestone=29&state=closed)
|
||||
- [**#117**](https://github.com/ljharb/qs/issues/117) make URI encoding stringified results optional
|
||||
- [**#106**](https://github.com/ljharb/qs/issues/106) Add flag `skipNulls` to optionally skip null values in stringify
|
||||
|
||||
## [**5.0.0**](https://github.com/ljharb/qs/issues?milestone=28&state=closed)
|
||||
- [**#114**](https://github.com/ljharb/qs/issues/114) default allowDots to false
|
||||
- [**#100**](https://github.com/ljharb/qs/issues/100) include dist to npm
|
||||
|
||||
## [**4.0.0**](https://github.com/ljharb/qs/issues?milestone=26&state=closed)
|
||||
- [**#98**](https://github.com/ljharb/qs/issues/98) make returning plain objects and allowing prototype overwriting properties optional
|
||||
|
||||
## [**3.1.0**](https://github.com/ljharb/qs/issues?milestone=24&state=closed)
|
||||
- [**#89**](https://github.com/ljharb/qs/issues/89) Add option to disable "Transform dot notation to bracket notation"
|
||||
|
||||
## [**3.0.0**](https://github.com/ljharb/qs/issues?milestone=23&state=closed)
|
||||
- [**#80**](https://github.com/ljharb/qs/issues/80) qs.parse silently drops properties
|
||||
- [**#77**](https://github.com/ljharb/qs/issues/77) Perf boost
|
||||
- [**#60**](https://github.com/ljharb/qs/issues/60) Add explicit option to disable array parsing
|
||||
- [**#74**](https://github.com/ljharb/qs/issues/74) Bad parse when turning array into object
|
||||
- [**#81**](https://github.com/ljharb/qs/issues/81) Add a `filter` option
|
||||
- [**#68**](https://github.com/ljharb/qs/issues/68) Fixed issue with recursion and passing strings into objects.
|
||||
- [**#66**](https://github.com/ljharb/qs/issues/66) Add mixed array and object dot notation support Closes: #47
|
||||
- [**#76**](https://github.com/ljharb/qs/issues/76) RFC 3986
|
||||
- [**#85**](https://github.com/ljharb/qs/issues/85) No equal sign
|
||||
- [**#84**](https://github.com/ljharb/qs/issues/84) update license attribute
|
||||
|
||||
## [**2.4.1**](https://github.com/ljharb/qs/issues?milestone=20&state=closed)
|
||||
- [**#73**](https://github.com/ljharb/qs/issues/73) Property 'hasOwnProperty' of object #<Object> is not a function
|
||||
|
||||
## [**2.4.0**](https://github.com/ljharb/qs/issues?milestone=19&state=closed)
|
||||
- [**#70**](https://github.com/ljharb/qs/issues/70) Add arrayFormat option
|
||||
|
||||
## [**2.3.3**](https://github.com/ljharb/qs/issues?milestone=18&state=closed)
|
||||
- [**#59**](https://github.com/ljharb/qs/issues/59) make sure array indexes are >= 0, closes #57
|
||||
- [**#58**](https://github.com/ljharb/qs/issues/58) make qs usable for browser loader
|
||||
|
||||
## [**2.3.2**](https://github.com/ljharb/qs/issues?milestone=17&state=closed)
|
||||
- [**#55**](https://github.com/ljharb/qs/issues/55) allow merging a string into an object
|
||||
|
||||
## [**2.3.1**](https://github.com/ljharb/qs/issues?milestone=16&state=closed)
|
||||
- [**#52**](https://github.com/ljharb/qs/issues/52) Return "undefined" and "false" instead of throwing "TypeError".
|
||||
|
||||
## [**2.3.0**](https://github.com/ljharb/qs/issues?milestone=15&state=closed)
|
||||
- [**#50**](https://github.com/ljharb/qs/issues/50) add option to omit array indices, closes #46
|
||||
|
||||
## [**2.2.5**](https://github.com/ljharb/qs/issues?milestone=14&state=closed)
|
||||
- [**#39**](https://github.com/ljharb/qs/issues/39) Is there an alternative to Buffer.isBuffer?
|
||||
- [**#49**](https://github.com/ljharb/qs/issues/49) refactor utils.merge, fixes #45
|
||||
- [**#41**](https://github.com/ljharb/qs/issues/41) avoid browserifying Buffer, for #39
|
||||
|
||||
## [**2.2.4**](https://github.com/ljharb/qs/issues?milestone=13&state=closed)
|
||||
- [**#38**](https://github.com/ljharb/qs/issues/38) how to handle object keys beginning with a number
|
||||
|
||||
## [**2.2.3**](https://github.com/ljharb/qs/issues?milestone=12&state=closed)
|
||||
- [**#37**](https://github.com/ljharb/qs/issues/37) parser discards first empty value in array
|
||||
- [**#36**](https://github.com/ljharb/qs/issues/36) Update to lab 4.x
|
||||
|
||||
## [**2.2.2**](https://github.com/ljharb/qs/issues?milestone=11&state=closed)
|
||||
- [**#33**](https://github.com/ljharb/qs/issues/33) Error when plain object in a value
|
||||
- [**#34**](https://github.com/ljharb/qs/issues/34) use Object.prototype.hasOwnProperty.call instead of obj.hasOwnProperty
|
||||
- [**#24**](https://github.com/ljharb/qs/issues/24) Changelog? Semver?
|
||||
|
||||
## [**2.2.1**](https://github.com/ljharb/qs/issues?milestone=10&state=closed)
|
||||
- [**#32**](https://github.com/ljharb/qs/issues/32) account for circular references properly, closes #31
|
||||
- [**#31**](https://github.com/ljharb/qs/issues/31) qs.parse stackoverflow on circular objects
|
||||
|
||||
## [**2.2.0**](https://github.com/ljharb/qs/issues?milestone=9&state=closed)
|
||||
- [**#26**](https://github.com/ljharb/qs/issues/26) Don't use Buffer global if it's not present
|
||||
- [**#30**](https://github.com/ljharb/qs/issues/30) Bug when merging non-object values into arrays
|
||||
- [**#29**](https://github.com/ljharb/qs/issues/29) Don't call Utils.clone at the top of Utils.merge
|
||||
- [**#23**](https://github.com/ljharb/qs/issues/23) Ability to not limit parameters?
|
||||
|
||||
## [**2.1.0**](https://github.com/ljharb/qs/issues?milestone=8&state=closed)
|
||||
- [**#22**](https://github.com/ljharb/qs/issues/22) Enable using a RegExp as delimiter
|
||||
|
||||
## [**2.0.0**](https://github.com/ljharb/qs/issues?milestone=7&state=closed)
|
||||
- [**#18**](https://github.com/ljharb/qs/issues/18) Why is there arrayLimit?
|
||||
- [**#20**](https://github.com/ljharb/qs/issues/20) Configurable parametersLimit
|
||||
- [**#21**](https://github.com/ljharb/qs/issues/21) make all limits optional, for #18, for #20
|
||||
|
||||
## [**1.2.2**](https://github.com/ljharb/qs/issues?milestone=6&state=closed)
|
||||
- [**#19**](https://github.com/ljharb/qs/issues/19) Don't overwrite null values
|
||||
|
||||
## [**1.2.1**](https://github.com/ljharb/qs/issues?milestone=5&state=closed)
|
||||
- [**#16**](https://github.com/ljharb/qs/issues/16) ignore non-string delimiters
|
||||
- [**#15**](https://github.com/ljharb/qs/issues/15) Close code block
|
||||
|
||||
## [**1.2.0**](https://github.com/ljharb/qs/issues?milestone=4&state=closed)
|
||||
- [**#12**](https://github.com/ljharb/qs/issues/12) Add optional delim argument
|
||||
- [**#13**](https://github.com/ljharb/qs/issues/13) fix #11: flattened keys in array are now correctly parsed
|
||||
|
||||
## [**1.1.0**](https://github.com/ljharb/qs/issues?milestone=3&state=closed)
|
||||
- [**#7**](https://github.com/ljharb/qs/issues/7) Empty values of a POST array disappear after being submitted
|
||||
- [**#9**](https://github.com/ljharb/qs/issues/9) Should not omit equals signs (=) when value is null
|
||||
- [**#6**](https://github.com/ljharb/qs/issues/6) Minor grammar fix in README
|
||||
|
||||
## [**1.0.2**](https://github.com/ljharb/qs/issues?milestone=2&state=closed)
|
||||
- [**#5**](https://github.com/ljharb/qs/issues/5) array holes incorrectly copied into object on large index
|
||||
28
node_modules/body-parser/node_modules/qs/LICENSE
generated
vendored
Normal file
28
node_modules/body-parser/node_modules/qs/LICENSE
generated
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
Copyright (c) 2014 Nathan LaFreniere and other contributors.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* The names of any contributors may not be used to endorse or promote
|
||||
products derived from this software without specific prior written
|
||||
permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS AND CONTRIBUTORS BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
* * *
|
||||
|
||||
The complete list of contributors can be found at: https://github.com/hapijs/qs/graphs/contributors
|
||||
475
node_modules/body-parser/node_modules/qs/README.md
generated
vendored
Normal file
475
node_modules/body-parser/node_modules/qs/README.md
generated
vendored
Normal file
@ -0,0 +1,475 @@
|
||||
# qs <sup>[![Version Badge][2]][1]</sup>
|
||||
|
||||
[![Build Status][3]][4]
|
||||
[![dependency status][5]][6]
|
||||
[![dev dependency status][7]][8]
|
||||
[![License][license-image]][license-url]
|
||||
[![Downloads][downloads-image]][downloads-url]
|
||||
|
||||
[![npm badge][11]][1]
|
||||
|
||||
A querystring parsing and stringifying library with some added security.
|
||||
|
||||
Lead Maintainer: [Jordan Harband](https://github.com/ljharb)
|
||||
|
||||
The **qs** module was originally created and maintained by [TJ Holowaychuk](https://github.com/visionmedia/node-querystring).
|
||||
|
||||
## Usage
|
||||
|
||||
```javascript
|
||||
var qs = require('qs');
|
||||
var assert = require('assert');
|
||||
|
||||
var obj = qs.parse('a=c');
|
||||
assert.deepEqual(obj, { a: 'c' });
|
||||
|
||||
var str = qs.stringify(obj);
|
||||
assert.equal(str, 'a=c');
|
||||
```
|
||||
|
||||
### Parsing Objects
|
||||
|
||||
[](#preventEval)
|
||||
```javascript
|
||||
qs.parse(string, [options]);
|
||||
```
|
||||
|
||||
**qs** allows you to create nested objects within your query strings, by surrounding the name of sub-keys with square brackets `[]`.
|
||||
For example, the string `'foo[bar]=baz'` converts to:
|
||||
|
||||
```javascript
|
||||
assert.deepEqual(qs.parse('foo[bar]=baz'), {
|
||||
foo: {
|
||||
bar: 'baz'
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
When using the `plainObjects` option the parsed value is returned as a null object, created via `Object.create(null)` and as such you should be aware that prototype methods will not exist on it and a user may set those names to whatever value they like:
|
||||
|
||||
```javascript
|
||||
var nullObject = qs.parse('a[hasOwnProperty]=b', { plainObjects: true });
|
||||
assert.deepEqual(nullObject, { a: { hasOwnProperty: 'b' } });
|
||||
```
|
||||
|
||||
By default parameters that would overwrite properties on the object prototype are ignored, if you wish to keep the data from those fields either use `plainObjects` as mentioned above, or set `allowPrototypes` to `true` which will allow user input to overwrite those properties. *WARNING* It is generally a bad idea to enable this option as it can cause problems when attempting to use the properties that have been overwritten. Always be careful with this option.
|
||||
|
||||
```javascript
|
||||
var protoObject = qs.parse('a[hasOwnProperty]=b', { allowPrototypes: true });
|
||||
assert.deepEqual(protoObject, { a: { hasOwnProperty: 'b' } });
|
||||
```
|
||||
|
||||
URI encoded strings work too:
|
||||
|
||||
```javascript
|
||||
assert.deepEqual(qs.parse('a%5Bb%5D=c'), {
|
||||
a: { b: 'c' }
|
||||
});
|
||||
```
|
||||
|
||||
You can also nest your objects, like `'foo[bar][baz]=foobarbaz'`:
|
||||
|
||||
```javascript
|
||||
assert.deepEqual(qs.parse('foo[bar][baz]=foobarbaz'), {
|
||||
foo: {
|
||||
bar: {
|
||||
baz: 'foobarbaz'
|
||||
}
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
By default, when nesting objects **qs** will only parse up to 5 children deep. This means if you attempt to parse a string like
|
||||
`'a[b][c][d][e][f][g][h][i]=j'` your resulting object will be:
|
||||
|
||||
```javascript
|
||||
var expected = {
|
||||
a: {
|
||||
b: {
|
||||
c: {
|
||||
d: {
|
||||
e: {
|
||||
f: {
|
||||
'[g][h][i]': 'j'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
var string = 'a[b][c][d][e][f][g][h][i]=j';
|
||||
assert.deepEqual(qs.parse(string), expected);
|
||||
```
|
||||
|
||||
This depth can be overridden by passing a `depth` option to `qs.parse(string, [options])`:
|
||||
|
||||
```javascript
|
||||
var deep = qs.parse('a[b][c][d][e][f][g][h][i]=j', { depth: 1 });
|
||||
assert.deepEqual(deep, { a: { b: { '[c][d][e][f][g][h][i]': 'j' } } });
|
||||
```
|
||||
|
||||
The depth limit helps mitigate abuse when **qs** is used to parse user input, and it is recommended to keep it a reasonably small number.
|
||||
|
||||
For similar reasons, by default **qs** will only parse up to 1000 parameters. This can be overridden by passing a `parameterLimit` option:
|
||||
|
||||
```javascript
|
||||
var limited = qs.parse('a=b&c=d', { parameterLimit: 1 });
|
||||
assert.deepEqual(limited, { a: 'b' });
|
||||
```
|
||||
|
||||
To bypass the leading question mark, use `ignoreQueryPrefix`:
|
||||
|
||||
```javascript
|
||||
var prefixed = qs.parse('?a=b&c=d', { ignoreQueryPrefix: true });
|
||||
assert.deepEqual(prefixed, { a: 'b', c: 'd' });
|
||||
```
|
||||
|
||||
An optional delimiter can also be passed:
|
||||
|
||||
```javascript
|
||||
var delimited = qs.parse('a=b;c=d', { delimiter: ';' });
|
||||
assert.deepEqual(delimited, { a: 'b', c: 'd' });
|
||||
```
|
||||
|
||||
Delimiters can be a regular expression too:
|
||||
|
||||
```javascript
|
||||
var regexed = qs.parse('a=b;c=d,e=f', { delimiter: /[;,]/ });
|
||||
assert.deepEqual(regexed, { a: 'b', c: 'd', e: 'f' });
|
||||
```
|
||||
|
||||
Option `allowDots` can be used to enable dot notation:
|
||||
|
||||
```javascript
|
||||
var withDots = qs.parse('a.b=c', { allowDots: true });
|
||||
assert.deepEqual(withDots, { a: { b: 'c' } });
|
||||
```
|
||||
|
||||
### Parsing Arrays
|
||||
|
||||
**qs** can also parse arrays using a similar `[]` notation:
|
||||
|
||||
```javascript
|
||||
var withArray = qs.parse('a[]=b&a[]=c');
|
||||
assert.deepEqual(withArray, { a: ['b', 'c'] });
|
||||
```
|
||||
|
||||
You may specify an index as well:
|
||||
|
||||
```javascript
|
||||
var withIndexes = qs.parse('a[1]=c&a[0]=b');
|
||||
assert.deepEqual(withIndexes, { a: ['b', 'c'] });
|
||||
```
|
||||
|
||||
Note that the only difference between an index in an array and a key in an object is that the value between the brackets must be a number
|
||||
to create an array. When creating arrays with specific indices, **qs** will compact a sparse array to only the existing values preserving
|
||||
their order:
|
||||
|
||||
```javascript
|
||||
var noSparse = qs.parse('a[1]=b&a[15]=c');
|
||||
assert.deepEqual(noSparse, { a: ['b', 'c'] });
|
||||
```
|
||||
|
||||
Note that an empty string is also a value, and will be preserved:
|
||||
|
||||
```javascript
|
||||
var withEmptyString = qs.parse('a[]=&a[]=b');
|
||||
assert.deepEqual(withEmptyString, { a: ['', 'b'] });
|
||||
|
||||
var withIndexedEmptyString = qs.parse('a[0]=b&a[1]=&a[2]=c');
|
||||
assert.deepEqual(withIndexedEmptyString, { a: ['b', '', 'c'] });
|
||||
```
|
||||
|
||||
**qs** will also limit specifying indices in an array to a maximum index of `20`. Any array members with an index of greater than `20` will
|
||||
instead be converted to an object with the index as the key:
|
||||
|
||||
```javascript
|
||||
var withMaxIndex = qs.parse('a[100]=b');
|
||||
assert.deepEqual(withMaxIndex, { a: { '100': 'b' } });
|
||||
```
|
||||
|
||||
This limit can be overridden by passing an `arrayLimit` option:
|
||||
|
||||
```javascript
|
||||
var withArrayLimit = qs.parse('a[1]=b', { arrayLimit: 0 });
|
||||
assert.deepEqual(withArrayLimit, { a: { '1': 'b' } });
|
||||
```
|
||||
|
||||
To disable array parsing entirely, set `parseArrays` to `false`.
|
||||
|
||||
```javascript
|
||||
var noParsingArrays = qs.parse('a[]=b', { parseArrays: false });
|
||||
assert.deepEqual(noParsingArrays, { a: { '0': 'b' } });
|
||||
```
|
||||
|
||||
If you mix notations, **qs** will merge the two items into an object:
|
||||
|
||||
```javascript
|
||||
var mixedNotation = qs.parse('a[0]=b&a[b]=c');
|
||||
assert.deepEqual(mixedNotation, { a: { '0': 'b', b: 'c' } });
|
||||
```
|
||||
|
||||
You can also create arrays of objects:
|
||||
|
||||
```javascript
|
||||
var arraysOfObjects = qs.parse('a[][b]=c');
|
||||
assert.deepEqual(arraysOfObjects, { a: [{ b: 'c' }] });
|
||||
```
|
||||
|
||||
### Stringifying
|
||||
|
||||
[](#preventEval)
|
||||
```javascript
|
||||
qs.stringify(object, [options]);
|
||||
```
|
||||
|
||||
When stringifying, **qs** by default URI encodes output. Objects are stringified as you would expect:
|
||||
|
||||
```javascript
|
||||
assert.equal(qs.stringify({ a: 'b' }), 'a=b');
|
||||
assert.equal(qs.stringify({ a: { b: 'c' } }), 'a%5Bb%5D=c');
|
||||
```
|
||||
|
||||
This encoding can be disabled by setting the `encode` option to `false`:
|
||||
|
||||
```javascript
|
||||
var unencoded = qs.stringify({ a: { b: 'c' } }, { encode: false });
|
||||
assert.equal(unencoded, 'a[b]=c');
|
||||
```
|
||||
|
||||
Encoding can be disabled for keys by setting the `encodeValuesOnly` option to `true`:
|
||||
```javascript
|
||||
var encodedValues = qs.stringify(
|
||||
{ a: 'b', c: ['d', 'e=f'], f: [['g'], ['h']] },
|
||||
{ encodeValuesOnly: true }
|
||||
);
|
||||
assert.equal(encodedValues,'a=b&c[0]=d&c[1]=e%3Df&f[0][0]=g&f[1][0]=h');
|
||||
```
|
||||
|
||||
This encoding can also be replaced by a custom encoding method set as `encoder` option:
|
||||
|
||||
```javascript
|
||||
var encoded = qs.stringify({ a: { b: 'c' } }, { encoder: function (str) {
|
||||
// Passed in values `a`, `b`, `c`
|
||||
return // Return encoded string
|
||||
}})
|
||||
```
|
||||
|
||||
_(Note: the `encoder` option does not apply if `encode` is `false`)_
|
||||
|
||||
Analogue to the `encoder` there is a `decoder` option for `parse` to override decoding of properties and values:
|
||||
|
||||
```javascript
|
||||
var decoded = qs.parse('x=z', { decoder: function (str) {
|
||||
// Passed in values `x`, `z`
|
||||
return // Return decoded string
|
||||
}})
|
||||
```
|
||||
|
||||
Examples beyond this point will be shown as though the output is not URI encoded for clarity. Please note that the return values in these cases *will* be URI encoded during real usage.
|
||||
|
||||
When arrays are stringified, by default they are given explicit indices:
|
||||
|
||||
```javascript
|
||||
qs.stringify({ a: ['b', 'c', 'd'] });
|
||||
// 'a[0]=b&a[1]=c&a[2]=d'
|
||||
```
|
||||
|
||||
You may override this by setting the `indices` option to `false`:
|
||||
|
||||
```javascript
|
||||
qs.stringify({ a: ['b', 'c', 'd'] }, { indices: false });
|
||||
// 'a=b&a=c&a=d'
|
||||
```
|
||||
|
||||
You may use the `arrayFormat` option to specify the format of the output array:
|
||||
|
||||
```javascript
|
||||
qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'indices' })
|
||||
// 'a[0]=b&a[1]=c'
|
||||
qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'brackets' })
|
||||
// 'a[]=b&a[]=c'
|
||||
qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'repeat' })
|
||||
// 'a=b&a=c'
|
||||
```
|
||||
|
||||
When objects are stringified, by default they use bracket notation:
|
||||
|
||||
```javascript
|
||||
qs.stringify({ a: { b: { c: 'd', e: 'f' } } });
|
||||
// 'a[b][c]=d&a[b][e]=f'
|
||||
```
|
||||
|
||||
You may override this to use dot notation by setting the `allowDots` option to `true`:
|
||||
|
||||
```javascript
|
||||
qs.stringify({ a: { b: { c: 'd', e: 'f' } } }, { allowDots: true });
|
||||
// 'a.b.c=d&a.b.e=f'
|
||||
```
|
||||
|
||||
Empty strings and null values will omit the value, but the equals sign (=) remains in place:
|
||||
|
||||
```javascript
|
||||
assert.equal(qs.stringify({ a: '' }), 'a=');
|
||||
```
|
||||
|
||||
Key with no values (such as an empty object or array) will return nothing:
|
||||
|
||||
```javascript
|
||||
assert.equal(qs.stringify({ a: [] }), '');
|
||||
assert.equal(qs.stringify({ a: {} }), '');
|
||||
assert.equal(qs.stringify({ a: [{}] }), '');
|
||||
assert.equal(qs.stringify({ a: { b: []} }), '');
|
||||
assert.equal(qs.stringify({ a: { b: {}} }), '');
|
||||
```
|
||||
|
||||
Properties that are set to `undefined` will be omitted entirely:
|
||||
|
||||
```javascript
|
||||
assert.equal(qs.stringify({ a: null, b: undefined }), 'a=');
|
||||
```
|
||||
|
||||
The query string may optionally be prepended with a question mark:
|
||||
|
||||
```javascript
|
||||
assert.equal(qs.stringify({ a: 'b', c: 'd' }, { addQueryPrefix: true }), '?a=b&c=d');
|
||||
```
|
||||
|
||||
The delimiter may be overridden with stringify as well:
|
||||
|
||||
```javascript
|
||||
assert.equal(qs.stringify({ a: 'b', c: 'd' }, { delimiter: ';' }), 'a=b;c=d');
|
||||
```
|
||||
|
||||
If you only want to override the serialization of `Date` objects, you can provide a `serializeDate` option:
|
||||
|
||||
```javascript
|
||||
var date = new Date(7);
|
||||
assert.equal(qs.stringify({ a: date }), 'a=1970-01-01T00:00:00.007Z'.replace(/:/g, '%3A'));
|
||||
assert.equal(
|
||||
qs.stringify({ a: date }, { serializeDate: function (d) { return d.getTime(); } }),
|
||||
'a=7'
|
||||
);
|
||||
```
|
||||
|
||||
You may use the `sort` option to affect the order of parameter keys:
|
||||
|
||||
```javascript
|
||||
function alphabeticalSort(a, b) {
|
||||
return a.localeCompare(b);
|
||||
}
|
||||
assert.equal(qs.stringify({ a: 'c', z: 'y', b : 'f' }, { sort: alphabeticalSort }), 'a=c&b=f&z=y');
|
||||
```
|
||||
|
||||
Finally, you can use the `filter` option to restrict which keys will be included in the stringified output.
|
||||
If you pass a function, it will be called for each key to obtain the replacement value. Otherwise, if you
|
||||
pass an array, it will be used to select properties and array indices for stringification:
|
||||
|
||||
```javascript
|
||||
function filterFunc(prefix, value) {
|
||||
if (prefix == 'b') {
|
||||
// Return an `undefined` value to omit a property.
|
||||
return;
|
||||
}
|
||||
if (prefix == 'e[f]') {
|
||||
return value.getTime();
|
||||
}
|
||||
if (prefix == 'e[g][0]') {
|
||||
return value * 2;
|
||||
}
|
||||
return value;
|
||||
}
|
||||
qs.stringify({ a: 'b', c: 'd', e: { f: new Date(123), g: [2] } }, { filter: filterFunc });
|
||||
// 'a=b&c=d&e[f]=123&e[g][0]=4'
|
||||
qs.stringify({ a: 'b', c: 'd', e: 'f' }, { filter: ['a', 'e'] });
|
||||
// 'a=b&e=f'
|
||||
qs.stringify({ a: ['b', 'c', 'd'], e: 'f' }, { filter: ['a', 0, 2] });
|
||||
// 'a[0]=b&a[2]=d'
|
||||
```
|
||||
|
||||
### Handling of `null` values
|
||||
|
||||
By default, `null` values are treated like empty strings:
|
||||
|
||||
```javascript
|
||||
var withNull = qs.stringify({ a: null, b: '' });
|
||||
assert.equal(withNull, 'a=&b=');
|
||||
```
|
||||
|
||||
Parsing does not distinguish between parameters with and without equal signs. Both are converted to empty strings.
|
||||
|
||||
```javascript
|
||||
var equalsInsensitive = qs.parse('a&b=');
|
||||
assert.deepEqual(equalsInsensitive, { a: '', b: '' });
|
||||
```
|
||||
|
||||
To distinguish between `null` values and empty strings use the `strictNullHandling` flag. In the result string the `null`
|
||||
values have no `=` sign:
|
||||
|
||||
```javascript
|
||||
var strictNull = qs.stringify({ a: null, b: '' }, { strictNullHandling: true });
|
||||
assert.equal(strictNull, 'a&b=');
|
||||
```
|
||||
|
||||
To parse values without `=` back to `null` use the `strictNullHandling` flag:
|
||||
|
||||
```javascript
|
||||
var parsedStrictNull = qs.parse('a&b=', { strictNullHandling: true });
|
||||
assert.deepEqual(parsedStrictNull, { a: null, b: '' });
|
||||
```
|
||||
|
||||
To completely skip rendering keys with `null` values, use the `skipNulls` flag:
|
||||
|
||||
```javascript
|
||||
var nullsSkipped = qs.stringify({ a: 'b', c: null}, { skipNulls: true });
|
||||
assert.equal(nullsSkipped, 'a=b');
|
||||
```
|
||||
|
||||
### Dealing with special character sets
|
||||
|
||||
By default the encoding and decoding of characters is done in `utf-8`. If you
|
||||
wish to encode querystrings to a different character set (i.e.
|
||||
[Shift JIS](https://en.wikipedia.org/wiki/Shift_JIS)) you can use the
|
||||
[`qs-iconv`](https://github.com/martinheidegger/qs-iconv) library:
|
||||
|
||||
```javascript
|
||||
var encoder = require('qs-iconv/encoder')('shift_jis');
|
||||
var shiftJISEncoded = qs.stringify({ a: 'こんにちは!' }, { encoder: encoder });
|
||||
assert.equal(shiftJISEncoded, 'a=%82%B1%82%F1%82%C9%82%BF%82%CD%81I');
|
||||
```
|
||||
|
||||
This also works for decoding of query strings:
|
||||
|
||||
```javascript
|
||||
var decoder = require('qs-iconv/decoder')('shift_jis');
|
||||
var obj = qs.parse('a=%82%B1%82%F1%82%C9%82%BF%82%CD%81I', { decoder: decoder });
|
||||
assert.deepEqual(obj, { a: 'こんにちは!' });
|
||||
```
|
||||
|
||||
### RFC 3986 and RFC 1738 space encoding
|
||||
|
||||
RFC3986 used as default option and encodes ' ' to *%20* which is backward compatible.
|
||||
In the same time, output can be stringified as per RFC1738 with ' ' equal to '+'.
|
||||
|
||||
```
|
||||
assert.equal(qs.stringify({ a: 'b c' }), 'a=b%20c');
|
||||
assert.equal(qs.stringify({ a: 'b c' }, { format : 'RFC3986' }), 'a=b%20c');
|
||||
assert.equal(qs.stringify({ a: 'b c' }, { format : 'RFC1738' }), 'a=b+c');
|
||||
```
|
||||
|
||||
[1]: https://npmjs.org/package/qs
|
||||
[2]: http://versionbadg.es/ljharb/qs.svg
|
||||
[3]: https://api.travis-ci.org/ljharb/qs.svg
|
||||
[4]: https://travis-ci.org/ljharb/qs
|
||||
[5]: https://david-dm.org/ljharb/qs.svg
|
||||
[6]: https://david-dm.org/ljharb/qs
|
||||
[7]: https://david-dm.org/ljharb/qs/dev-status.svg
|
||||
[8]: https://david-dm.org/ljharb/qs?type=dev
|
||||
[9]: https://ci.testling.com/ljharb/qs.png
|
||||
[10]: https://ci.testling.com/ljharb/qs
|
||||
[11]: https://nodei.co/npm/qs.png?downloads=true&stars=true
|
||||
[license-image]: http://img.shields.io/npm/l/qs.svg
|
||||
[license-url]: LICENSE
|
||||
[downloads-image]: http://img.shields.io/npm/dm/qs.svg
|
||||
[downloads-url]: http://npm-stat.com/charts.html?package=qs
|
||||
638
node_modules/body-parser/node_modules/qs/dist/qs.js
generated
vendored
Normal file
638
node_modules/body-parser/node_modules/qs/dist/qs.js
generated
vendored
Normal file
@ -0,0 +1,638 @@
|
||||
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Qs = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
|
||||
'use strict';
|
||||
|
||||
var replace = String.prototype.replace;
|
||||
var percentTwenties = /%20/g;
|
||||
|
||||
module.exports = {
|
||||
'default': 'RFC3986',
|
||||
formatters: {
|
||||
RFC1738: function (value) {
|
||||
return replace.call(value, percentTwenties, '+');
|
||||
},
|
||||
RFC3986: function (value) {
|
||||
return value;
|
||||
}
|
||||
},
|
||||
RFC1738: 'RFC1738',
|
||||
RFC3986: 'RFC3986'
|
||||
};
|
||||
|
||||
},{}],2:[function(require,module,exports){
|
||||
'use strict';
|
||||
|
||||
var stringify = require('./stringify');
|
||||
var parse = require('./parse');
|
||||
var formats = require('./formats');
|
||||
|
||||
module.exports = {
|
||||
formats: formats,
|
||||
parse: parse,
|
||||
stringify: stringify
|
||||
};
|
||||
|
||||
},{"./formats":1,"./parse":3,"./stringify":4}],3:[function(require,module,exports){
|
||||
'use strict';
|
||||
|
||||
var utils = require('./utils');
|
||||
|
||||
var has = Object.prototype.hasOwnProperty;
|
||||
|
||||
var defaults = {
|
||||
allowDots: false,
|
||||
allowPrototypes: false,
|
||||
arrayLimit: 20,
|
||||
decoder: utils.decode,
|
||||
delimiter: '&',
|
||||
depth: 5,
|
||||
parameterLimit: 1000,
|
||||
plainObjects: false,
|
||||
strictNullHandling: false
|
||||
};
|
||||
|
||||
var parseValues = function parseQueryStringValues(str, options) {
|
||||
var obj = {};
|
||||
var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str;
|
||||
var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit;
|
||||
var parts = cleanStr.split(options.delimiter, limit);
|
||||
|
||||
for (var i = 0; i < parts.length; ++i) {
|
||||
var part = parts[i];
|
||||
|
||||
var bracketEqualsPos = part.indexOf(']=');
|
||||
var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1;
|
||||
|
||||
var key, val;
|
||||
if (pos === -1) {
|
||||
key = options.decoder(part, defaults.decoder);
|
||||
val = options.strictNullHandling ? null : '';
|
||||
} else {
|
||||
key = options.decoder(part.slice(0, pos), defaults.decoder);
|
||||
val = options.decoder(part.slice(pos + 1), defaults.decoder);
|
||||
}
|
||||
if (has.call(obj, key)) {
|
||||
obj[key] = [].concat(obj[key]).concat(val);
|
||||
} else {
|
||||
obj[key] = val;
|
||||
}
|
||||
}
|
||||
|
||||
return obj;
|
||||
};
|
||||
|
||||
var parseObject = function (chain, val, options) {
|
||||
var leaf = val;
|
||||
|
||||
for (var i = chain.length - 1; i >= 0; --i) {
|
||||
var obj;
|
||||
var root = chain[i];
|
||||
|
||||
if (root === '[]') {
|
||||
obj = [];
|
||||
obj = obj.concat(leaf);
|
||||
} else {
|
||||
obj = options.plainObjects ? Object.create(null) : {};
|
||||
var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root;
|
||||
var index = parseInt(cleanRoot, 10);
|
||||
if (
|
||||
!isNaN(index)
|
||||
&& root !== cleanRoot
|
||||
&& String(index) === cleanRoot
|
||||
&& index >= 0
|
||||
&& (options.parseArrays && index <= options.arrayLimit)
|
||||
) {
|
||||
obj = [];
|
||||
obj[index] = leaf;
|
||||
} else {
|
||||
obj[cleanRoot] = leaf;
|
||||
}
|
||||
}
|
||||
|
||||
leaf = obj;
|
||||
}
|
||||
|
||||
return leaf;
|
||||
};
|
||||
|
||||
var parseKeys = function parseQueryStringKeys(givenKey, val, options) {
|
||||
if (!givenKey) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Transform dot notation to bracket notation
|
||||
var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, '[$1]') : givenKey;
|
||||
|
||||
// The regex chunks
|
||||
|
||||
var brackets = /(\[[^[\]]*])/;
|
||||
var child = /(\[[^[\]]*])/g;
|
||||
|
||||
// Get the parent
|
||||
|
||||
var segment = brackets.exec(key);
|
||||
var parent = segment ? key.slice(0, segment.index) : key;
|
||||
|
||||
// Stash the parent if it exists
|
||||
|
||||
var keys = [];
|
||||
if (parent) {
|
||||
// If we aren't using plain objects, optionally prefix keys
|
||||
// that would overwrite object prototype properties
|
||||
if (!options.plainObjects && has.call(Object.prototype, parent)) {
|
||||
if (!options.allowPrototypes) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
keys.push(parent);
|
||||
}
|
||||
|
||||
// Loop through children appending to the array until we hit depth
|
||||
|
||||
var i = 0;
|
||||
while ((segment = child.exec(key)) !== null && i < options.depth) {
|
||||
i += 1;
|
||||
if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) {
|
||||
if (!options.allowPrototypes) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
keys.push(segment[1]);
|
||||
}
|
||||
|
||||
// If there's a remainder, just add whatever is left
|
||||
|
||||
if (segment) {
|
||||
keys.push('[' + key.slice(segment.index) + ']');
|
||||
}
|
||||
|
||||
return parseObject(keys, val, options);
|
||||
};
|
||||
|
||||
module.exports = function (str, opts) {
|
||||
var options = opts ? utils.assign({}, opts) : {};
|
||||
|
||||
if (options.decoder !== null && options.decoder !== undefined && typeof options.decoder !== 'function') {
|
||||
throw new TypeError('Decoder has to be a function.');
|
||||
}
|
||||
|
||||
options.ignoreQueryPrefix = options.ignoreQueryPrefix === true;
|
||||
options.delimiter = typeof options.delimiter === 'string' || utils.isRegExp(options.delimiter) ? options.delimiter : defaults.delimiter;
|
||||
options.depth = typeof options.depth === 'number' ? options.depth : defaults.depth;
|
||||
options.arrayLimit = typeof options.arrayLimit === 'number' ? options.arrayLimit : defaults.arrayLimit;
|
||||
options.parseArrays = options.parseArrays !== false;
|
||||
options.decoder = typeof options.decoder === 'function' ? options.decoder : defaults.decoder;
|
||||
options.allowDots = typeof options.allowDots === 'boolean' ? options.allowDots : defaults.allowDots;
|
||||
options.plainObjects = typeof options.plainObjects === 'boolean' ? options.plainObjects : defaults.plainObjects;
|
||||
options.allowPrototypes = typeof options.allowPrototypes === 'boolean' ? options.allowPrototypes : defaults.allowPrototypes;
|
||||
options.parameterLimit = typeof options.parameterLimit === 'number' ? options.parameterLimit : defaults.parameterLimit;
|
||||
options.strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : defaults.strictNullHandling;
|
||||
|
||||
if (str === '' || str === null || typeof str === 'undefined') {
|
||||
return options.plainObjects ? Object.create(null) : {};
|
||||
}
|
||||
|
||||
var tempObj = typeof str === 'string' ? parseValues(str, options) : str;
|
||||
var obj = options.plainObjects ? Object.create(null) : {};
|
||||
|
||||
// Iterate over the keys and setup the new object
|
||||
|
||||
var keys = Object.keys(tempObj);
|
||||
for (var i = 0; i < keys.length; ++i) {
|
||||
var key = keys[i];
|
||||
var newObj = parseKeys(key, tempObj[key], options);
|
||||
obj = utils.merge(obj, newObj, options);
|
||||
}
|
||||
|
||||
return utils.compact(obj);
|
||||
};
|
||||
|
||||
},{"./utils":5}],4:[function(require,module,exports){
|
||||
'use strict';
|
||||
|
||||
var utils = require('./utils');
|
||||
var formats = require('./formats');
|
||||
|
||||
var arrayPrefixGenerators = {
|
||||
brackets: function brackets(prefix) { // eslint-disable-line func-name-matching
|
||||
return prefix + '[]';
|
||||
},
|
||||
indices: function indices(prefix, key) { // eslint-disable-line func-name-matching
|
||||
return prefix + '[' + key + ']';
|
||||
},
|
||||
repeat: function repeat(prefix) { // eslint-disable-line func-name-matching
|
||||
return prefix;
|
||||
}
|
||||
};
|
||||
|
||||
var toISO = Date.prototype.toISOString;
|
||||
|
||||
var defaults = {
|
||||
delimiter: '&',
|
||||
encode: true,
|
||||
encoder: utils.encode,
|
||||
encodeValuesOnly: false,
|
||||
serializeDate: function serializeDate(date) { // eslint-disable-line func-name-matching
|
||||
return toISO.call(date);
|
||||
},
|
||||
skipNulls: false,
|
||||
strictNullHandling: false
|
||||
};
|
||||
|
||||
var stringify = function stringify( // eslint-disable-line func-name-matching
|
||||
object,
|
||||
prefix,
|
||||
generateArrayPrefix,
|
||||
strictNullHandling,
|
||||
skipNulls,
|
||||
encoder,
|
||||
filter,
|
||||
sort,
|
||||
allowDots,
|
||||
serializeDate,
|
||||
formatter,
|
||||
encodeValuesOnly
|
||||
) {
|
||||
var obj = object;
|
||||
if (typeof filter === 'function') {
|
||||
obj = filter(prefix, obj);
|
||||
} else if (obj instanceof Date) {
|
||||
obj = serializeDate(obj);
|
||||
} else if (obj === null) {
|
||||
if (strictNullHandling) {
|
||||
return encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder) : prefix;
|
||||
}
|
||||
|
||||
obj = '';
|
||||
}
|
||||
|
||||
if (typeof obj === 'string' || typeof obj === 'number' || typeof obj === 'boolean' || utils.isBuffer(obj)) {
|
||||
if (encoder) {
|
||||
var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder);
|
||||
return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder))];
|
||||
}
|
||||
return [formatter(prefix) + '=' + formatter(String(obj))];
|
||||
}
|
||||
|
||||
var values = [];
|
||||
|
||||
if (typeof obj === 'undefined') {
|
||||
return values;
|
||||
}
|
||||
|
||||
var objKeys;
|
||||
if (Array.isArray(filter)) {
|
||||
objKeys = filter;
|
||||
} else {
|
||||
var keys = Object.keys(obj);
|
||||
objKeys = sort ? keys.sort(sort) : keys;
|
||||
}
|
||||
|
||||
for (var i = 0; i < objKeys.length; ++i) {
|
||||
var key = objKeys[i];
|
||||
|
||||
if (skipNulls && obj[key] === null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (Array.isArray(obj)) {
|
||||
values = values.concat(stringify(
|
||||
obj[key],
|
||||
generateArrayPrefix(prefix, key),
|
||||
generateArrayPrefix,
|
||||
strictNullHandling,
|
||||
skipNulls,
|
||||
encoder,
|
||||
filter,
|
||||
sort,
|
||||
allowDots,
|
||||
serializeDate,
|
||||
formatter,
|
||||
encodeValuesOnly
|
||||
));
|
||||
} else {
|
||||
values = values.concat(stringify(
|
||||
obj[key],
|
||||
prefix + (allowDots ? '.' + key : '[' + key + ']'),
|
||||
generateArrayPrefix,
|
||||
strictNullHandling,
|
||||
skipNulls,
|
||||
encoder,
|
||||
filter,
|
||||
sort,
|
||||
allowDots,
|
||||
serializeDate,
|
||||
formatter,
|
||||
encodeValuesOnly
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
return values;
|
||||
};
|
||||
|
||||
module.exports = function (object, opts) {
|
||||
var obj = object;
|
||||
var options = opts ? utils.assign({}, opts) : {};
|
||||
|
||||
if (options.encoder !== null && options.encoder !== undefined && typeof options.encoder !== 'function') {
|
||||
throw new TypeError('Encoder has to be a function.');
|
||||
}
|
||||
|
||||
var delimiter = typeof options.delimiter === 'undefined' ? defaults.delimiter : options.delimiter;
|
||||
var strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : defaults.strictNullHandling;
|
||||
var skipNulls = typeof options.skipNulls === 'boolean' ? options.skipNulls : defaults.skipNulls;
|
||||
var encode = typeof options.encode === 'boolean' ? options.encode : defaults.encode;
|
||||
var encoder = typeof options.encoder === 'function' ? options.encoder : defaults.encoder;
|
||||
var sort = typeof options.sort === 'function' ? options.sort : null;
|
||||
var allowDots = typeof options.allowDots === 'undefined' ? false : options.allowDots;
|
||||
var serializeDate = typeof options.serializeDate === 'function' ? options.serializeDate : defaults.serializeDate;
|
||||
var encodeValuesOnly = typeof options.encodeValuesOnly === 'boolean' ? options.encodeValuesOnly : defaults.encodeValuesOnly;
|
||||
if (typeof options.format === 'undefined') {
|
||||
options.format = formats['default'];
|
||||
} else if (!Object.prototype.hasOwnProperty.call(formats.formatters, options.format)) {
|
||||
throw new TypeError('Unknown format option provided.');
|
||||
}
|
||||
var formatter = formats.formatters[options.format];
|
||||
var objKeys;
|
||||
var filter;
|
||||
|
||||
if (typeof options.filter === 'function') {
|
||||
filter = options.filter;
|
||||
obj = filter('', obj);
|
||||
} else if (Array.isArray(options.filter)) {
|
||||
filter = options.filter;
|
||||
objKeys = filter;
|
||||
}
|
||||
|
||||
var keys = [];
|
||||
|
||||
if (typeof obj !== 'object' || obj === null) {
|
||||
return '';
|
||||
}
|
||||
|
||||
var arrayFormat;
|
||||
if (options.arrayFormat in arrayPrefixGenerators) {
|
||||
arrayFormat = options.arrayFormat;
|
||||
} else if ('indices' in options) {
|
||||
arrayFormat = options.indices ? 'indices' : 'repeat';
|
||||
} else {
|
||||
arrayFormat = 'indices';
|
||||
}
|
||||
|
||||
var generateArrayPrefix = arrayPrefixGenerators[arrayFormat];
|
||||
|
||||
if (!objKeys) {
|
||||
objKeys = Object.keys(obj);
|
||||
}
|
||||
|
||||
if (sort) {
|
||||
objKeys.sort(sort);
|
||||
}
|
||||
|
||||
for (var i = 0; i < objKeys.length; ++i) {
|
||||
var key = objKeys[i];
|
||||
|
||||
if (skipNulls && obj[key] === null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
keys = keys.concat(stringify(
|
||||
obj[key],
|
||||
key,
|
||||
generateArrayPrefix,
|
||||
strictNullHandling,
|
||||
skipNulls,
|
||||
encode ? encoder : null,
|
||||
filter,
|
||||
sort,
|
||||
allowDots,
|
||||
serializeDate,
|
||||
formatter,
|
||||
encodeValuesOnly
|
||||
));
|
||||
}
|
||||
|
||||
var joined = keys.join(delimiter);
|
||||
var prefix = options.addQueryPrefix === true ? '?' : '';
|
||||
|
||||
return joined.length > 0 ? prefix + joined : '';
|
||||
};
|
||||
|
||||
},{"./formats":1,"./utils":5}],5:[function(require,module,exports){
|
||||
'use strict';
|
||||
|
||||
var has = Object.prototype.hasOwnProperty;
|
||||
|
||||
var hexTable = (function () {
|
||||
var array = [];
|
||||
for (var i = 0; i < 256; ++i) {
|
||||
array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase());
|
||||
}
|
||||
|
||||
return array;
|
||||
}());
|
||||
|
||||
var compactQueue = function compactQueue(queue) {
|
||||
var obj;
|
||||
|
||||
while (queue.length) {
|
||||
var item = queue.pop();
|
||||
obj = item.obj[item.prop];
|
||||
|
||||
if (Array.isArray(obj)) {
|
||||
var compacted = [];
|
||||
|
||||
for (var j = 0; j < obj.length; ++j) {
|
||||
if (typeof obj[j] !== 'undefined') {
|
||||
compacted.push(obj[j]);
|
||||
}
|
||||
}
|
||||
|
||||
item.obj[item.prop] = compacted;
|
||||
}
|
||||
}
|
||||
|
||||
return obj;
|
||||
};
|
||||
|
||||
var arrayToObject = function arrayToObject(source, options) {
|
||||
var obj = options && options.plainObjects ? Object.create(null) : {};
|
||||
for (var i = 0; i < source.length; ++i) {
|
||||
if (typeof source[i] !== 'undefined') {
|
||||
obj[i] = source[i];
|
||||
}
|
||||
}
|
||||
|
||||
return obj;
|
||||
};
|
||||
|
||||
var merge = function merge(target, source, options) {
|
||||
if (!source) {
|
||||
return target;
|
||||
}
|
||||
|
||||
if (typeof source !== 'object') {
|
||||
if (Array.isArray(target)) {
|
||||
target.push(source);
|
||||
} else if (typeof target === 'object') {
|
||||
if (options.plainObjects || options.allowPrototypes || !has.call(Object.prototype, source)) {
|
||||
target[source] = true;
|
||||
}
|
||||
} else {
|
||||
return [target, source];
|
||||
}
|
||||
|
||||
return target;
|
||||
}
|
||||
|
||||
if (typeof target !== 'object') {
|
||||
return [target].concat(source);
|
||||
}
|
||||
|
||||
var mergeTarget = target;
|
||||
if (Array.isArray(target) && !Array.isArray(source)) {
|
||||
mergeTarget = arrayToObject(target, options);
|
||||
}
|
||||
|
||||
if (Array.isArray(target) && Array.isArray(source)) {
|
||||
source.forEach(function (item, i) {
|
||||
if (has.call(target, i)) {
|
||||
if (target[i] && typeof target[i] === 'object') {
|
||||
target[i] = merge(target[i], item, options);
|
||||
} else {
|
||||
target.push(item);
|
||||
}
|
||||
} else {
|
||||
target[i] = item;
|
||||
}
|
||||
});
|
||||
return target;
|
||||
}
|
||||
|
||||
return Object.keys(source).reduce(function (acc, key) {
|
||||
var value = source[key];
|
||||
|
||||
if (has.call(acc, key)) {
|
||||
acc[key] = merge(acc[key], value, options);
|
||||
} else {
|
||||
acc[key] = value;
|
||||
}
|
||||
return acc;
|
||||
}, mergeTarget);
|
||||
};
|
||||
|
||||
var assign = function assignSingleSource(target, source) {
|
||||
return Object.keys(source).reduce(function (acc, key) {
|
||||
acc[key] = source[key];
|
||||
return acc;
|
||||
}, target);
|
||||
};
|
||||
|
||||
var decode = function (str) {
|
||||
try {
|
||||
return decodeURIComponent(str.replace(/\+/g, ' '));
|
||||
} catch (e) {
|
||||
return str;
|
||||
}
|
||||
};
|
||||
|
||||
var encode = function encode(str) {
|
||||
// This code was originally written by Brian White (mscdex) for the io.js core querystring library.
|
||||
// It has been adapted here for stricter adherence to RFC 3986
|
||||
if (str.length === 0) {
|
||||
return str;
|
||||
}
|
||||
|
||||
var string = typeof str === 'string' ? str : String(str);
|
||||
|
||||
var out = '';
|
||||
for (var i = 0; i < string.length; ++i) {
|
||||
var c = string.charCodeAt(i);
|
||||
|
||||
if (
|
||||
c === 0x2D // -
|
||||
|| c === 0x2E // .
|
||||
|| c === 0x5F // _
|
||||
|| c === 0x7E // ~
|
||||
|| (c >= 0x30 && c <= 0x39) // 0-9
|
||||
|| (c >= 0x41 && c <= 0x5A) // a-z
|
||||
|| (c >= 0x61 && c <= 0x7A) // A-Z
|
||||
) {
|
||||
out += string.charAt(i);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (c < 0x80) {
|
||||
out = out + hexTable[c];
|
||||
continue;
|
||||
}
|
||||
|
||||
if (c < 0x800) {
|
||||
out = out + (hexTable[0xC0 | (c >> 6)] + hexTable[0x80 | (c & 0x3F)]);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (c < 0xD800 || c >= 0xE000) {
|
||||
out = out + (hexTable[0xE0 | (c >> 12)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]);
|
||||
continue;
|
||||
}
|
||||
|
||||
i += 1;
|
||||
c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF));
|
||||
out += hexTable[0xF0 | (c >> 18)]
|
||||
+ hexTable[0x80 | ((c >> 12) & 0x3F)]
|
||||
+ hexTable[0x80 | ((c >> 6) & 0x3F)]
|
||||
+ hexTable[0x80 | (c & 0x3F)];
|
||||
}
|
||||
|
||||
return out;
|
||||
};
|
||||
|
||||
var compact = function compact(value) {
|
||||
var queue = [{ obj: { o: value }, prop: 'o' }];
|
||||
var refs = [];
|
||||
|
||||
for (var i = 0; i < queue.length; ++i) {
|
||||
var item = queue[i];
|
||||
var obj = item.obj[item.prop];
|
||||
|
||||
var keys = Object.keys(obj);
|
||||
for (var j = 0; j < keys.length; ++j) {
|
||||
var key = keys[j];
|
||||
var val = obj[key];
|
||||
if (typeof val === 'object' && val !== null && refs.indexOf(val) === -1) {
|
||||
queue.push({ obj: obj, prop: key });
|
||||
refs.push(val);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return compactQueue(queue);
|
||||
};
|
||||
|
||||
var isRegExp = function isRegExp(obj) {
|
||||
return Object.prototype.toString.call(obj) === '[object RegExp]';
|
||||
};
|
||||
|
||||
var isBuffer = function isBuffer(obj) {
|
||||
if (obj === null || typeof obj === 'undefined') {
|
||||
return false;
|
||||
}
|
||||
|
||||
return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj));
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
arrayToObject: arrayToObject,
|
||||
assign: assign,
|
||||
compact: compact,
|
||||
decode: decode,
|
||||
encode: encode,
|
||||
isBuffer: isBuffer,
|
||||
isRegExp: isRegExp,
|
||||
merge: merge
|
||||
};
|
||||
|
||||
},{}]},{},[2])(2)
|
||||
});
|
||||
18
node_modules/body-parser/node_modules/qs/lib/formats.js
generated
vendored
Normal file
18
node_modules/body-parser/node_modules/qs/lib/formats.js
generated
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
'use strict';
|
||||
|
||||
var replace = String.prototype.replace;
|
||||
var percentTwenties = /%20/g;
|
||||
|
||||
module.exports = {
|
||||
'default': 'RFC3986',
|
||||
formatters: {
|
||||
RFC1738: function (value) {
|
||||
return replace.call(value, percentTwenties, '+');
|
||||
},
|
||||
RFC3986: function (value) {
|
||||
return value;
|
||||
}
|
||||
},
|
||||
RFC1738: 'RFC1738',
|
||||
RFC3986: 'RFC3986'
|
||||
};
|
||||
11
node_modules/body-parser/node_modules/qs/lib/index.js
generated
vendored
Normal file
11
node_modules/body-parser/node_modules/qs/lib/index.js
generated
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
'use strict';
|
||||
|
||||
var stringify = require('./stringify');
|
||||
var parse = require('./parse');
|
||||
var formats = require('./formats');
|
||||
|
||||
module.exports = {
|
||||
formats: formats,
|
||||
parse: parse,
|
||||
stringify: stringify
|
||||
};
|
||||
174
node_modules/body-parser/node_modules/qs/lib/parse.js
generated
vendored
Normal file
174
node_modules/body-parser/node_modules/qs/lib/parse.js
generated
vendored
Normal file
@ -0,0 +1,174 @@
|
||||
'use strict';
|
||||
|
||||
var utils = require('./utils');
|
||||
|
||||
var has = Object.prototype.hasOwnProperty;
|
||||
|
||||
var defaults = {
|
||||
allowDots: false,
|
||||
allowPrototypes: false,
|
||||
arrayLimit: 20,
|
||||
decoder: utils.decode,
|
||||
delimiter: '&',
|
||||
depth: 5,
|
||||
parameterLimit: 1000,
|
||||
plainObjects: false,
|
||||
strictNullHandling: false
|
||||
};
|
||||
|
||||
var parseValues = function parseQueryStringValues(str, options) {
|
||||
var obj = {};
|
||||
var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str;
|
||||
var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit;
|
||||
var parts = cleanStr.split(options.delimiter, limit);
|
||||
|
||||
for (var i = 0; i < parts.length; ++i) {
|
||||
var part = parts[i];
|
||||
|
||||
var bracketEqualsPos = part.indexOf(']=');
|
||||
var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1;
|
||||
|
||||
var key, val;
|
||||
if (pos === -1) {
|
||||
key = options.decoder(part, defaults.decoder);
|
||||
val = options.strictNullHandling ? null : '';
|
||||
} else {
|
||||
key = options.decoder(part.slice(0, pos), defaults.decoder);
|
||||
val = options.decoder(part.slice(pos + 1), defaults.decoder);
|
||||
}
|
||||
if (has.call(obj, key)) {
|
||||
obj[key] = [].concat(obj[key]).concat(val);
|
||||
} else {
|
||||
obj[key] = val;
|
||||
}
|
||||
}
|
||||
|
||||
return obj;
|
||||
};
|
||||
|
||||
var parseObject = function (chain, val, options) {
|
||||
var leaf = val;
|
||||
|
||||
for (var i = chain.length - 1; i >= 0; --i) {
|
||||
var obj;
|
||||
var root = chain[i];
|
||||
|
||||
if (root === '[]') {
|
||||
obj = [];
|
||||
obj = obj.concat(leaf);
|
||||
} else {
|
||||
obj = options.plainObjects ? Object.create(null) : {};
|
||||
var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root;
|
||||
var index = parseInt(cleanRoot, 10);
|
||||
if (
|
||||
!isNaN(index)
|
||||
&& root !== cleanRoot
|
||||
&& String(index) === cleanRoot
|
||||
&& index >= 0
|
||||
&& (options.parseArrays && index <= options.arrayLimit)
|
||||
) {
|
||||
obj = [];
|
||||
obj[index] = leaf;
|
||||
} else {
|
||||
obj[cleanRoot] = leaf;
|
||||
}
|
||||
}
|
||||
|
||||
leaf = obj;
|
||||
}
|
||||
|
||||
return leaf;
|
||||
};
|
||||
|
||||
var parseKeys = function parseQueryStringKeys(givenKey, val, options) {
|
||||
if (!givenKey) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Transform dot notation to bracket notation
|
||||
var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, '[$1]') : givenKey;
|
||||
|
||||
// The regex chunks
|
||||
|
||||
var brackets = /(\[[^[\]]*])/;
|
||||
var child = /(\[[^[\]]*])/g;
|
||||
|
||||
// Get the parent
|
||||
|
||||
var segment = brackets.exec(key);
|
||||
var parent = segment ? key.slice(0, segment.index) : key;
|
||||
|
||||
// Stash the parent if it exists
|
||||
|
||||
var keys = [];
|
||||
if (parent) {
|
||||
// If we aren't using plain objects, optionally prefix keys
|
||||
// that would overwrite object prototype properties
|
||||
if (!options.plainObjects && has.call(Object.prototype, parent)) {
|
||||
if (!options.allowPrototypes) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
keys.push(parent);
|
||||
}
|
||||
|
||||
// Loop through children appending to the array until we hit depth
|
||||
|
||||
var i = 0;
|
||||
while ((segment = child.exec(key)) !== null && i < options.depth) {
|
||||
i += 1;
|
||||
if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) {
|
||||
if (!options.allowPrototypes) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
keys.push(segment[1]);
|
||||
}
|
||||
|
||||
// If there's a remainder, just add whatever is left
|
||||
|
||||
if (segment) {
|
||||
keys.push('[' + key.slice(segment.index) + ']');
|
||||
}
|
||||
|
||||
return parseObject(keys, val, options);
|
||||
};
|
||||
|
||||
module.exports = function (str, opts) {
|
||||
var options = opts ? utils.assign({}, opts) : {};
|
||||
|
||||
if (options.decoder !== null && options.decoder !== undefined && typeof options.decoder !== 'function') {
|
||||
throw new TypeError('Decoder has to be a function.');
|
||||
}
|
||||
|
||||
options.ignoreQueryPrefix = options.ignoreQueryPrefix === true;
|
||||
options.delimiter = typeof options.delimiter === 'string' || utils.isRegExp(options.delimiter) ? options.delimiter : defaults.delimiter;
|
||||
options.depth = typeof options.depth === 'number' ? options.depth : defaults.depth;
|
||||
options.arrayLimit = typeof options.arrayLimit === 'number' ? options.arrayLimit : defaults.arrayLimit;
|
||||
options.parseArrays = options.parseArrays !== false;
|
||||
options.decoder = typeof options.decoder === 'function' ? options.decoder : defaults.decoder;
|
||||
options.allowDots = typeof options.allowDots === 'boolean' ? options.allowDots : defaults.allowDots;
|
||||
options.plainObjects = typeof options.plainObjects === 'boolean' ? options.plainObjects : defaults.plainObjects;
|
||||
options.allowPrototypes = typeof options.allowPrototypes === 'boolean' ? options.allowPrototypes : defaults.allowPrototypes;
|
||||
options.parameterLimit = typeof options.parameterLimit === 'number' ? options.parameterLimit : defaults.parameterLimit;
|
||||
options.strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : defaults.strictNullHandling;
|
||||
|
||||
if (str === '' || str === null || typeof str === 'undefined') {
|
||||
return options.plainObjects ? Object.create(null) : {};
|
||||
}
|
||||
|
||||
var tempObj = typeof str === 'string' ? parseValues(str, options) : str;
|
||||
var obj = options.plainObjects ? Object.create(null) : {};
|
||||
|
||||
// Iterate over the keys and setup the new object
|
||||
|
||||
var keys = Object.keys(tempObj);
|
||||
for (var i = 0; i < keys.length; ++i) {
|
||||
var key = keys[i];
|
||||
var newObj = parseKeys(key, tempObj[key], options);
|
||||
obj = utils.merge(obj, newObj, options);
|
||||
}
|
||||
|
||||
return utils.compact(obj);
|
||||
};
|
||||
210
node_modules/body-parser/node_modules/qs/lib/stringify.js
generated
vendored
Normal file
210
node_modules/body-parser/node_modules/qs/lib/stringify.js
generated
vendored
Normal file
@ -0,0 +1,210 @@
|
||||
'use strict';
|
||||
|
||||
var utils = require('./utils');
|
||||
var formats = require('./formats');
|
||||
|
||||
var arrayPrefixGenerators = {
|
||||
brackets: function brackets(prefix) { // eslint-disable-line func-name-matching
|
||||
return prefix + '[]';
|
||||
},
|
||||
indices: function indices(prefix, key) { // eslint-disable-line func-name-matching
|
||||
return prefix + '[' + key + ']';
|
||||
},
|
||||
repeat: function repeat(prefix) { // eslint-disable-line func-name-matching
|
||||
return prefix;
|
||||
}
|
||||
};
|
||||
|
||||
var toISO = Date.prototype.toISOString;
|
||||
|
||||
var defaults = {
|
||||
delimiter: '&',
|
||||
encode: true,
|
||||
encoder: utils.encode,
|
||||
encodeValuesOnly: false,
|
||||
serializeDate: function serializeDate(date) { // eslint-disable-line func-name-matching
|
||||
return toISO.call(date);
|
||||
},
|
||||
skipNulls: false,
|
||||
strictNullHandling: false
|
||||
};
|
||||
|
||||
var stringify = function stringify( // eslint-disable-line func-name-matching
|
||||
object,
|
||||
prefix,
|
||||
generateArrayPrefix,
|
||||
strictNullHandling,
|
||||
skipNulls,
|
||||
encoder,
|
||||
filter,
|
||||
sort,
|
||||
allowDots,
|
||||
serializeDate,
|
||||
formatter,
|
||||
encodeValuesOnly
|
||||
) {
|
||||
var obj = object;
|
||||
if (typeof filter === 'function') {
|
||||
obj = filter(prefix, obj);
|
||||
} else if (obj instanceof Date) {
|
||||
obj = serializeDate(obj);
|
||||
} else if (obj === null) {
|
||||
if (strictNullHandling) {
|
||||
return encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder) : prefix;
|
||||
}
|
||||
|
||||
obj = '';
|
||||
}
|
||||
|
||||
if (typeof obj === 'string' || typeof obj === 'number' || typeof obj === 'boolean' || utils.isBuffer(obj)) {
|
||||
if (encoder) {
|
||||
var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder);
|
||||
return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder))];
|
||||
}
|
||||
return [formatter(prefix) + '=' + formatter(String(obj))];
|
||||
}
|
||||
|
||||
var values = [];
|
||||
|
||||
if (typeof obj === 'undefined') {
|
||||
return values;
|
||||
}
|
||||
|
||||
var objKeys;
|
||||
if (Array.isArray(filter)) {
|
||||
objKeys = filter;
|
||||
} else {
|
||||
var keys = Object.keys(obj);
|
||||
objKeys = sort ? keys.sort(sort) : keys;
|
||||
}
|
||||
|
||||
for (var i = 0; i < objKeys.length; ++i) {
|
||||
var key = objKeys[i];
|
||||
|
||||
if (skipNulls && obj[key] === null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (Array.isArray(obj)) {
|
||||
values = values.concat(stringify(
|
||||
obj[key],
|
||||
generateArrayPrefix(prefix, key),
|
||||
generateArrayPrefix,
|
||||
strictNullHandling,
|
||||
skipNulls,
|
||||
encoder,
|
||||
filter,
|
||||
sort,
|
||||
allowDots,
|
||||
serializeDate,
|
||||
formatter,
|
||||
encodeValuesOnly
|
||||
));
|
||||
} else {
|
||||
values = values.concat(stringify(
|
||||
obj[key],
|
||||
prefix + (allowDots ? '.' + key : '[' + key + ']'),
|
||||
generateArrayPrefix,
|
||||
strictNullHandling,
|
||||
skipNulls,
|
||||
encoder,
|
||||
filter,
|
||||
sort,
|
||||
allowDots,
|
||||
serializeDate,
|
||||
formatter,
|
||||
encodeValuesOnly
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
return values;
|
||||
};
|
||||
|
||||
module.exports = function (object, opts) {
|
||||
var obj = object;
|
||||
var options = opts ? utils.assign({}, opts) : {};
|
||||
|
||||
if (options.encoder !== null && options.encoder !== undefined && typeof options.encoder !== 'function') {
|
||||
throw new TypeError('Encoder has to be a function.');
|
||||
}
|
||||
|
||||
var delimiter = typeof options.delimiter === 'undefined' ? defaults.delimiter : options.delimiter;
|
||||
var strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : defaults.strictNullHandling;
|
||||
var skipNulls = typeof options.skipNulls === 'boolean' ? options.skipNulls : defaults.skipNulls;
|
||||
var encode = typeof options.encode === 'boolean' ? options.encode : defaults.encode;
|
||||
var encoder = typeof options.encoder === 'function' ? options.encoder : defaults.encoder;
|
||||
var sort = typeof options.sort === 'function' ? options.sort : null;
|
||||
var allowDots = typeof options.allowDots === 'undefined' ? false : options.allowDots;
|
||||
var serializeDate = typeof options.serializeDate === 'function' ? options.serializeDate : defaults.serializeDate;
|
||||
var encodeValuesOnly = typeof options.encodeValuesOnly === 'boolean' ? options.encodeValuesOnly : defaults.encodeValuesOnly;
|
||||
if (typeof options.format === 'undefined') {
|
||||
options.format = formats['default'];
|
||||
} else if (!Object.prototype.hasOwnProperty.call(formats.formatters, options.format)) {
|
||||
throw new TypeError('Unknown format option provided.');
|
||||
}
|
||||
var formatter = formats.formatters[options.format];
|
||||
var objKeys;
|
||||
var filter;
|
||||
|
||||
if (typeof options.filter === 'function') {
|
||||
filter = options.filter;
|
||||
obj = filter('', obj);
|
||||
} else if (Array.isArray(options.filter)) {
|
||||
filter = options.filter;
|
||||
objKeys = filter;
|
||||
}
|
||||
|
||||
var keys = [];
|
||||
|
||||
if (typeof obj !== 'object' || obj === null) {
|
||||
return '';
|
||||
}
|
||||
|
||||
var arrayFormat;
|
||||
if (options.arrayFormat in arrayPrefixGenerators) {
|
||||
arrayFormat = options.arrayFormat;
|
||||
} else if ('indices' in options) {
|
||||
arrayFormat = options.indices ? 'indices' : 'repeat';
|
||||
} else {
|
||||
arrayFormat = 'indices';
|
||||
}
|
||||
|
||||
var generateArrayPrefix = arrayPrefixGenerators[arrayFormat];
|
||||
|
||||
if (!objKeys) {
|
||||
objKeys = Object.keys(obj);
|
||||
}
|
||||
|
||||
if (sort) {
|
||||
objKeys.sort(sort);
|
||||
}
|
||||
|
||||
for (var i = 0; i < objKeys.length; ++i) {
|
||||
var key = objKeys[i];
|
||||
|
||||
if (skipNulls && obj[key] === null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
keys = keys.concat(stringify(
|
||||
obj[key],
|
||||
key,
|
||||
generateArrayPrefix,
|
||||
strictNullHandling,
|
||||
skipNulls,
|
||||
encode ? encoder : null,
|
||||
filter,
|
||||
sort,
|
||||
allowDots,
|
||||
serializeDate,
|
||||
formatter,
|
||||
encodeValuesOnly
|
||||
));
|
||||
}
|
||||
|
||||
var joined = keys.join(delimiter);
|
||||
var prefix = options.addQueryPrefix === true ? '?' : '';
|
||||
|
||||
return joined.length > 0 ? prefix + joined : '';
|
||||
};
|
||||
213
node_modules/body-parser/node_modules/qs/lib/utils.js
generated
vendored
Normal file
213
node_modules/body-parser/node_modules/qs/lib/utils.js
generated
vendored
Normal file
@ -0,0 +1,213 @@
|
||||
'use strict';
|
||||
|
||||
var has = Object.prototype.hasOwnProperty;
|
||||
|
||||
var hexTable = (function () {
|
||||
var array = [];
|
||||
for (var i = 0; i < 256; ++i) {
|
||||
array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase());
|
||||
}
|
||||
|
||||
return array;
|
||||
}());
|
||||
|
||||
var compactQueue = function compactQueue(queue) {
|
||||
var obj;
|
||||
|
||||
while (queue.length) {
|
||||
var item = queue.pop();
|
||||
obj = item.obj[item.prop];
|
||||
|
||||
if (Array.isArray(obj)) {
|
||||
var compacted = [];
|
||||
|
||||
for (var j = 0; j < obj.length; ++j) {
|
||||
if (typeof obj[j] !== 'undefined') {
|
||||
compacted.push(obj[j]);
|
||||
}
|
||||
}
|
||||
|
||||
item.obj[item.prop] = compacted;
|
||||
}
|
||||
}
|
||||
|
||||
return obj;
|
||||
};
|
||||
|
||||
var arrayToObject = function arrayToObject(source, options) {
|
||||
var obj = options && options.plainObjects ? Object.create(null) : {};
|
||||
for (var i = 0; i < source.length; ++i) {
|
||||
if (typeof source[i] !== 'undefined') {
|
||||
obj[i] = source[i];
|
||||
}
|
||||
}
|
||||
|
||||
return obj;
|
||||
};
|
||||
|
||||
var merge = function merge(target, source, options) {
|
||||
if (!source) {
|
||||
return target;
|
||||
}
|
||||
|
||||
if (typeof source !== 'object') {
|
||||
if (Array.isArray(target)) {
|
||||
target.push(source);
|
||||
} else if (typeof target === 'object') {
|
||||
if (options.plainObjects || options.allowPrototypes || !has.call(Object.prototype, source)) {
|
||||
target[source] = true;
|
||||
}
|
||||
} else {
|
||||
return [target, source];
|
||||
}
|
||||
|
||||
return target;
|
||||
}
|
||||
|
||||
if (typeof target !== 'object') {
|
||||
return [target].concat(source);
|
||||
}
|
||||
|
||||
var mergeTarget = target;
|
||||
if (Array.isArray(target) && !Array.isArray(source)) {
|
||||
mergeTarget = arrayToObject(target, options);
|
||||
}
|
||||
|
||||
if (Array.isArray(target) && Array.isArray(source)) {
|
||||
source.forEach(function (item, i) {
|
||||
if (has.call(target, i)) {
|
||||
if (target[i] && typeof target[i] === 'object') {
|
||||
target[i] = merge(target[i], item, options);
|
||||
} else {
|
||||
target.push(item);
|
||||
}
|
||||
} else {
|
||||
target[i] = item;
|
||||
}
|
||||
});
|
||||
return target;
|
||||
}
|
||||
|
||||
return Object.keys(source).reduce(function (acc, key) {
|
||||
var value = source[key];
|
||||
|
||||
if (has.call(acc, key)) {
|
||||
acc[key] = merge(acc[key], value, options);
|
||||
} else {
|
||||
acc[key] = value;
|
||||
}
|
||||
return acc;
|
||||
}, mergeTarget);
|
||||
};
|
||||
|
||||
var assign = function assignSingleSource(target, source) {
|
||||
return Object.keys(source).reduce(function (acc, key) {
|
||||
acc[key] = source[key];
|
||||
return acc;
|
||||
}, target);
|
||||
};
|
||||
|
||||
var decode = function (str) {
|
||||
try {
|
||||
return decodeURIComponent(str.replace(/\+/g, ' '));
|
||||
} catch (e) {
|
||||
return str;
|
||||
}
|
||||
};
|
||||
|
||||
var encode = function encode(str) {
|
||||
// This code was originally written by Brian White (mscdex) for the io.js core querystring library.
|
||||
// It has been adapted here for stricter adherence to RFC 3986
|
||||
if (str.length === 0) {
|
||||
return str;
|
||||
}
|
||||
|
||||
var string = typeof str === 'string' ? str : String(str);
|
||||
|
||||
var out = '';
|
||||
for (var i = 0; i < string.length; ++i) {
|
||||
var c = string.charCodeAt(i);
|
||||
|
||||
if (
|
||||
c === 0x2D // -
|
||||
|| c === 0x2E // .
|
||||
|| c === 0x5F // _
|
||||
|| c === 0x7E // ~
|
||||
|| (c >= 0x30 && c <= 0x39) // 0-9
|
||||
|| (c >= 0x41 && c <= 0x5A) // a-z
|
||||
|| (c >= 0x61 && c <= 0x7A) // A-Z
|
||||
) {
|
||||
out += string.charAt(i);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (c < 0x80) {
|
||||
out = out + hexTable[c];
|
||||
continue;
|
||||
}
|
||||
|
||||
if (c < 0x800) {
|
||||
out = out + (hexTable[0xC0 | (c >> 6)] + hexTable[0x80 | (c & 0x3F)]);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (c < 0xD800 || c >= 0xE000) {
|
||||
out = out + (hexTable[0xE0 | (c >> 12)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]);
|
||||
continue;
|
||||
}
|
||||
|
||||
i += 1;
|
||||
c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF));
|
||||
out += hexTable[0xF0 | (c >> 18)]
|
||||
+ hexTable[0x80 | ((c >> 12) & 0x3F)]
|
||||
+ hexTable[0x80 | ((c >> 6) & 0x3F)]
|
||||
+ hexTable[0x80 | (c & 0x3F)];
|
||||
}
|
||||
|
||||
return out;
|
||||
};
|
||||
|
||||
var compact = function compact(value) {
|
||||
var queue = [{ obj: { o: value }, prop: 'o' }];
|
||||
var refs = [];
|
||||
|
||||
for (var i = 0; i < queue.length; ++i) {
|
||||
var item = queue[i];
|
||||
var obj = item.obj[item.prop];
|
||||
|
||||
var keys = Object.keys(obj);
|
||||
for (var j = 0; j < keys.length; ++j) {
|
||||
var key = keys[j];
|
||||
var val = obj[key];
|
||||
if (typeof val === 'object' && val !== null && refs.indexOf(val) === -1) {
|
||||
queue.push({ obj: obj, prop: key });
|
||||
refs.push(val);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return compactQueue(queue);
|
||||
};
|
||||
|
||||
var isRegExp = function isRegExp(obj) {
|
||||
return Object.prototype.toString.call(obj) === '[object RegExp]';
|
||||
};
|
||||
|
||||
var isBuffer = function isBuffer(obj) {
|
||||
if (obj === null || typeof obj === 'undefined') {
|
||||
return false;
|
||||
}
|
||||
|
||||
return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj));
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
arrayToObject: arrayToObject,
|
||||
assign: assign,
|
||||
compact: compact,
|
||||
decode: decode,
|
||||
encode: encode,
|
||||
isBuffer: isBuffer,
|
||||
isRegExp: isRegExp,
|
||||
merge: merge
|
||||
};
|
||||
80
node_modules/body-parser/node_modules/qs/package.json
generated
vendored
Normal file
80
node_modules/body-parser/node_modules/qs/package.json
generated
vendored
Normal file
@ -0,0 +1,80 @@
|
||||
{
|
||||
"_from": "qs@6.5.2",
|
||||
"_id": "qs@6.5.2",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==",
|
||||
"_location": "/body-parser/qs",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "qs@6.5.2",
|
||||
"name": "qs",
|
||||
"escapedName": "qs",
|
||||
"rawSpec": "6.5.2",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "6.5.2"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/body-parser"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz",
|
||||
"_shasum": "cb3ae806e8740444584ef154ce8ee98d403f3e36",
|
||||
"_spec": "qs@6.5.2",
|
||||
"_where": "C:\\Users\\jonio\\Documents\\Programmieren\\Miniportal\\Neu\\MiniportalAPI\\node_modules\\body-parser",
|
||||
"bugs": {
|
||||
"url": "https://github.com/ljharb/qs/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Jordan Harband",
|
||||
"email": "ljharb@gmail.com",
|
||||
"url": "http://ljharb.codes"
|
||||
}
|
||||
],
|
||||
"dependencies": {},
|
||||
"deprecated": false,
|
||||
"description": "A querystring parser that supports nesting and arrays, with a depth limit",
|
||||
"devDependencies": {
|
||||
"@ljharb/eslint-config": "^12.2.1",
|
||||
"browserify": "^16.2.0",
|
||||
"covert": "^1.1.0",
|
||||
"editorconfig-tools": "^0.1.1",
|
||||
"eslint": "^4.19.1",
|
||||
"evalmd": "^0.0.17",
|
||||
"iconv-lite": "^0.4.21",
|
||||
"mkdirp": "^0.5.1",
|
||||
"qs-iconv": "^1.0.4",
|
||||
"safe-publish-latest": "^1.1.1",
|
||||
"safer-buffer": "^2.1.2",
|
||||
"tape": "^4.9.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.6"
|
||||
},
|
||||
"homepage": "https://github.com/ljharb/qs",
|
||||
"keywords": [
|
||||
"querystring",
|
||||
"qs"
|
||||
],
|
||||
"license": "BSD-3-Clause",
|
||||
"main": "lib/index.js",
|
||||
"name": "qs",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/ljharb/qs.git"
|
||||
},
|
||||
"scripts": {
|
||||
"coverage": "covert test",
|
||||
"dist": "mkdirp dist && browserify --standalone Qs lib/index.js > dist/qs.js",
|
||||
"lint": "eslint lib/*.js test/*.js",
|
||||
"prelint": "editorconfig-tools check * lib/* test/*",
|
||||
"prepublish": "safe-publish-latest && npm run dist",
|
||||
"pretest": "npm run --silent readme && npm run --silent lint",
|
||||
"readme": "evalmd README.md",
|
||||
"test": "npm run --silent coverage",
|
||||
"tests-only": "node test"
|
||||
},
|
||||
"version": "6.5.2"
|
||||
}
|
||||
15
node_modules/body-parser/node_modules/qs/test/.eslintrc
generated
vendored
Normal file
15
node_modules/body-parser/node_modules/qs/test/.eslintrc
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
{
|
||||
"rules": {
|
||||
"array-bracket-newline": 0,
|
||||
"array-element-newline": 0,
|
||||
"consistent-return": 2,
|
||||
"max-lines": 0,
|
||||
"max-nested-callbacks": [2, 3],
|
||||
"max-statements": 0,
|
||||
"no-buffer-constructor": 0,
|
||||
"no-extend-native": 0,
|
||||
"no-magic-numbers": 0,
|
||||
"object-curly-newline": 0,
|
||||
"sort-keys": 0
|
||||
}
|
||||
}
|
||||
7
node_modules/body-parser/node_modules/qs/test/index.js
generated
vendored
Normal file
7
node_modules/body-parser/node_modules/qs/test/index.js
generated
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
'use strict';
|
||||
|
||||
require('./parse');
|
||||
|
||||
require('./stringify');
|
||||
|
||||
require('./utils');
|
||||
574
node_modules/body-parser/node_modules/qs/test/parse.js
generated
vendored
Normal file
574
node_modules/body-parser/node_modules/qs/test/parse.js
generated
vendored
Normal file
@ -0,0 +1,574 @@
|
||||
'use strict';
|
||||
|
||||
var test = require('tape');
|
||||
var qs = require('../');
|
||||
var utils = require('../lib/utils');
|
||||
var iconv = require('iconv-lite');
|
||||
var SaferBuffer = require('safer-buffer').Buffer;
|
||||
|
||||
test('parse()', function (t) {
|
||||
t.test('parses a simple string', function (st) {
|
||||
st.deepEqual(qs.parse('0=foo'), { 0: 'foo' });
|
||||
st.deepEqual(qs.parse('foo=c++'), { foo: 'c ' });
|
||||
st.deepEqual(qs.parse('a[>=]=23'), { a: { '>=': '23' } });
|
||||
st.deepEqual(qs.parse('a[<=>]==23'), { a: { '<=>': '=23' } });
|
||||
st.deepEqual(qs.parse('a[==]=23'), { a: { '==': '23' } });
|
||||
st.deepEqual(qs.parse('foo', { strictNullHandling: true }), { foo: null });
|
||||
st.deepEqual(qs.parse('foo'), { foo: '' });
|
||||
st.deepEqual(qs.parse('foo='), { foo: '' });
|
||||
st.deepEqual(qs.parse('foo=bar'), { foo: 'bar' });
|
||||
st.deepEqual(qs.parse(' foo = bar = baz '), { ' foo ': ' bar = baz ' });
|
||||
st.deepEqual(qs.parse('foo=bar=baz'), { foo: 'bar=baz' });
|
||||
st.deepEqual(qs.parse('foo=bar&bar=baz'), { foo: 'bar', bar: 'baz' });
|
||||
st.deepEqual(qs.parse('foo2=bar2&baz2='), { foo2: 'bar2', baz2: '' });
|
||||
st.deepEqual(qs.parse('foo=bar&baz', { strictNullHandling: true }), { foo: 'bar', baz: null });
|
||||
st.deepEqual(qs.parse('foo=bar&baz'), { foo: 'bar', baz: '' });
|
||||
st.deepEqual(qs.parse('cht=p3&chd=t:60,40&chs=250x100&chl=Hello|World'), {
|
||||
cht: 'p3',
|
||||
chd: 't:60,40',
|
||||
chs: '250x100',
|
||||
chl: 'Hello|World'
|
||||
});
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('allows enabling dot notation', function (st) {
|
||||
st.deepEqual(qs.parse('a.b=c'), { 'a.b': 'c' });
|
||||
st.deepEqual(qs.parse('a.b=c', { allowDots: true }), { a: { b: 'c' } });
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.deepEqual(qs.parse('a[b]=c'), { a: { b: 'c' } }, 'parses a single nested string');
|
||||
t.deepEqual(qs.parse('a[b][c]=d'), { a: { b: { c: 'd' } } }, 'parses a double nested string');
|
||||
t.deepEqual(
|
||||
qs.parse('a[b][c][d][e][f][g][h]=i'),
|
||||
{ a: { b: { c: { d: { e: { f: { '[g][h]': 'i' } } } } } } },
|
||||
'defaults to a depth of 5'
|
||||
);
|
||||
|
||||
t.test('only parses one level when depth = 1', function (st) {
|
||||
st.deepEqual(qs.parse('a[b][c]=d', { depth: 1 }), { a: { b: { '[c]': 'd' } } });
|
||||
st.deepEqual(qs.parse('a[b][c][d]=e', { depth: 1 }), { a: { b: { '[c][d]': 'e' } } });
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.deepEqual(qs.parse('a=b&a=c'), { a: ['b', 'c'] }, 'parses a simple array');
|
||||
|
||||
t.test('parses an explicit array', function (st) {
|
||||
st.deepEqual(qs.parse('a[]=b'), { a: ['b'] });
|
||||
st.deepEqual(qs.parse('a[]=b&a[]=c'), { a: ['b', 'c'] });
|
||||
st.deepEqual(qs.parse('a[]=b&a[]=c&a[]=d'), { a: ['b', 'c', 'd'] });
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('parses a mix of simple and explicit arrays', function (st) {
|
||||
st.deepEqual(qs.parse('a=b&a[]=c'), { a: ['b', 'c'] });
|
||||
st.deepEqual(qs.parse('a[]=b&a=c'), { a: ['b', 'c'] });
|
||||
st.deepEqual(qs.parse('a[0]=b&a=c'), { a: ['b', 'c'] });
|
||||
st.deepEqual(qs.parse('a=b&a[0]=c'), { a: ['b', 'c'] });
|
||||
|
||||
st.deepEqual(qs.parse('a[1]=b&a=c', { arrayLimit: 20 }), { a: ['b', 'c'] });
|
||||
st.deepEqual(qs.parse('a[]=b&a=c', { arrayLimit: 0 }), { a: ['b', 'c'] });
|
||||
st.deepEqual(qs.parse('a[]=b&a=c'), { a: ['b', 'c'] });
|
||||
|
||||
st.deepEqual(qs.parse('a=b&a[1]=c', { arrayLimit: 20 }), { a: ['b', 'c'] });
|
||||
st.deepEqual(qs.parse('a=b&a[]=c', { arrayLimit: 0 }), { a: ['b', 'c'] });
|
||||
st.deepEqual(qs.parse('a=b&a[]=c'), { a: ['b', 'c'] });
|
||||
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('parses a nested array', function (st) {
|
||||
st.deepEqual(qs.parse('a[b][]=c&a[b][]=d'), { a: { b: ['c', 'd'] } });
|
||||
st.deepEqual(qs.parse('a[>=]=25'), { a: { '>=': '25' } });
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('allows to specify array indices', function (st) {
|
||||
st.deepEqual(qs.parse('a[1]=c&a[0]=b&a[2]=d'), { a: ['b', 'c', 'd'] });
|
||||
st.deepEqual(qs.parse('a[1]=c&a[0]=b'), { a: ['b', 'c'] });
|
||||
st.deepEqual(qs.parse('a[1]=c', { arrayLimit: 20 }), { a: ['c'] });
|
||||
st.deepEqual(qs.parse('a[1]=c', { arrayLimit: 0 }), { a: { 1: 'c' } });
|
||||
st.deepEqual(qs.parse('a[1]=c'), { a: ['c'] });
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('limits specific array indices to arrayLimit', function (st) {
|
||||
st.deepEqual(qs.parse('a[20]=a', { arrayLimit: 20 }), { a: ['a'] });
|
||||
st.deepEqual(qs.parse('a[21]=a', { arrayLimit: 20 }), { a: { 21: 'a' } });
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.deepEqual(qs.parse('a[12b]=c'), { a: { '12b': 'c' } }, 'supports keys that begin with a number');
|
||||
|
||||
t.test('supports encoded = signs', function (st) {
|
||||
st.deepEqual(qs.parse('he%3Dllo=th%3Dere'), { 'he=llo': 'th=ere' });
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('is ok with url encoded strings', function (st) {
|
||||
st.deepEqual(qs.parse('a[b%20c]=d'), { a: { 'b c': 'd' } });
|
||||
st.deepEqual(qs.parse('a[b]=c%20d'), { a: { b: 'c d' } });
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('allows brackets in the value', function (st) {
|
||||
st.deepEqual(qs.parse('pets=["tobi"]'), { pets: '["tobi"]' });
|
||||
st.deepEqual(qs.parse('operators=[">=", "<="]'), { operators: '[">=", "<="]' });
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('allows empty values', function (st) {
|
||||
st.deepEqual(qs.parse(''), {});
|
||||
st.deepEqual(qs.parse(null), {});
|
||||
st.deepEqual(qs.parse(undefined), {});
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('transforms arrays to objects', function (st) {
|
||||
st.deepEqual(qs.parse('foo[0]=bar&foo[bad]=baz'), { foo: { 0: 'bar', bad: 'baz' } });
|
||||
st.deepEqual(qs.parse('foo[bad]=baz&foo[0]=bar'), { foo: { bad: 'baz', 0: 'bar' } });
|
||||
st.deepEqual(qs.parse('foo[bad]=baz&foo[]=bar'), { foo: { bad: 'baz', 0: 'bar' } });
|
||||
st.deepEqual(qs.parse('foo[]=bar&foo[bad]=baz'), { foo: { 0: 'bar', bad: 'baz' } });
|
||||
st.deepEqual(qs.parse('foo[bad]=baz&foo[]=bar&foo[]=foo'), { foo: { bad: 'baz', 0: 'bar', 1: 'foo' } });
|
||||
st.deepEqual(qs.parse('foo[0][a]=a&foo[0][b]=b&foo[1][a]=aa&foo[1][b]=bb'), { foo: [{ a: 'a', b: 'b' }, { a: 'aa', b: 'bb' }] });
|
||||
|
||||
st.deepEqual(qs.parse('a[]=b&a[t]=u&a[hasOwnProperty]=c', { allowPrototypes: false }), { a: { 0: 'b', t: 'u' } });
|
||||
st.deepEqual(qs.parse('a[]=b&a[t]=u&a[hasOwnProperty]=c', { allowPrototypes: true }), { a: { 0: 'b', t: 'u', hasOwnProperty: 'c' } });
|
||||
st.deepEqual(qs.parse('a[]=b&a[hasOwnProperty]=c&a[x]=y', { allowPrototypes: false }), { a: { 0: 'b', x: 'y' } });
|
||||
st.deepEqual(qs.parse('a[]=b&a[hasOwnProperty]=c&a[x]=y', { allowPrototypes: true }), { a: { 0: 'b', hasOwnProperty: 'c', x: 'y' } });
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('transforms arrays to objects (dot notation)', function (st) {
|
||||
st.deepEqual(qs.parse('foo[0].baz=bar&fool.bad=baz', { allowDots: true }), { foo: [{ baz: 'bar' }], fool: { bad: 'baz' } });
|
||||
st.deepEqual(qs.parse('foo[0].baz=bar&fool.bad.boo=baz', { allowDots: true }), { foo: [{ baz: 'bar' }], fool: { bad: { boo: 'baz' } } });
|
||||
st.deepEqual(qs.parse('foo[0][0].baz=bar&fool.bad=baz', { allowDots: true }), { foo: [[{ baz: 'bar' }]], fool: { bad: 'baz' } });
|
||||
st.deepEqual(qs.parse('foo[0].baz[0]=15&foo[0].bar=2', { allowDots: true }), { foo: [{ baz: ['15'], bar: '2' }] });
|
||||
st.deepEqual(qs.parse('foo[0].baz[0]=15&foo[0].baz[1]=16&foo[0].bar=2', { allowDots: true }), { foo: [{ baz: ['15', '16'], bar: '2' }] });
|
||||
st.deepEqual(qs.parse('foo.bad=baz&foo[0]=bar', { allowDots: true }), { foo: { bad: 'baz', 0: 'bar' } });
|
||||
st.deepEqual(qs.parse('foo.bad=baz&foo[]=bar', { allowDots: true }), { foo: { bad: 'baz', 0: 'bar' } });
|
||||
st.deepEqual(qs.parse('foo[]=bar&foo.bad=baz', { allowDots: true }), { foo: { 0: 'bar', bad: 'baz' } });
|
||||
st.deepEqual(qs.parse('foo.bad=baz&foo[]=bar&foo[]=foo', { allowDots: true }), { foo: { bad: 'baz', 0: 'bar', 1: 'foo' } });
|
||||
st.deepEqual(qs.parse('foo[0].a=a&foo[0].b=b&foo[1].a=aa&foo[1].b=bb', { allowDots: true }), { foo: [{ a: 'a', b: 'b' }, { a: 'aa', b: 'bb' }] });
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('correctly prunes undefined values when converting an array to an object', function (st) {
|
||||
st.deepEqual(qs.parse('a[2]=b&a[99999999]=c'), { a: { 2: 'b', 99999999: 'c' } });
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('supports malformed uri characters', function (st) {
|
||||
st.deepEqual(qs.parse('{%:%}', { strictNullHandling: true }), { '{%:%}': null });
|
||||
st.deepEqual(qs.parse('{%:%}='), { '{%:%}': '' });
|
||||
st.deepEqual(qs.parse('foo=%:%}'), { foo: '%:%}' });
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('doesn\'t produce empty keys', function (st) {
|
||||
st.deepEqual(qs.parse('_r=1&'), { _r: '1' });
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('cannot access Object prototype', function (st) {
|
||||
qs.parse('constructor[prototype][bad]=bad');
|
||||
qs.parse('bad[constructor][prototype][bad]=bad');
|
||||
st.equal(typeof Object.prototype.bad, 'undefined');
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('parses arrays of objects', function (st) {
|
||||
st.deepEqual(qs.parse('a[][b]=c'), { a: [{ b: 'c' }] });
|
||||
st.deepEqual(qs.parse('a[0][b]=c'), { a: [{ b: 'c' }] });
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('allows for empty strings in arrays', function (st) {
|
||||
st.deepEqual(qs.parse('a[]=b&a[]=&a[]=c'), { a: ['b', '', 'c'] });
|
||||
|
||||
st.deepEqual(
|
||||
qs.parse('a[0]=b&a[1]&a[2]=c&a[19]=', { strictNullHandling: true, arrayLimit: 20 }),
|
||||
{ a: ['b', null, 'c', ''] },
|
||||
'with arrayLimit 20 + array indices: null then empty string works'
|
||||
);
|
||||
st.deepEqual(
|
||||
qs.parse('a[]=b&a[]&a[]=c&a[]=', { strictNullHandling: true, arrayLimit: 0 }),
|
||||
{ a: ['b', null, 'c', ''] },
|
||||
'with arrayLimit 0 + array brackets: null then empty string works'
|
||||
);
|
||||
|
||||
st.deepEqual(
|
||||
qs.parse('a[0]=b&a[1]=&a[2]=c&a[19]', { strictNullHandling: true, arrayLimit: 20 }),
|
||||
{ a: ['b', '', 'c', null] },
|
||||
'with arrayLimit 20 + array indices: empty string then null works'
|
||||
);
|
||||
st.deepEqual(
|
||||
qs.parse('a[]=b&a[]=&a[]=c&a[]', { strictNullHandling: true, arrayLimit: 0 }),
|
||||
{ a: ['b', '', 'c', null] },
|
||||
'with arrayLimit 0 + array brackets: empty string then null works'
|
||||
);
|
||||
|
||||
st.deepEqual(
|
||||
qs.parse('a[]=&a[]=b&a[]=c'),
|
||||
{ a: ['', 'b', 'c'] },
|
||||
'array brackets: empty strings work'
|
||||
);
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('compacts sparse arrays', function (st) {
|
||||
st.deepEqual(qs.parse('a[10]=1&a[2]=2', { arrayLimit: 20 }), { a: ['2', '1'] });
|
||||
st.deepEqual(qs.parse('a[1][b][2][c]=1', { arrayLimit: 20 }), { a: [{ b: [{ c: '1' }] }] });
|
||||
st.deepEqual(qs.parse('a[1][2][3][c]=1', { arrayLimit: 20 }), { a: [[[{ c: '1' }]]] });
|
||||
st.deepEqual(qs.parse('a[1][2][3][c][1]=1', { arrayLimit: 20 }), { a: [[[{ c: ['1'] }]]] });
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('parses semi-parsed strings', function (st) {
|
||||
st.deepEqual(qs.parse({ 'a[b]': 'c' }), { a: { b: 'c' } });
|
||||
st.deepEqual(qs.parse({ 'a[b]': 'c', 'a[d]': 'e' }), { a: { b: 'c', d: 'e' } });
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('parses buffers correctly', function (st) {
|
||||
var b = SaferBuffer.from('test');
|
||||
st.deepEqual(qs.parse({ a: b }), { a: b });
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('continues parsing when no parent is found', function (st) {
|
||||
st.deepEqual(qs.parse('[]=&a=b'), { 0: '', a: 'b' });
|
||||
st.deepEqual(qs.parse('[]&a=b', { strictNullHandling: true }), { 0: null, a: 'b' });
|
||||
st.deepEqual(qs.parse('[foo]=bar'), { foo: 'bar' });
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('does not error when parsing a very long array', function (st) {
|
||||
var str = 'a[]=a';
|
||||
while (Buffer.byteLength(str) < 128 * 1024) {
|
||||
str = str + '&' + str;
|
||||
}
|
||||
|
||||
st.doesNotThrow(function () {
|
||||
qs.parse(str);
|
||||
});
|
||||
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('should not throw when a native prototype has an enumerable property', { parallel: false }, function (st) {
|
||||
Object.prototype.crash = '';
|
||||
Array.prototype.crash = '';
|
||||
st.doesNotThrow(qs.parse.bind(null, 'a=b'));
|
||||
st.deepEqual(qs.parse('a=b'), { a: 'b' });
|
||||
st.doesNotThrow(qs.parse.bind(null, 'a[][b]=c'));
|
||||
st.deepEqual(qs.parse('a[][b]=c'), { a: [{ b: 'c' }] });
|
||||
delete Object.prototype.crash;
|
||||
delete Array.prototype.crash;
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('parses a string with an alternative string delimiter', function (st) {
|
||||
st.deepEqual(qs.parse('a=b;c=d', { delimiter: ';' }), { a: 'b', c: 'd' });
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('parses a string with an alternative RegExp delimiter', function (st) {
|
||||
st.deepEqual(qs.parse('a=b; c=d', { delimiter: /[;,] */ }), { a: 'b', c: 'd' });
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('does not use non-splittable objects as delimiters', function (st) {
|
||||
st.deepEqual(qs.parse('a=b&c=d', { delimiter: true }), { a: 'b', c: 'd' });
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('allows overriding parameter limit', function (st) {
|
||||
st.deepEqual(qs.parse('a=b&c=d', { parameterLimit: 1 }), { a: 'b' });
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('allows setting the parameter limit to Infinity', function (st) {
|
||||
st.deepEqual(qs.parse('a=b&c=d', { parameterLimit: Infinity }), { a: 'b', c: 'd' });
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('allows overriding array limit', function (st) {
|
||||
st.deepEqual(qs.parse('a[0]=b', { arrayLimit: -1 }), { a: { 0: 'b' } });
|
||||
st.deepEqual(qs.parse('a[-1]=b', { arrayLimit: -1 }), { a: { '-1': 'b' } });
|
||||
st.deepEqual(qs.parse('a[0]=b&a[1]=c', { arrayLimit: 0 }), { a: { 0: 'b', 1: 'c' } });
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('allows disabling array parsing', function (st) {
|
||||
st.deepEqual(qs.parse('a[0]=b&a[1]=c', { parseArrays: false }), { a: { 0: 'b', 1: 'c' } });
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('allows for query string prefix', function (st) {
|
||||
st.deepEqual(qs.parse('?foo=bar', { ignoreQueryPrefix: true }), { foo: 'bar' });
|
||||
st.deepEqual(qs.parse('foo=bar', { ignoreQueryPrefix: true }), { foo: 'bar' });
|
||||
st.deepEqual(qs.parse('?foo=bar', { ignoreQueryPrefix: false }), { '?foo': 'bar' });
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('parses an object', function (st) {
|
||||
var input = {
|
||||
'user[name]': { 'pop[bob]': 3 },
|
||||
'user[email]': null
|
||||
};
|
||||
|
||||
var expected = {
|
||||
user: {
|
||||
name: { 'pop[bob]': 3 },
|
||||
email: null
|
||||
}
|
||||
};
|
||||
|
||||
var result = qs.parse(input);
|
||||
|
||||
st.deepEqual(result, expected);
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('parses an object in dot notation', function (st) {
|
||||
var input = {
|
||||
'user.name': { 'pop[bob]': 3 },
|
||||
'user.email.': null
|
||||
};
|
||||
|
||||
var expected = {
|
||||
user: {
|
||||
name: { 'pop[bob]': 3 },
|
||||
email: null
|
||||
}
|
||||
};
|
||||
|
||||
var result = qs.parse(input, { allowDots: true });
|
||||
|
||||
st.deepEqual(result, expected);
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('parses an object and not child values', function (st) {
|
||||
var input = {
|
||||
'user[name]': { 'pop[bob]': { test: 3 } },
|
||||
'user[email]': null
|
||||
};
|
||||
|
||||
var expected = {
|
||||
user: {
|
||||
name: { 'pop[bob]': { test: 3 } },
|
||||
email: null
|
||||
}
|
||||
};
|
||||
|
||||
var result = qs.parse(input);
|
||||
|
||||
st.deepEqual(result, expected);
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('does not blow up when Buffer global is missing', function (st) {
|
||||
var tempBuffer = global.Buffer;
|
||||
delete global.Buffer;
|
||||
var result = qs.parse('a=b&c=d');
|
||||
global.Buffer = tempBuffer;
|
||||
st.deepEqual(result, { a: 'b', c: 'd' });
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('does not crash when parsing circular references', function (st) {
|
||||
var a = {};
|
||||
a.b = a;
|
||||
|
||||
var parsed;
|
||||
|
||||
st.doesNotThrow(function () {
|
||||
parsed = qs.parse({ 'foo[bar]': 'baz', 'foo[baz]': a });
|
||||
});
|
||||
|
||||
st.equal('foo' in parsed, true, 'parsed has "foo" property');
|
||||
st.equal('bar' in parsed.foo, true);
|
||||
st.equal('baz' in parsed.foo, true);
|
||||
st.equal(parsed.foo.bar, 'baz');
|
||||
st.deepEqual(parsed.foo.baz, a);
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('does not crash when parsing deep objects', function (st) {
|
||||
var parsed;
|
||||
var str = 'foo';
|
||||
|
||||
for (var i = 0; i < 5000; i++) {
|
||||
str += '[p]';
|
||||
}
|
||||
|
||||
str += '=bar';
|
||||
|
||||
st.doesNotThrow(function () {
|
||||
parsed = qs.parse(str, { depth: 5000 });
|
||||
});
|
||||
|
||||
st.equal('foo' in parsed, true, 'parsed has "foo" property');
|
||||
|
||||
var depth = 0;
|
||||
var ref = parsed.foo;
|
||||
while ((ref = ref.p)) {
|
||||
depth += 1;
|
||||
}
|
||||
|
||||
st.equal(depth, 5000, 'parsed is 5000 properties deep');
|
||||
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('parses null objects correctly', { skip: !Object.create }, function (st) {
|
||||
var a = Object.create(null);
|
||||
a.b = 'c';
|
||||
|
||||
st.deepEqual(qs.parse(a), { b: 'c' });
|
||||
var result = qs.parse({ a: a });
|
||||
st.equal('a' in result, true, 'result has "a" property');
|
||||
st.deepEqual(result.a, a);
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('parses dates correctly', function (st) {
|
||||
var now = new Date();
|
||||
st.deepEqual(qs.parse({ a: now }), { a: now });
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('parses regular expressions correctly', function (st) {
|
||||
var re = /^test$/;
|
||||
st.deepEqual(qs.parse({ a: re }), { a: re });
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('does not allow overwriting prototype properties', function (st) {
|
||||
st.deepEqual(qs.parse('a[hasOwnProperty]=b', { allowPrototypes: false }), {});
|
||||
st.deepEqual(qs.parse('hasOwnProperty=b', { allowPrototypes: false }), {});
|
||||
|
||||
st.deepEqual(
|
||||
qs.parse('toString', { allowPrototypes: false }),
|
||||
{},
|
||||
'bare "toString" results in {}'
|
||||
);
|
||||
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('can allow overwriting prototype properties', function (st) {
|
||||
st.deepEqual(qs.parse('a[hasOwnProperty]=b', { allowPrototypes: true }), { a: { hasOwnProperty: 'b' } });
|
||||
st.deepEqual(qs.parse('hasOwnProperty=b', { allowPrototypes: true }), { hasOwnProperty: 'b' });
|
||||
|
||||
st.deepEqual(
|
||||
qs.parse('toString', { allowPrototypes: true }),
|
||||
{ toString: '' },
|
||||
'bare "toString" results in { toString: "" }'
|
||||
);
|
||||
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('params starting with a closing bracket', function (st) {
|
||||
st.deepEqual(qs.parse(']=toString'), { ']': 'toString' });
|
||||
st.deepEqual(qs.parse(']]=toString'), { ']]': 'toString' });
|
||||
st.deepEqual(qs.parse(']hello]=toString'), { ']hello]': 'toString' });
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('params starting with a starting bracket', function (st) {
|
||||
st.deepEqual(qs.parse('[=toString'), { '[': 'toString' });
|
||||
st.deepEqual(qs.parse('[[=toString'), { '[[': 'toString' });
|
||||
st.deepEqual(qs.parse('[hello[=toString'), { '[hello[': 'toString' });
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('add keys to objects', function (st) {
|
||||
st.deepEqual(
|
||||
qs.parse('a[b]=c&a=d'),
|
||||
{ a: { b: 'c', d: true } },
|
||||
'can add keys to objects'
|
||||
);
|
||||
|
||||
st.deepEqual(
|
||||
qs.parse('a[b]=c&a=toString'),
|
||||
{ a: { b: 'c' } },
|
||||
'can not overwrite prototype'
|
||||
);
|
||||
|
||||
st.deepEqual(
|
||||
qs.parse('a[b]=c&a=toString', { allowPrototypes: true }),
|
||||
{ a: { b: 'c', toString: true } },
|
||||
'can overwrite prototype with allowPrototypes true'
|
||||
);
|
||||
|
||||
st.deepEqual(
|
||||
qs.parse('a[b]=c&a=toString', { plainObjects: true }),
|
||||
{ a: { b: 'c', toString: true } },
|
||||
'can overwrite prototype with plainObjects true'
|
||||
);
|
||||
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('can return null objects', { skip: !Object.create }, function (st) {
|
||||
var expected = Object.create(null);
|
||||
expected.a = Object.create(null);
|
||||
expected.a.b = 'c';
|
||||
expected.a.hasOwnProperty = 'd';
|
||||
st.deepEqual(qs.parse('a[b]=c&a[hasOwnProperty]=d', { plainObjects: true }), expected);
|
||||
st.deepEqual(qs.parse(null, { plainObjects: true }), Object.create(null));
|
||||
var expectedArray = Object.create(null);
|
||||
expectedArray.a = Object.create(null);
|
||||
expectedArray.a[0] = 'b';
|
||||
expectedArray.a.c = 'd';
|
||||
st.deepEqual(qs.parse('a[]=b&a[c]=d', { plainObjects: true }), expectedArray);
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('can parse with custom encoding', function (st) {
|
||||
st.deepEqual(qs.parse('%8c%a7=%91%e5%8d%e3%95%7b', {
|
||||
decoder: function (str) {
|
||||
var reg = /%([0-9A-F]{2})/ig;
|
||||
var result = [];
|
||||
var parts = reg.exec(str);
|
||||
while (parts) {
|
||||
result.push(parseInt(parts[1], 16));
|
||||
parts = reg.exec(str);
|
||||
}
|
||||
return iconv.decode(SaferBuffer.from(result), 'shift_jis').toString();
|
||||
}
|
||||
}), { 県: '大阪府' });
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('receives the default decoder as a second argument', function (st) {
|
||||
st.plan(1);
|
||||
qs.parse('a', {
|
||||
decoder: function (str, defaultDecoder) {
|
||||
st.equal(defaultDecoder, utils.decode);
|
||||
}
|
||||
});
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('throws error with wrong decoder', function (st) {
|
||||
st['throws'](function () {
|
||||
qs.parse({}, { decoder: 'string' });
|
||||
}, new TypeError('Decoder has to be a function.'));
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('does not mutate the options argument', function (st) {
|
||||
var options = {};
|
||||
qs.parse('a[b]=true', options);
|
||||
st.deepEqual(options, {});
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.end();
|
||||
});
|
||||
597
node_modules/body-parser/node_modules/qs/test/stringify.js
generated
vendored
Normal file
597
node_modules/body-parser/node_modules/qs/test/stringify.js
generated
vendored
Normal file
@ -0,0 +1,597 @@
|
||||
'use strict';
|
||||
|
||||
var test = require('tape');
|
||||
var qs = require('../');
|
||||
var utils = require('../lib/utils');
|
||||
var iconv = require('iconv-lite');
|
||||
var SaferBuffer = require('safer-buffer').Buffer;
|
||||
|
||||
test('stringify()', function (t) {
|
||||
t.test('stringifies a querystring object', function (st) {
|
||||
st.equal(qs.stringify({ a: 'b' }), 'a=b');
|
||||
st.equal(qs.stringify({ a: 1 }), 'a=1');
|
||||
st.equal(qs.stringify({ a: 1, b: 2 }), 'a=1&b=2');
|
||||
st.equal(qs.stringify({ a: 'A_Z' }), 'a=A_Z');
|
||||
st.equal(qs.stringify({ a: '€' }), 'a=%E2%82%AC');
|
||||
st.equal(qs.stringify({ a: '' }), 'a=%EE%80%80');
|
||||
st.equal(qs.stringify({ a: 'א' }), 'a=%D7%90');
|
||||
st.equal(qs.stringify({ a: '𐐷' }), 'a=%F0%90%90%B7');
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('adds query prefix', function (st) {
|
||||
st.equal(qs.stringify({ a: 'b' }, { addQueryPrefix: true }), '?a=b');
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('with query prefix, outputs blank string given an empty object', function (st) {
|
||||
st.equal(qs.stringify({}, { addQueryPrefix: true }), '');
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('stringifies a nested object', function (st) {
|
||||
st.equal(qs.stringify({ a: { b: 'c' } }), 'a%5Bb%5D=c');
|
||||
st.equal(qs.stringify({ a: { b: { c: { d: 'e' } } } }), 'a%5Bb%5D%5Bc%5D%5Bd%5D=e');
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('stringifies a nested object with dots notation', function (st) {
|
||||
st.equal(qs.stringify({ a: { b: 'c' } }, { allowDots: true }), 'a.b=c');
|
||||
st.equal(qs.stringify({ a: { b: { c: { d: 'e' } } } }, { allowDots: true }), 'a.b.c.d=e');
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('stringifies an array value', function (st) {
|
||||
st.equal(
|
||||
qs.stringify({ a: ['b', 'c', 'd'] }, { arrayFormat: 'indices' }),
|
||||
'a%5B0%5D=b&a%5B1%5D=c&a%5B2%5D=d',
|
||||
'indices => indices'
|
||||
);
|
||||
st.equal(
|
||||
qs.stringify({ a: ['b', 'c', 'd'] }, { arrayFormat: 'brackets' }),
|
||||
'a%5B%5D=b&a%5B%5D=c&a%5B%5D=d',
|
||||
'brackets => brackets'
|
||||
);
|
||||
st.equal(
|
||||
qs.stringify({ a: ['b', 'c', 'd'] }),
|
||||
'a%5B0%5D=b&a%5B1%5D=c&a%5B2%5D=d',
|
||||
'default => indices'
|
||||
);
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('omits nulls when asked', function (st) {
|
||||
st.equal(qs.stringify({ a: 'b', c: null }, { skipNulls: true }), 'a=b');
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('omits nested nulls when asked', function (st) {
|
||||
st.equal(qs.stringify({ a: { b: 'c', d: null } }, { skipNulls: true }), 'a%5Bb%5D=c');
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('omits array indices when asked', function (st) {
|
||||
st.equal(qs.stringify({ a: ['b', 'c', 'd'] }, { indices: false }), 'a=b&a=c&a=d');
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('stringifies a nested array value', function (st) {
|
||||
st.equal(qs.stringify({ a: { b: ['c', 'd'] } }, { arrayFormat: 'indices' }), 'a%5Bb%5D%5B0%5D=c&a%5Bb%5D%5B1%5D=d');
|
||||
st.equal(qs.stringify({ a: { b: ['c', 'd'] } }, { arrayFormat: 'brackets' }), 'a%5Bb%5D%5B%5D=c&a%5Bb%5D%5B%5D=d');
|
||||
st.equal(qs.stringify({ a: { b: ['c', 'd'] } }), 'a%5Bb%5D%5B0%5D=c&a%5Bb%5D%5B1%5D=d');
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('stringifies a nested array value with dots notation', function (st) {
|
||||
st.equal(
|
||||
qs.stringify(
|
||||
{ a: { b: ['c', 'd'] } },
|
||||
{ allowDots: true, encode: false, arrayFormat: 'indices' }
|
||||
),
|
||||
'a.b[0]=c&a.b[1]=d',
|
||||
'indices: stringifies with dots + indices'
|
||||
);
|
||||
st.equal(
|
||||
qs.stringify(
|
||||
{ a: { b: ['c', 'd'] } },
|
||||
{ allowDots: true, encode: false, arrayFormat: 'brackets' }
|
||||
),
|
||||
'a.b[]=c&a.b[]=d',
|
||||
'brackets: stringifies with dots + brackets'
|
||||
);
|
||||
st.equal(
|
||||
qs.stringify(
|
||||
{ a: { b: ['c', 'd'] } },
|
||||
{ allowDots: true, encode: false }
|
||||
),
|
||||
'a.b[0]=c&a.b[1]=d',
|
||||
'default: stringifies with dots + indices'
|
||||
);
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('stringifies an object inside an array', function (st) {
|
||||
st.equal(
|
||||
qs.stringify({ a: [{ b: 'c' }] }, { arrayFormat: 'indices' }),
|
||||
'a%5B0%5D%5Bb%5D=c',
|
||||
'indices => brackets'
|
||||
);
|
||||
st.equal(
|
||||
qs.stringify({ a: [{ b: 'c' }] }, { arrayFormat: 'brackets' }),
|
||||
'a%5B%5D%5Bb%5D=c',
|
||||
'brackets => brackets'
|
||||
);
|
||||
st.equal(
|
||||
qs.stringify({ a: [{ b: 'c' }] }),
|
||||
'a%5B0%5D%5Bb%5D=c',
|
||||
'default => indices'
|
||||
);
|
||||
|
||||
st.equal(
|
||||
qs.stringify({ a: [{ b: { c: [1] } }] }, { arrayFormat: 'indices' }),
|
||||
'a%5B0%5D%5Bb%5D%5Bc%5D%5B0%5D=1',
|
||||
'indices => indices'
|
||||
);
|
||||
|
||||
st.equal(
|
||||
qs.stringify({ a: [{ b: { c: [1] } }] }, { arrayFormat: 'brackets' }),
|
||||
'a%5B%5D%5Bb%5D%5Bc%5D%5B%5D=1',
|
||||
'brackets => brackets'
|
||||
);
|
||||
|
||||
st.equal(
|
||||
qs.stringify({ a: [{ b: { c: [1] } }] }),
|
||||
'a%5B0%5D%5Bb%5D%5Bc%5D%5B0%5D=1',
|
||||
'default => indices'
|
||||
);
|
||||
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('stringifies an array with mixed objects and primitives', function (st) {
|
||||
st.equal(
|
||||
qs.stringify({ a: [{ b: 1 }, 2, 3] }, { encode: false, arrayFormat: 'indices' }),
|
||||
'a[0][b]=1&a[1]=2&a[2]=3',
|
||||
'indices => indices'
|
||||
);
|
||||
st.equal(
|
||||
qs.stringify({ a: [{ b: 1 }, 2, 3] }, { encode: false, arrayFormat: 'brackets' }),
|
||||
'a[][b]=1&a[]=2&a[]=3',
|
||||
'brackets => brackets'
|
||||
);
|
||||
st.equal(
|
||||
qs.stringify({ a: [{ b: 1 }, 2, 3] }, { encode: false }),
|
||||
'a[0][b]=1&a[1]=2&a[2]=3',
|
||||
'default => indices'
|
||||
);
|
||||
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('stringifies an object inside an array with dots notation', function (st) {
|
||||
st.equal(
|
||||
qs.stringify(
|
||||
{ a: [{ b: 'c' }] },
|
||||
{ allowDots: true, encode: false, arrayFormat: 'indices' }
|
||||
),
|
||||
'a[0].b=c',
|
||||
'indices => indices'
|
||||
);
|
||||
st.equal(
|
||||
qs.stringify(
|
||||
{ a: [{ b: 'c' }] },
|
||||
{ allowDots: true, encode: false, arrayFormat: 'brackets' }
|
||||
),
|
||||
'a[].b=c',
|
||||
'brackets => brackets'
|
||||
);
|
||||
st.equal(
|
||||
qs.stringify(
|
||||
{ a: [{ b: 'c' }] },
|
||||
{ allowDots: true, encode: false }
|
||||
),
|
||||
'a[0].b=c',
|
||||
'default => indices'
|
||||
);
|
||||
|
||||
st.equal(
|
||||
qs.stringify(
|
||||
{ a: [{ b: { c: [1] } }] },
|
||||
{ allowDots: true, encode: false, arrayFormat: 'indices' }
|
||||
),
|
||||
'a[0].b.c[0]=1',
|
||||
'indices => indices'
|
||||
);
|
||||
st.equal(
|
||||
qs.stringify(
|
||||
{ a: [{ b: { c: [1] } }] },
|
||||
{ allowDots: true, encode: false, arrayFormat: 'brackets' }
|
||||
),
|
||||
'a[].b.c[]=1',
|
||||
'brackets => brackets'
|
||||
);
|
||||
st.equal(
|
||||
qs.stringify(
|
||||
{ a: [{ b: { c: [1] } }] },
|
||||
{ allowDots: true, encode: false }
|
||||
),
|
||||
'a[0].b.c[0]=1',
|
||||
'default => indices'
|
||||
);
|
||||
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('does not omit object keys when indices = false', function (st) {
|
||||
st.equal(qs.stringify({ a: [{ b: 'c' }] }, { indices: false }), 'a%5Bb%5D=c');
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('uses indices notation for arrays when indices=true', function (st) {
|
||||
st.equal(qs.stringify({ a: ['b', 'c'] }, { indices: true }), 'a%5B0%5D=b&a%5B1%5D=c');
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('uses indices notation for arrays when no arrayFormat is specified', function (st) {
|
||||
st.equal(qs.stringify({ a: ['b', 'c'] }), 'a%5B0%5D=b&a%5B1%5D=c');
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('uses indices notation for arrays when no arrayFormat=indices', function (st) {
|
||||
st.equal(qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'indices' }), 'a%5B0%5D=b&a%5B1%5D=c');
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('uses repeat notation for arrays when no arrayFormat=repeat', function (st) {
|
||||
st.equal(qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'repeat' }), 'a=b&a=c');
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('uses brackets notation for arrays when no arrayFormat=brackets', function (st) {
|
||||
st.equal(qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'brackets' }), 'a%5B%5D=b&a%5B%5D=c');
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('stringifies a complicated object', function (st) {
|
||||
st.equal(qs.stringify({ a: { b: 'c', d: 'e' } }), 'a%5Bb%5D=c&a%5Bd%5D=e');
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('stringifies an empty value', function (st) {
|
||||
st.equal(qs.stringify({ a: '' }), 'a=');
|
||||
st.equal(qs.stringify({ a: null }, { strictNullHandling: true }), 'a');
|
||||
|
||||
st.equal(qs.stringify({ a: '', b: '' }), 'a=&b=');
|
||||
st.equal(qs.stringify({ a: null, b: '' }, { strictNullHandling: true }), 'a&b=');
|
||||
|
||||
st.equal(qs.stringify({ a: { b: '' } }), 'a%5Bb%5D=');
|
||||
st.equal(qs.stringify({ a: { b: null } }, { strictNullHandling: true }), 'a%5Bb%5D');
|
||||
st.equal(qs.stringify({ a: { b: null } }, { strictNullHandling: false }), 'a%5Bb%5D=');
|
||||
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('stringifies a null object', { skip: !Object.create }, function (st) {
|
||||
var obj = Object.create(null);
|
||||
obj.a = 'b';
|
||||
st.equal(qs.stringify(obj), 'a=b');
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('returns an empty string for invalid input', function (st) {
|
||||
st.equal(qs.stringify(undefined), '');
|
||||
st.equal(qs.stringify(false), '');
|
||||
st.equal(qs.stringify(null), '');
|
||||
st.equal(qs.stringify(''), '');
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('stringifies an object with a null object as a child', { skip: !Object.create }, function (st) {
|
||||
var obj = { a: Object.create(null) };
|
||||
|
||||
obj.a.b = 'c';
|
||||
st.equal(qs.stringify(obj), 'a%5Bb%5D=c');
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('drops keys with a value of undefined', function (st) {
|
||||
st.equal(qs.stringify({ a: undefined }), '');
|
||||
|
||||
st.equal(qs.stringify({ a: { b: undefined, c: null } }, { strictNullHandling: true }), 'a%5Bc%5D');
|
||||
st.equal(qs.stringify({ a: { b: undefined, c: null } }, { strictNullHandling: false }), 'a%5Bc%5D=');
|
||||
st.equal(qs.stringify({ a: { b: undefined, c: '' } }), 'a%5Bc%5D=');
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('url encodes values', function (st) {
|
||||
st.equal(qs.stringify({ a: 'b c' }), 'a=b%20c');
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('stringifies a date', function (st) {
|
||||
var now = new Date();
|
||||
var str = 'a=' + encodeURIComponent(now.toISOString());
|
||||
st.equal(qs.stringify({ a: now }), str);
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('stringifies the weird object from qs', function (st) {
|
||||
st.equal(qs.stringify({ 'my weird field': '~q1!2"\'w$5&7/z8)?' }), 'my%20weird%20field=~q1%212%22%27w%245%267%2Fz8%29%3F');
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('skips properties that are part of the object prototype', function (st) {
|
||||
Object.prototype.crash = 'test';
|
||||
st.equal(qs.stringify({ a: 'b' }), 'a=b');
|
||||
st.equal(qs.stringify({ a: { b: 'c' } }), 'a%5Bb%5D=c');
|
||||
delete Object.prototype.crash;
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('stringifies boolean values', function (st) {
|
||||
st.equal(qs.stringify({ a: true }), 'a=true');
|
||||
st.equal(qs.stringify({ a: { b: true } }), 'a%5Bb%5D=true');
|
||||
st.equal(qs.stringify({ b: false }), 'b=false');
|
||||
st.equal(qs.stringify({ b: { c: false } }), 'b%5Bc%5D=false');
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('stringifies buffer values', function (st) {
|
||||
st.equal(qs.stringify({ a: SaferBuffer.from('test') }), 'a=test');
|
||||
st.equal(qs.stringify({ a: { b: SaferBuffer.from('test') } }), 'a%5Bb%5D=test');
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('stringifies an object using an alternative delimiter', function (st) {
|
||||
st.equal(qs.stringify({ a: 'b', c: 'd' }, { delimiter: ';' }), 'a=b;c=d');
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('doesn\'t blow up when Buffer global is missing', function (st) {
|
||||
var tempBuffer = global.Buffer;
|
||||
delete global.Buffer;
|
||||
var result = qs.stringify({ a: 'b', c: 'd' });
|
||||
global.Buffer = tempBuffer;
|
||||
st.equal(result, 'a=b&c=d');
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('selects properties when filter=array', function (st) {
|
||||
st.equal(qs.stringify({ a: 'b' }, { filter: ['a'] }), 'a=b');
|
||||
st.equal(qs.stringify({ a: 1 }, { filter: [] }), '');
|
||||
|
||||
st.equal(
|
||||
qs.stringify(
|
||||
{ a: { b: [1, 2, 3, 4], c: 'd' }, c: 'f' },
|
||||
{ filter: ['a', 'b', 0, 2], arrayFormat: 'indices' }
|
||||
),
|
||||
'a%5Bb%5D%5B0%5D=1&a%5Bb%5D%5B2%5D=3',
|
||||
'indices => indices'
|
||||
);
|
||||
st.equal(
|
||||
qs.stringify(
|
||||
{ a: { b: [1, 2, 3, 4], c: 'd' }, c: 'f' },
|
||||
{ filter: ['a', 'b', 0, 2], arrayFormat: 'brackets' }
|
||||
),
|
||||
'a%5Bb%5D%5B%5D=1&a%5Bb%5D%5B%5D=3',
|
||||
'brackets => brackets'
|
||||
);
|
||||
st.equal(
|
||||
qs.stringify(
|
||||
{ a: { b: [1, 2, 3, 4], c: 'd' }, c: 'f' },
|
||||
{ filter: ['a', 'b', 0, 2] }
|
||||
),
|
||||
'a%5Bb%5D%5B0%5D=1&a%5Bb%5D%5B2%5D=3',
|
||||
'default => indices'
|
||||
);
|
||||
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('supports custom representations when filter=function', function (st) {
|
||||
var calls = 0;
|
||||
var obj = { a: 'b', c: 'd', e: { f: new Date(1257894000000) } };
|
||||
var filterFunc = function (prefix, value) {
|
||||
calls += 1;
|
||||
if (calls === 1) {
|
||||
st.equal(prefix, '', 'prefix is empty');
|
||||
st.equal(value, obj);
|
||||
} else if (prefix === 'c') {
|
||||
return void 0;
|
||||
} else if (value instanceof Date) {
|
||||
st.equal(prefix, 'e[f]');
|
||||
return value.getTime();
|
||||
}
|
||||
return value;
|
||||
};
|
||||
|
||||
st.equal(qs.stringify(obj, { filter: filterFunc }), 'a=b&e%5Bf%5D=1257894000000');
|
||||
st.equal(calls, 5);
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('can disable uri encoding', function (st) {
|
||||
st.equal(qs.stringify({ a: 'b' }, { encode: false }), 'a=b');
|
||||
st.equal(qs.stringify({ a: { b: 'c' } }, { encode: false }), 'a[b]=c');
|
||||
st.equal(qs.stringify({ a: 'b', c: null }, { strictNullHandling: true, encode: false }), 'a=b&c');
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('can sort the keys', function (st) {
|
||||
var sort = function (a, b) {
|
||||
return a.localeCompare(b);
|
||||
};
|
||||
st.equal(qs.stringify({ a: 'c', z: 'y', b: 'f' }, { sort: sort }), 'a=c&b=f&z=y');
|
||||
st.equal(qs.stringify({ a: 'c', z: { j: 'a', i: 'b' }, b: 'f' }, { sort: sort }), 'a=c&b=f&z%5Bi%5D=b&z%5Bj%5D=a');
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('can sort the keys at depth 3 or more too', function (st) {
|
||||
var sort = function (a, b) {
|
||||
return a.localeCompare(b);
|
||||
};
|
||||
st.equal(
|
||||
qs.stringify(
|
||||
{ a: 'a', z: { zj: { zjb: 'zjb', zja: 'zja' }, zi: { zib: 'zib', zia: 'zia' } }, b: 'b' },
|
||||
{ sort: sort, encode: false }
|
||||
),
|
||||
'a=a&b=b&z[zi][zia]=zia&z[zi][zib]=zib&z[zj][zja]=zja&z[zj][zjb]=zjb'
|
||||
);
|
||||
st.equal(
|
||||
qs.stringify(
|
||||
{ a: 'a', z: { zj: { zjb: 'zjb', zja: 'zja' }, zi: { zib: 'zib', zia: 'zia' } }, b: 'b' },
|
||||
{ sort: null, encode: false }
|
||||
),
|
||||
'a=a&z[zj][zjb]=zjb&z[zj][zja]=zja&z[zi][zib]=zib&z[zi][zia]=zia&b=b'
|
||||
);
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('can stringify with custom encoding', function (st) {
|
||||
st.equal(qs.stringify({ 県: '大阪府', '': '' }, {
|
||||
encoder: function (str) {
|
||||
if (str.length === 0) {
|
||||
return '';
|
||||
}
|
||||
var buf = iconv.encode(str, 'shiftjis');
|
||||
var result = [];
|
||||
for (var i = 0; i < buf.length; ++i) {
|
||||
result.push(buf.readUInt8(i).toString(16));
|
||||
}
|
||||
return '%' + result.join('%');
|
||||
}
|
||||
}), '%8c%a7=%91%e5%8d%e3%95%7b&=');
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('receives the default encoder as a second argument', function (st) {
|
||||
st.plan(2);
|
||||
qs.stringify({ a: 1 }, {
|
||||
encoder: function (str, defaultEncoder) {
|
||||
st.equal(defaultEncoder, utils.encode);
|
||||
}
|
||||
});
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('throws error with wrong encoder', function (st) {
|
||||
st['throws'](function () {
|
||||
qs.stringify({}, { encoder: 'string' });
|
||||
}, new TypeError('Encoder has to be a function.'));
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('can use custom encoder for a buffer object', { skip: typeof Buffer === 'undefined' }, function (st) {
|
||||
st.equal(qs.stringify({ a: SaferBuffer.from([1]) }, {
|
||||
encoder: function (buffer) {
|
||||
if (typeof buffer === 'string') {
|
||||
return buffer;
|
||||
}
|
||||
return String.fromCharCode(buffer.readUInt8(0) + 97);
|
||||
}
|
||||
}), 'a=b');
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('serializeDate option', function (st) {
|
||||
var date = new Date();
|
||||
st.equal(
|
||||
qs.stringify({ a: date }),
|
||||
'a=' + date.toISOString().replace(/:/g, '%3A'),
|
||||
'default is toISOString'
|
||||
);
|
||||
|
||||
var mutatedDate = new Date();
|
||||
mutatedDate.toISOString = function () {
|
||||
throw new SyntaxError();
|
||||
};
|
||||
st['throws'](function () {
|
||||
mutatedDate.toISOString();
|
||||
}, SyntaxError);
|
||||
st.equal(
|
||||
qs.stringify({ a: mutatedDate }),
|
||||
'a=' + Date.prototype.toISOString.call(mutatedDate).replace(/:/g, '%3A'),
|
||||
'toISOString works even when method is not locally present'
|
||||
);
|
||||
|
||||
var specificDate = new Date(6);
|
||||
st.equal(
|
||||
qs.stringify(
|
||||
{ a: specificDate },
|
||||
{ serializeDate: function (d) { return d.getTime() * 7; } }
|
||||
),
|
||||
'a=42',
|
||||
'custom serializeDate function called'
|
||||
);
|
||||
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('RFC 1738 spaces serialization', function (st) {
|
||||
st.equal(qs.stringify({ a: 'b c' }, { format: qs.formats.RFC1738 }), 'a=b+c');
|
||||
st.equal(qs.stringify({ 'a b': 'c d' }, { format: qs.formats.RFC1738 }), 'a+b=c+d');
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('RFC 3986 spaces serialization', function (st) {
|
||||
st.equal(qs.stringify({ a: 'b c' }, { format: qs.formats.RFC3986 }), 'a=b%20c');
|
||||
st.equal(qs.stringify({ 'a b': 'c d' }, { format: qs.formats.RFC3986 }), 'a%20b=c%20d');
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('Backward compatibility to RFC 3986', function (st) {
|
||||
st.equal(qs.stringify({ a: 'b c' }), 'a=b%20c');
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('Edge cases and unknown formats', function (st) {
|
||||
['UFO1234', false, 1234, null, {}, []].forEach(
|
||||
function (format) {
|
||||
st['throws'](
|
||||
function () {
|
||||
qs.stringify({ a: 'b c' }, { format: format });
|
||||
},
|
||||
new TypeError('Unknown format option provided.')
|
||||
);
|
||||
}
|
||||
);
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('encodeValuesOnly', function (st) {
|
||||
st.equal(
|
||||
qs.stringify(
|
||||
{ a: 'b', c: ['d', 'e=f'], f: [['g'], ['h']] },
|
||||
{ encodeValuesOnly: true }
|
||||
),
|
||||
'a=b&c[0]=d&c[1]=e%3Df&f[0][0]=g&f[1][0]=h'
|
||||
);
|
||||
st.equal(
|
||||
qs.stringify(
|
||||
{ a: 'b', c: ['d', 'e'], f: [['g'], ['h']] }
|
||||
),
|
||||
'a=b&c%5B0%5D=d&c%5B1%5D=e&f%5B0%5D%5B0%5D=g&f%5B1%5D%5B0%5D=h'
|
||||
);
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('encodeValuesOnly - strictNullHandling', function (st) {
|
||||
st.equal(
|
||||
qs.stringify(
|
||||
{ a: { b: null } },
|
||||
{ encodeValuesOnly: true, strictNullHandling: true }
|
||||
),
|
||||
'a[b]'
|
||||
);
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('does not mutate the options argument', function (st) {
|
||||
var options = {};
|
||||
qs.stringify({}, options);
|
||||
st.deepEqual(options, {});
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.end();
|
||||
});
|
||||
34
node_modules/body-parser/node_modules/qs/test/utils.js
generated
vendored
Normal file
34
node_modules/body-parser/node_modules/qs/test/utils.js
generated
vendored
Normal file
@ -0,0 +1,34 @@
|
||||
'use strict';
|
||||
|
||||
var test = require('tape');
|
||||
var utils = require('../lib/utils');
|
||||
|
||||
test('merge()', function (t) {
|
||||
t.deepEqual(utils.merge({ a: 'b' }, { a: 'c' }), { a: ['b', 'c'] }, 'merges two objects with the same key');
|
||||
|
||||
var oneMerged = utils.merge({ foo: 'bar' }, { foo: { first: '123' } });
|
||||
t.deepEqual(oneMerged, { foo: ['bar', { first: '123' }] }, 'merges a standalone and an object into an array');
|
||||
|
||||
var twoMerged = utils.merge({ foo: ['bar', { first: '123' }] }, { foo: { second: '456' } });
|
||||
t.deepEqual(twoMerged, { foo: { 0: 'bar', 1: { first: '123' }, second: '456' } }, 'merges a standalone and two objects into an array');
|
||||
|
||||
var sandwiched = utils.merge({ foo: ['bar', { first: '123', second: '456' }] }, { foo: 'baz' });
|
||||
t.deepEqual(sandwiched, { foo: ['bar', { first: '123', second: '456' }, 'baz'] }, 'merges an object sandwiched by two standalones into an array');
|
||||
|
||||
var nestedArrays = utils.merge({ foo: ['baz'] }, { foo: ['bar', 'xyzzy'] });
|
||||
t.deepEqual(nestedArrays, { foo: ['baz', 'bar', 'xyzzy'] });
|
||||
|
||||
t.end();
|
||||
});
|
||||
|
||||
test('assign()', function (t) {
|
||||
var target = { a: 1, b: 2 };
|
||||
var source = { b: 3, c: 4 };
|
||||
var result = utils.assign(target, source);
|
||||
|
||||
t.equal(result, target, 'returns the target');
|
||||
t.deepEqual(target, { a: 1, b: 3, c: 4 }, 'target and source are merged');
|
||||
t.deepEqual(source, { b: 3, c: 4 }, 'source is untouched');
|
||||
|
||||
t.end();
|
||||
});
|
||||
65
node_modules/body-parser/node_modules/statuses/HISTORY.md
generated
vendored
Normal file
65
node_modules/body-parser/node_modules/statuses/HISTORY.md
generated
vendored
Normal file
@ -0,0 +1,65 @@
|
||||
1.5.0 / 2018-03-27
|
||||
==================
|
||||
|
||||
* Add `103 Early Hints`
|
||||
|
||||
1.4.0 / 2017-10-20
|
||||
==================
|
||||
|
||||
* Add `STATUS_CODES` export
|
||||
|
||||
1.3.1 / 2016-11-11
|
||||
==================
|
||||
|
||||
* Fix return type in JSDoc
|
||||
|
||||
1.3.0 / 2016-05-17
|
||||
==================
|
||||
|
||||
* Add `421 Misdirected Request`
|
||||
* perf: enable strict mode
|
||||
|
||||
1.2.1 / 2015-02-01
|
||||
==================
|
||||
|
||||
* Fix message for status 451
|
||||
- `451 Unavailable For Legal Reasons`
|
||||
|
||||
1.2.0 / 2014-09-28
|
||||
==================
|
||||
|
||||
* Add `208 Already Repored`
|
||||
* Add `226 IM Used`
|
||||
* Add `306 (Unused)`
|
||||
* Add `415 Unable For Legal Reasons`
|
||||
* Add `508 Loop Detected`
|
||||
|
||||
1.1.1 / 2014-09-24
|
||||
==================
|
||||
|
||||
* Add missing 308 to `codes.json`
|
||||
|
||||
1.1.0 / 2014-09-21
|
||||
==================
|
||||
|
||||
* Add `codes.json` for universal support
|
||||
|
||||
1.0.4 / 2014-08-20
|
||||
==================
|
||||
|
||||
* Package cleanup
|
||||
|
||||
1.0.3 / 2014-06-08
|
||||
==================
|
||||
|
||||
* Add 308 to `.redirect` category
|
||||
|
||||
1.0.2 / 2014-03-13
|
||||
==================
|
||||
|
||||
* Add `.retry` category
|
||||
|
||||
1.0.1 / 2014-03-12
|
||||
==================
|
||||
|
||||
* Initial release
|
||||
23
node_modules/body-parser/node_modules/statuses/LICENSE
generated
vendored
Normal file
23
node_modules/body-parser/node_modules/statuses/LICENSE
generated
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014 Jonathan Ong <me@jongleberry.com>
|
||||
Copyright (c) 2016 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.
|
||||
127
node_modules/body-parser/node_modules/statuses/README.md
generated
vendored
Normal file
127
node_modules/body-parser/node_modules/statuses/README.md
generated
vendored
Normal file
@ -0,0 +1,127 @@
|
||||
# Statuses
|
||||
|
||||
[![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]
|
||||
|
||||
HTTP status utility for node.
|
||||
|
||||
This module provides a list of status codes and messages sourced from
|
||||
a few different projects:
|
||||
|
||||
* The [IANA Status Code Registry](https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml)
|
||||
* The [Node.js project](https://nodejs.org/)
|
||||
* The [NGINX project](https://www.nginx.com/)
|
||||
* The [Apache HTTP Server project](https://httpd.apache.org/)
|
||||
|
||||
## Installation
|
||||
|
||||
This is a [Node.js](https://nodejs.org/en/) module available through the
|
||||
[npm registry](https://www.npmjs.com/). Installation is done using the
|
||||
[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):
|
||||
|
||||
```sh
|
||||
$ npm install statuses
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
<!-- eslint-disable no-unused-vars -->
|
||||
|
||||
```js
|
||||
var status = require('statuses')
|
||||
```
|
||||
|
||||
### var code = status(Integer || String)
|
||||
|
||||
If `Integer` or `String` is a valid HTTP code or status message, then the
|
||||
appropriate `code` will be returned. Otherwise, an error will be thrown.
|
||||
|
||||
<!-- eslint-disable no-undef -->
|
||||
|
||||
```js
|
||||
status(403) // => 403
|
||||
status('403') // => 403
|
||||
status('forbidden') // => 403
|
||||
status('Forbidden') // => 403
|
||||
status(306) // throws, as it's not supported by node.js
|
||||
```
|
||||
|
||||
### status.STATUS_CODES
|
||||
|
||||
Returns an object which maps status codes to status messages, in
|
||||
the same format as the
|
||||
[Node.js http module](https://nodejs.org/dist/latest/docs/api/http.html#http_http_status_codes).
|
||||
|
||||
### status.codes
|
||||
|
||||
Returns an array of all the status codes as `Integer`s.
|
||||
|
||||
### var msg = status[code]
|
||||
|
||||
Map of `code` to `status message`. `undefined` for invalid `code`s.
|
||||
|
||||
<!-- eslint-disable no-undef, no-unused-expressions -->
|
||||
|
||||
```js
|
||||
status[404] // => 'Not Found'
|
||||
```
|
||||
|
||||
### var code = status[msg]
|
||||
|
||||
Map of `status message` to `code`. `msg` can either be title-cased or
|
||||
lower-cased. `undefined` for invalid `status message`s.
|
||||
|
||||
<!-- eslint-disable no-undef, no-unused-expressions -->
|
||||
|
||||
```js
|
||||
status['not found'] // => 404
|
||||
status['Not Found'] // => 404
|
||||
```
|
||||
|
||||
### status.redirect[code]
|
||||
|
||||
Returns `true` if a status code is a valid redirect status.
|
||||
|
||||
<!-- eslint-disable no-undef, no-unused-expressions -->
|
||||
|
||||
```js
|
||||
status.redirect[200] // => undefined
|
||||
status.redirect[301] // => true
|
||||
```
|
||||
|
||||
### status.empty[code]
|
||||
|
||||
Returns `true` if a status code expects an empty body.
|
||||
|
||||
<!-- eslint-disable no-undef, no-unused-expressions -->
|
||||
|
||||
```js
|
||||
status.empty[200] // => undefined
|
||||
status.empty[204] // => true
|
||||
status.empty[304] // => true
|
||||
```
|
||||
|
||||
### status.retry[code]
|
||||
|
||||
Returns `true` if you should retry the rest.
|
||||
|
||||
<!-- eslint-disable no-undef, no-unused-expressions -->
|
||||
|
||||
```js
|
||||
status.retry[501] // => undefined
|
||||
status.retry[503] // => true
|
||||
```
|
||||
|
||||
[npm-image]: https://img.shields.io/npm/v/statuses.svg
|
||||
[npm-url]: https://npmjs.org/package/statuses
|
||||
[node-version-image]: https://img.shields.io/node/v/statuses.svg
|
||||
[node-version-url]: https://nodejs.org/en/download
|
||||
[travis-image]: https://img.shields.io/travis/jshttp/statuses.svg
|
||||
[travis-url]: https://travis-ci.org/jshttp/statuses
|
||||
[coveralls-image]: https://img.shields.io/coveralls/jshttp/statuses.svg
|
||||
[coveralls-url]: https://coveralls.io/r/jshttp/statuses?branch=master
|
||||
[downloads-image]: https://img.shields.io/npm/dm/statuses.svg
|
||||
[downloads-url]: https://npmjs.org/package/statuses
|
||||
66
node_modules/body-parser/node_modules/statuses/codes.json
generated
vendored
Normal file
66
node_modules/body-parser/node_modules/statuses/codes.json
generated
vendored
Normal file
@ -0,0 +1,66 @@
|
||||
{
|
||||
"100": "Continue",
|
||||
"101": "Switching Protocols",
|
||||
"102": "Processing",
|
||||
"103": "Early Hints",
|
||||
"200": "OK",
|
||||
"201": "Created",
|
||||
"202": "Accepted",
|
||||
"203": "Non-Authoritative Information",
|
||||
"204": "No Content",
|
||||
"205": "Reset Content",
|
||||
"206": "Partial Content",
|
||||
"207": "Multi-Status",
|
||||
"208": "Already Reported",
|
||||
"226": "IM Used",
|
||||
"300": "Multiple Choices",
|
||||
"301": "Moved Permanently",
|
||||
"302": "Found",
|
||||
"303": "See Other",
|
||||
"304": "Not Modified",
|
||||
"305": "Use Proxy",
|
||||
"306": "(Unused)",
|
||||
"307": "Temporary Redirect",
|
||||
"308": "Permanent Redirect",
|
||||
"400": "Bad Request",
|
||||
"401": "Unauthorized",
|
||||
"402": "Payment Required",
|
||||
"403": "Forbidden",
|
||||
"404": "Not Found",
|
||||
"405": "Method Not Allowed",
|
||||
"406": "Not Acceptable",
|
||||
"407": "Proxy Authentication Required",
|
||||
"408": "Request Timeout",
|
||||
"409": "Conflict",
|
||||
"410": "Gone",
|
||||
"411": "Length Required",
|
||||
"412": "Precondition Failed",
|
||||
"413": "Payload Too Large",
|
||||
"414": "URI Too Long",
|
||||
"415": "Unsupported Media Type",
|
||||
"416": "Range Not Satisfiable",
|
||||
"417": "Expectation Failed",
|
||||
"418": "I'm a teapot",
|
||||
"421": "Misdirected Request",
|
||||
"422": "Unprocessable Entity",
|
||||
"423": "Locked",
|
||||
"424": "Failed Dependency",
|
||||
"425": "Unordered Collection",
|
||||
"426": "Upgrade Required",
|
||||
"428": "Precondition Required",
|
||||
"429": "Too Many Requests",
|
||||
"431": "Request Header Fields Too Large",
|
||||
"451": "Unavailable For Legal Reasons",
|
||||
"500": "Internal Server Error",
|
||||
"501": "Not Implemented",
|
||||
"502": "Bad Gateway",
|
||||
"503": "Service Unavailable",
|
||||
"504": "Gateway Timeout",
|
||||
"505": "HTTP Version Not Supported",
|
||||
"506": "Variant Also Negotiates",
|
||||
"507": "Insufficient Storage",
|
||||
"508": "Loop Detected",
|
||||
"509": "Bandwidth Limit Exceeded",
|
||||
"510": "Not Extended",
|
||||
"511": "Network Authentication Required"
|
||||
}
|
||||
113
node_modules/body-parser/node_modules/statuses/index.js
generated
vendored
Normal file
113
node_modules/body-parser/node_modules/statuses/index.js
generated
vendored
Normal file
@ -0,0 +1,113 @@
|
||||
/*!
|
||||
* statuses
|
||||
* Copyright(c) 2014 Jonathan Ong
|
||||
* Copyright(c) 2016 Douglas Christopher Wilson
|
||||
* MIT Licensed
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
/**
|
||||
* Module dependencies.
|
||||
* @private
|
||||
*/
|
||||
|
||||
var codes = require('./codes.json')
|
||||
|
||||
/**
|
||||
* Module exports.
|
||||
* @public
|
||||
*/
|
||||
|
||||
module.exports = status
|
||||
|
||||
// status code to message map
|
||||
status.STATUS_CODES = codes
|
||||
|
||||
// array of status codes
|
||||
status.codes = populateStatusesMap(status, codes)
|
||||
|
||||
// status codes for redirects
|
||||
status.redirect = {
|
||||
300: true,
|
||||
301: true,
|
||||
302: true,
|
||||
303: true,
|
||||
305: true,
|
||||
307: true,
|
||||
308: true
|
||||
}
|
||||
|
||||
// status codes for empty bodies
|
||||
status.empty = {
|
||||
204: true,
|
||||
205: true,
|
||||
304: true
|
||||
}
|
||||
|
||||
// status codes for when you should retry the request
|
||||
status.retry = {
|
||||
502: true,
|
||||
503: true,
|
||||
504: true
|
||||
}
|
||||
|
||||
/**
|
||||
* Populate the statuses map for given codes.
|
||||
* @private
|
||||
*/
|
||||
|
||||
function populateStatusesMap (statuses, codes) {
|
||||
var arr = []
|
||||
|
||||
Object.keys(codes).forEach(function forEachCode (code) {
|
||||
var message = codes[code]
|
||||
var status = Number(code)
|
||||
|
||||
// Populate properties
|
||||
statuses[status] = message
|
||||
statuses[message] = status
|
||||
statuses[message.toLowerCase()] = status
|
||||
|
||||
// Add to array
|
||||
arr.push(status)
|
||||
})
|
||||
|
||||
return arr
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the status code.
|
||||
*
|
||||
* Given a number, this will throw if it is not a known status
|
||||
* code, otherwise the code will be returned. Given a string,
|
||||
* the string will be parsed for a number and return the code
|
||||
* if valid, otherwise will lookup the code assuming this is
|
||||
* the status message.
|
||||
*
|
||||
* @param {string|number} code
|
||||
* @returns {number}
|
||||
* @public
|
||||
*/
|
||||
|
||||
function status (code) {
|
||||
if (typeof code === 'number') {
|
||||
if (!status[code]) throw new Error('invalid status code: ' + code)
|
||||
return code
|
||||
}
|
||||
|
||||
if (typeof code !== 'string') {
|
||||
throw new TypeError('code must be a number or string')
|
||||
}
|
||||
|
||||
// '403'
|
||||
var n = parseInt(code, 10)
|
||||
if (!isNaN(n)) {
|
||||
if (!status[n]) throw new Error('invalid status code: ' + n)
|
||||
return n
|
||||
}
|
||||
|
||||
n = status[code.toLowerCase()]
|
||||
if (!n) throw new Error('invalid status message: "' + code + '"')
|
||||
return n
|
||||
}
|
||||
87
node_modules/body-parser/node_modules/statuses/package.json
generated
vendored
Normal file
87
node_modules/body-parser/node_modules/statuses/package.json
generated
vendored
Normal file
@ -0,0 +1,87 @@
|
||||
{
|
||||
"_from": "statuses@>= 1.4.0 < 2",
|
||||
"_id": "statuses@1.5.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=",
|
||||
"_location": "/body-parser/statuses",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "statuses@>= 1.4.0 < 2",
|
||||
"name": "statuses",
|
||||
"escapedName": "statuses",
|
||||
"rawSpec": ">= 1.4.0 < 2",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": ">= 1.4.0 < 2"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/body-parser/http-errors"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz",
|
||||
"_shasum": "161c7dac177659fd9811f43771fa99381478628c",
|
||||
"_spec": "statuses@>= 1.4.0 < 2",
|
||||
"_where": "C:\\Users\\jonio\\Documents\\Programmieren\\Miniportal\\Neu\\MiniportalAPI\\node_modules\\body-parser\\node_modules\\http-errors",
|
||||
"bugs": {
|
||||
"url": "https://github.com/jshttp/statuses/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Douglas Christopher Wilson",
|
||||
"email": "doug@somethingdoug.com"
|
||||
},
|
||||
{
|
||||
"name": "Jonathan Ong",
|
||||
"email": "me@jongleberry.com",
|
||||
"url": "http://jongleberry.com"
|
||||
}
|
||||
],
|
||||
"deprecated": false,
|
||||
"description": "HTTP status utility",
|
||||
"devDependencies": {
|
||||
"csv-parse": "1.2.4",
|
||||
"eslint": "4.19.1",
|
||||
"eslint-config-standard": "11.0.0",
|
||||
"eslint-plugin-import": "2.9.0",
|
||||
"eslint-plugin-markdown": "1.0.0-beta.6",
|
||||
"eslint-plugin-node": "6.0.1",
|
||||
"eslint-plugin-promise": "3.7.0",
|
||||
"eslint-plugin-standard": "3.0.1",
|
||||
"istanbul": "0.4.5",
|
||||
"mocha": "1.21.5",
|
||||
"raw-body": "2.3.2",
|
||||
"stream-to-array": "2.3.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
},
|
||||
"files": [
|
||||
"HISTORY.md",
|
||||
"index.js",
|
||||
"codes.json",
|
||||
"LICENSE"
|
||||
],
|
||||
"homepage": "https://github.com/jshttp/statuses#readme",
|
||||
"keywords": [
|
||||
"http",
|
||||
"status",
|
||||
"code"
|
||||
],
|
||||
"license": "MIT",
|
||||
"name": "statuses",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/jshttp/statuses.git"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "node scripts/build.js",
|
||||
"fetch": "node scripts/fetch-apache.js && node scripts/fetch-iana.js && node scripts/fetch-nginx.js && node scripts/fetch-node.js",
|
||||
"lint": "eslint --plugin markdown --ext js,md .",
|
||||
"test": "mocha --reporter spec --check-leaks --bail test/",
|
||||
"test-ci": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/",
|
||||
"test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/",
|
||||
"update": "npm run fetch && npm run build"
|
||||
},
|
||||
"version": "1.5.0"
|
||||
}
|
||||
236
node_modules/body-parser/node_modules/type-is/HISTORY.md
generated
vendored
Normal file
236
node_modules/body-parser/node_modules/type-is/HISTORY.md
generated
vendored
Normal file
@ -0,0 +1,236 @@
|
||||
1.6.16 / 2018-02-16
|
||||
===================
|
||||
|
||||
* deps: mime-types@~2.1.18
|
||||
- Add `application/raml+yaml` with extension `.raml`
|
||||
- Add `application/wasm` with extension `.wasm`
|
||||
- Add `text/shex` with extension `.shex`
|
||||
- Add extensions for JPEG-2000 images
|
||||
- Add extensions from IANA for `message/*` types
|
||||
- Add extension `.mjs` to `application/javascript`
|
||||
- Add extension `.wadl` to `application/vnd.sun.wadl+xml`
|
||||
- Add extension `.gz` to `application/gzip`
|
||||
- Add glTF types and extensions
|
||||
- Add new mime types
|
||||
- Update extensions `.md` and `.markdown` to be `text/markdown`
|
||||
- Update font MIME types
|
||||
- Update `text/hjson` to registered `application/hjson`
|
||||
|
||||
1.6.15 / 2017-03-31
|
||||
===================
|
||||
|
||||
* deps: mime-types@~2.1.15
|
||||
- Add new mime types
|
||||
|
||||
1.6.14 / 2016-11-18
|
||||
===================
|
||||
|
||||
* deps: mime-types@~2.1.13
|
||||
- Add new mime types
|
||||
|
||||
1.6.13 / 2016-05-18
|
||||
===================
|
||||
|
||||
* deps: mime-types@~2.1.11
|
||||
- Add new mime types
|
||||
|
||||
1.6.12 / 2016-02-28
|
||||
===================
|
||||
|
||||
* deps: mime-types@~2.1.10
|
||||
- Add new mime types
|
||||
- Fix extension of `application/dash+xml`
|
||||
- Update primary extension for `audio/mp4`
|
||||
|
||||
1.6.11 / 2016-01-29
|
||||
===================
|
||||
|
||||
* deps: mime-types@~2.1.9
|
||||
- Add new mime types
|
||||
|
||||
1.6.10 / 2015-12-01
|
||||
===================
|
||||
|
||||
* deps: mime-types@~2.1.8
|
||||
- Add new mime types
|
||||
|
||||
1.6.9 / 2015-09-27
|
||||
==================
|
||||
|
||||
* deps: mime-types@~2.1.7
|
||||
- Add new mime types
|
||||
|
||||
1.6.8 / 2015-09-04
|
||||
==================
|
||||
|
||||
* deps: mime-types@~2.1.6
|
||||
- Add new mime types
|
||||
|
||||
1.6.7 / 2015-08-20
|
||||
==================
|
||||
|
||||
* Fix type error when given invalid type to match against
|
||||
* deps: mime-types@~2.1.5
|
||||
- Add new mime types
|
||||
|
||||
1.6.6 / 2015-07-31
|
||||
==================
|
||||
|
||||
* deps: mime-types@~2.1.4
|
||||
- Add new mime types
|
||||
|
||||
1.6.5 / 2015-07-16
|
||||
==================
|
||||
|
||||
* deps: mime-types@~2.1.3
|
||||
- Add new mime types
|
||||
|
||||
1.6.4 / 2015-07-01
|
||||
==================
|
||||
|
||||
* deps: mime-types@~2.1.2
|
||||
- Add new mime types
|
||||
* perf: enable strict mode
|
||||
* perf: remove argument reassignment
|
||||
|
||||
1.6.3 / 2015-06-08
|
||||
==================
|
||||
|
||||
* deps: mime-types@~2.1.1
|
||||
- Add new mime types
|
||||
* perf: reduce try block size
|
||||
* perf: remove bitwise operations
|
||||
|
||||
1.6.2 / 2015-05-10
|
||||
==================
|
||||
|
||||
* deps: mime-types@~2.0.11
|
||||
- Add new mime types
|
||||
|
||||
1.6.1 / 2015-03-13
|
||||
==================
|
||||
|
||||
* deps: mime-types@~2.0.10
|
||||
- Add new mime types
|
||||
|
||||
1.6.0 / 2015-02-12
|
||||
==================
|
||||
|
||||
* fix false-positives in `hasBody` `Transfer-Encoding` check
|
||||
* support wildcard for both type and subtype (`*/*`)
|
||||
|
||||
1.5.7 / 2015-02-09
|
||||
==================
|
||||
|
||||
* fix argument reassignment
|
||||
* deps: mime-types@~2.0.9
|
||||
- Add new mime types
|
||||
|
||||
1.5.6 / 2015-01-29
|
||||
==================
|
||||
|
||||
* deps: mime-types@~2.0.8
|
||||
- Add new mime types
|
||||
|
||||
1.5.5 / 2014-12-30
|
||||
==================
|
||||
|
||||
* deps: mime-types@~2.0.7
|
||||
- Add new mime types
|
||||
- Fix missing extensions
|
||||
- Fix various invalid MIME type entries
|
||||
- Remove example template MIME types
|
||||
- deps: mime-db@~1.5.0
|
||||
|
||||
1.5.4 / 2014-12-10
|
||||
==================
|
||||
|
||||
* deps: mime-types@~2.0.4
|
||||
- Add new mime types
|
||||
- deps: mime-db@~1.3.0
|
||||
|
||||
1.5.3 / 2014-11-09
|
||||
==================
|
||||
|
||||
* deps: mime-types@~2.0.3
|
||||
- Add new mime types
|
||||
- deps: mime-db@~1.2.0
|
||||
|
||||
1.5.2 / 2014-09-28
|
||||
==================
|
||||
|
||||
* deps: mime-types@~2.0.2
|
||||
- Add new mime types
|
||||
- deps: mime-db@~1.1.0
|
||||
|
||||
1.5.1 / 2014-09-07
|
||||
==================
|
||||
|
||||
* Support Node.js 0.6
|
||||
* deps: media-typer@0.3.0
|
||||
* deps: mime-types@~2.0.1
|
||||
- Support Node.js 0.6
|
||||
|
||||
1.5.0 / 2014-09-05
|
||||
==================
|
||||
|
||||
* fix `hasbody` to be true for `content-length: 0`
|
||||
|
||||
1.4.0 / 2014-09-02
|
||||
==================
|
||||
|
||||
* update mime-types
|
||||
|
||||
1.3.2 / 2014-06-24
|
||||
==================
|
||||
|
||||
* use `~` range on mime-types
|
||||
|
||||
1.3.1 / 2014-06-19
|
||||
==================
|
||||
|
||||
* fix global variable leak
|
||||
|
||||
1.3.0 / 2014-06-19
|
||||
==================
|
||||
|
||||
* improve type parsing
|
||||
|
||||
- invalid media type never matches
|
||||
- media type not case-sensitive
|
||||
- extra LWS does not affect results
|
||||
|
||||
1.2.2 / 2014-06-19
|
||||
==================
|
||||
|
||||
* fix behavior on unknown type argument
|
||||
|
||||
1.2.1 / 2014-06-03
|
||||
==================
|
||||
|
||||
* switch dependency from `mime` to `mime-types@1.0.0`
|
||||
|
||||
1.2.0 / 2014-05-11
|
||||
==================
|
||||
|
||||
* support suffix matching:
|
||||
|
||||
- `+json` matches `application/vnd+json`
|
||||
- `*/vnd+json` matches `application/vnd+json`
|
||||
- `application/*+json` matches `application/vnd+json`
|
||||
|
||||
1.1.0 / 2014-04-12
|
||||
==================
|
||||
|
||||
* add non-array values support
|
||||
* expose internal utilities:
|
||||
|
||||
- `.is()`
|
||||
- `.hasBody()`
|
||||
- `.normalize()`
|
||||
- `.match()`
|
||||
|
||||
1.0.1 / 2014-03-30
|
||||
==================
|
||||
|
||||
* add `multipart` as a shorthand
|
||||
23
node_modules/body-parser/node_modules/type-is/LICENSE
generated
vendored
Normal file
23
node_modules/body-parser/node_modules/type-is/LICENSE
generated
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
(The MIT License)
|
||||
|
||||
Copyright (c) 2014 Jonathan Ong <me@jongleberry.com>
|
||||
Copyright (c) 2014-2015 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.
|
||||
146
node_modules/body-parser/node_modules/type-is/README.md
generated
vendored
Normal file
146
node_modules/body-parser/node_modules/type-is/README.md
generated
vendored
Normal file
@ -0,0 +1,146 @@
|
||||
# type-is
|
||||
|
||||
[![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]
|
||||
|
||||
Infer the content-type of a request.
|
||||
|
||||
### Install
|
||||
|
||||
This is a [Node.js](https://nodejs.org/en/) module available through the
|
||||
[npm registry](https://www.npmjs.com/). Installation is done using the
|
||||
[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):
|
||||
|
||||
```sh
|
||||
$ npm install type-is
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
```js
|
||||
var http = require('http')
|
||||
var typeis = require('type-is')
|
||||
|
||||
http.createServer(function (req, res) {
|
||||
var istext = typeis(req, ['text/*'])
|
||||
res.end('you ' + (istext ? 'sent' : 'did not send') + ' me text')
|
||||
})
|
||||
```
|
||||
|
||||
### type = typeis(request, types)
|
||||
|
||||
`request` is the node HTTP request. `types` is an array of types.
|
||||
|
||||
<!-- eslint-disable no-undef -->
|
||||
|
||||
```js
|
||||
// req.headers.content-type = 'application/json'
|
||||
|
||||
typeis(req, ['json']) // 'json'
|
||||
typeis(req, ['html', 'json']) // 'json'
|
||||
typeis(req, ['application/*']) // 'application/json'
|
||||
typeis(req, ['application/json']) // 'application/json'
|
||||
|
||||
typeis(req, ['html']) // false
|
||||
```
|
||||
|
||||
### typeis.hasBody(request)
|
||||
|
||||
Returns a Boolean if the given `request` has a body, regardless of the
|
||||
`Content-Type` header.
|
||||
|
||||
Having a body has no relation to how large the body is (it may be 0 bytes).
|
||||
This is similar to how file existence works. If a body does exist, then this
|
||||
indicates that there is data to read from the Node.js request stream.
|
||||
|
||||
<!-- eslint-disable no-undef -->
|
||||
|
||||
```js
|
||||
if (typeis.hasBody(req)) {
|
||||
// read the body, since there is one
|
||||
|
||||
req.on('data', function (chunk) {
|
||||
// ...
|
||||
})
|
||||
}
|
||||
```
|
||||
|
||||
### type = typeis.is(mediaType, types)
|
||||
|
||||
`mediaType` is the [media type](https://tools.ietf.org/html/rfc6838) string. `types` is an array of types.
|
||||
|
||||
<!-- eslint-disable no-undef -->
|
||||
|
||||
```js
|
||||
var mediaType = 'application/json'
|
||||
|
||||
typeis.is(mediaType, ['json']) // 'json'
|
||||
typeis.is(mediaType, ['html', 'json']) // 'json'
|
||||
typeis.is(mediaType, ['application/*']) // 'application/json'
|
||||
typeis.is(mediaType, ['application/json']) // 'application/json'
|
||||
|
||||
typeis.is(mediaType, ['html']) // false
|
||||
```
|
||||
|
||||
### Each type can be:
|
||||
|
||||
- An extension name such as `json`. This name will be returned if matched.
|
||||
- A mime type such as `application/json`.
|
||||
- A mime type with a wildcard such as `*/*` or `*/json` or `application/*`. The full mime type will be returned if matched.
|
||||
- A suffix such as `+json`. This can be combined with a wildcard such as `*/vnd+json` or `application/*+json`. The full mime type will be returned if matched.
|
||||
|
||||
`false` will be returned if no type matches or the content type is invalid.
|
||||
|
||||
`null` will be returned if the request does not have a body.
|
||||
|
||||
## Examples
|
||||
|
||||
### Example body parser
|
||||
|
||||
```js
|
||||
var express = require('express')
|
||||
var typeis = require('type-is')
|
||||
|
||||
var app = express()
|
||||
|
||||
app.use(function bodyParser (req, res, next) {
|
||||
if (!typeis.hasBody(req)) {
|
||||
return next()
|
||||
}
|
||||
|
||||
switch (typeis(req, ['urlencoded', 'json', 'multipart'])) {
|
||||
case 'urlencoded':
|
||||
// parse urlencoded body
|
||||
throw new Error('implement urlencoded body parsing')
|
||||
case 'json':
|
||||
// parse json body
|
||||
throw new Error('implement json body parsing')
|
||||
case 'multipart':
|
||||
// parse multipart body
|
||||
throw new Error('implement multipart body parsing')
|
||||
default:
|
||||
// 415 error code
|
||||
res.statusCode = 415
|
||||
res.end()
|
||||
break
|
||||
}
|
||||
})
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
[MIT](LICENSE)
|
||||
|
||||
[npm-image]: https://img.shields.io/npm/v/type-is.svg
|
||||
[npm-url]: https://npmjs.org/package/type-is
|
||||
[node-version-image]: https://img.shields.io/node/v/type-is.svg
|
||||
[node-version-url]: https://nodejs.org/en/download/
|
||||
[travis-image]: https://img.shields.io/travis/jshttp/type-is/master.svg
|
||||
[travis-url]: https://travis-ci.org/jshttp/type-is
|
||||
[coveralls-image]: https://img.shields.io/coveralls/jshttp/type-is/master.svg
|
||||
[coveralls-url]: https://coveralls.io/r/jshttp/type-is?branch=master
|
||||
[downloads-image]: https://img.shields.io/npm/dm/type-is.svg
|
||||
[downloads-url]: https://npmjs.org/package/type-is
|
||||
262
node_modules/body-parser/node_modules/type-is/index.js
generated
vendored
Normal file
262
node_modules/body-parser/node_modules/type-is/index.js
generated
vendored
Normal file
@ -0,0 +1,262 @@
|
||||
/*!
|
||||
* type-is
|
||||
* Copyright(c) 2014 Jonathan Ong
|
||||
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
||||
* MIT Licensed
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
/**
|
||||
* Module dependencies.
|
||||
* @private
|
||||
*/
|
||||
|
||||
var typer = require('media-typer')
|
||||
var mime = require('mime-types')
|
||||
|
||||
/**
|
||||
* Module exports.
|
||||
* @public
|
||||
*/
|
||||
|
||||
module.exports = typeofrequest
|
||||
module.exports.is = typeis
|
||||
module.exports.hasBody = hasbody
|
||||
module.exports.normalize = normalize
|
||||
module.exports.match = mimeMatch
|
||||
|
||||
/**
|
||||
* Compare a `value` content-type with `types`.
|
||||
* Each `type` can be an extension like `html`,
|
||||
* a special shortcut like `multipart` or `urlencoded`,
|
||||
* or a mime type.
|
||||
*
|
||||
* If no types match, `false` is returned.
|
||||
* Otherwise, the first `type` that matches is returned.
|
||||
*
|
||||
* @param {String} value
|
||||
* @param {Array} types
|
||||
* @public
|
||||
*/
|
||||
|
||||
function typeis (value, types_) {
|
||||
var i
|
||||
var types = types_
|
||||
|
||||
// remove parameters and normalize
|
||||
var val = tryNormalizeType(value)
|
||||
|
||||
// no type or invalid
|
||||
if (!val) {
|
||||
return false
|
||||
}
|
||||
|
||||
// support flattened arguments
|
||||
if (types && !Array.isArray(types)) {
|
||||
types = new Array(arguments.length - 1)
|
||||
for (i = 0; i < types.length; i++) {
|
||||
types[i] = arguments[i + 1]
|
||||
}
|
||||
}
|
||||
|
||||
// no types, return the content type
|
||||
if (!types || !types.length) {
|
||||
return val
|
||||
}
|
||||
|
||||
var type
|
||||
for (i = 0; i < types.length; i++) {
|
||||
if (mimeMatch(normalize(type = types[i]), val)) {
|
||||
return type[0] === '+' || type.indexOf('*') !== -1
|
||||
? val
|
||||
: type
|
||||
}
|
||||
}
|
||||
|
||||
// no matches
|
||||
return false
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a request has a request body.
|
||||
* A request with a body __must__ either have `transfer-encoding`
|
||||
* or `content-length` headers set.
|
||||
* http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.3
|
||||
*
|
||||
* @param {Object} request
|
||||
* @return {Boolean}
|
||||
* @public
|
||||
*/
|
||||
|
||||
function hasbody (req) {
|
||||
return req.headers['transfer-encoding'] !== undefined ||
|
||||
!isNaN(req.headers['content-length'])
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the incoming request contains the "Content-Type"
|
||||
* header field, and it contains any of the give mime `type`s.
|
||||
* If there is no request body, `null` is returned.
|
||||
* If there is no content type, `false` is returned.
|
||||
* Otherwise, it returns the first `type` that matches.
|
||||
*
|
||||
* Examples:
|
||||
*
|
||||
* // With Content-Type: text/html; charset=utf-8
|
||||
* this.is('html'); // => 'html'
|
||||
* this.is('text/html'); // => 'text/html'
|
||||
* this.is('text/*', 'application/json'); // => 'text/html'
|
||||
*
|
||||
* // When Content-Type is application/json
|
||||
* this.is('json', 'urlencoded'); // => 'json'
|
||||
* this.is('application/json'); // => 'application/json'
|
||||
* this.is('html', 'application/*'); // => 'application/json'
|
||||
*
|
||||
* this.is('html'); // => false
|
||||
*
|
||||
* @param {String|Array} types...
|
||||
* @return {String|false|null}
|
||||
* @public
|
||||
*/
|
||||
|
||||
function typeofrequest (req, types_) {
|
||||
var types = types_
|
||||
|
||||
// no body
|
||||
if (!hasbody(req)) {
|
||||
return null
|
||||
}
|
||||
|
||||
// support flattened arguments
|
||||
if (arguments.length > 2) {
|
||||
types = new Array(arguments.length - 1)
|
||||
for (var i = 0; i < types.length; i++) {
|
||||
types[i] = arguments[i + 1]
|
||||
}
|
||||
}
|
||||
|
||||
// request content type
|
||||
var value = req.headers['content-type']
|
||||
|
||||
return typeis(value, types)
|
||||
}
|
||||
|
||||
/**
|
||||
* Normalize a mime type.
|
||||
* If it's a shorthand, expand it to a valid mime type.
|
||||
*
|
||||
* In general, you probably want:
|
||||
*
|
||||
* var type = is(req, ['urlencoded', 'json', 'multipart']);
|
||||
*
|
||||
* Then use the appropriate body parsers.
|
||||
* These three are the most common request body types
|
||||
* and are thus ensured to work.
|
||||
*
|
||||
* @param {String} type
|
||||
* @private
|
||||
*/
|
||||
|
||||
function normalize (type) {
|
||||
if (typeof type !== 'string') {
|
||||
// invalid type
|
||||
return false
|
||||
}
|
||||
|
||||
switch (type) {
|
||||
case 'urlencoded':
|
||||
return 'application/x-www-form-urlencoded'
|
||||
case 'multipart':
|
||||
return 'multipart/*'
|
||||
}
|
||||
|
||||
if (type[0] === '+') {
|
||||
// "+json" -> "*/*+json" expando
|
||||
return '*/*' + type
|
||||
}
|
||||
|
||||
return type.indexOf('/') === -1
|
||||
? mime.lookup(type)
|
||||
: type
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if `expected` mime type
|
||||
* matches `actual` mime type with
|
||||
* wildcard and +suffix support.
|
||||
*
|
||||
* @param {String} expected
|
||||
* @param {String} actual
|
||||
* @return {Boolean}
|
||||
* @private
|
||||
*/
|
||||
|
||||
function mimeMatch (expected, actual) {
|
||||
// invalid type
|
||||
if (expected === false) {
|
||||
return false
|
||||
}
|
||||
|
||||
// split types
|
||||
var actualParts = actual.split('/')
|
||||
var expectedParts = expected.split('/')
|
||||
|
||||
// invalid format
|
||||
if (actualParts.length !== 2 || expectedParts.length !== 2) {
|
||||
return false
|
||||
}
|
||||
|
||||
// validate type
|
||||
if (expectedParts[0] !== '*' && expectedParts[0] !== actualParts[0]) {
|
||||
return false
|
||||
}
|
||||
|
||||
// validate suffix wildcard
|
||||
if (expectedParts[1].substr(0, 2) === '*+') {
|
||||
return expectedParts[1].length <= actualParts[1].length + 1 &&
|
||||
expectedParts[1].substr(1) === actualParts[1].substr(1 - expectedParts[1].length)
|
||||
}
|
||||
|
||||
// validate subtype
|
||||
if (expectedParts[1] !== '*' && expectedParts[1] !== actualParts[1]) {
|
||||
return false
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
/**
|
||||
* Normalize a type and remove parameters.
|
||||
*
|
||||
* @param {string} value
|
||||
* @return {string}
|
||||
* @private
|
||||
*/
|
||||
|
||||
function normalizeType (value) {
|
||||
// parse the type
|
||||
var type = typer.parse(value)
|
||||
|
||||
// remove the parameters
|
||||
type.parameters = undefined
|
||||
|
||||
// reformat it
|
||||
return typer.format(type)
|
||||
}
|
||||
|
||||
/**
|
||||
* Try to normalize a type and remove parameters.
|
||||
*
|
||||
* @param {string} value
|
||||
* @return {string}
|
||||
* @private
|
||||
*/
|
||||
|
||||
function tryNormalizeType (value) {
|
||||
try {
|
||||
return normalizeType(value)
|
||||
} catch (err) {
|
||||
return null
|
||||
}
|
||||
}
|
||||
84
node_modules/body-parser/node_modules/type-is/package.json
generated
vendored
Normal file
84
node_modules/body-parser/node_modules/type-is/package.json
generated
vendored
Normal file
@ -0,0 +1,84 @@
|
||||
{
|
||||
"_from": "type-is@~1.6.16",
|
||||
"_id": "type-is@1.6.16",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-HRkVv/5qY2G6I8iab9cI7v1bOIdhm94dVjQCPFElW9W+3GeDOSHmy2EBYe4VTApuzolPcmgFTN3ftVJRKR2J9Q==",
|
||||
"_location": "/body-parser/type-is",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "type-is@~1.6.16",
|
||||
"name": "type-is",
|
||||
"escapedName": "type-is",
|
||||
"rawSpec": "~1.6.16",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "~1.6.16"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/body-parser"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.16.tgz",
|
||||
"_shasum": "f89ce341541c672b25ee7ae3c73dee3b2be50194",
|
||||
"_spec": "type-is@~1.6.16",
|
||||
"_where": "C:\\Users\\jonio\\Documents\\Programmieren\\Miniportal\\Neu\\MiniportalAPI\\node_modules\\body-parser",
|
||||
"bugs": {
|
||||
"url": "https://github.com/jshttp/type-is/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Douglas Christopher Wilson",
|
||||
"email": "doug@somethingdoug.com"
|
||||
},
|
||||
{
|
||||
"name": "Jonathan Ong",
|
||||
"email": "me@jongleberry.com",
|
||||
"url": "http://jongleberry.com"
|
||||
}
|
||||
],
|
||||
"dependencies": {
|
||||
"media-typer": "0.3.0",
|
||||
"mime-types": "~2.1.18"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "Infer the content-type of a request.",
|
||||
"devDependencies": {
|
||||
"eslint": "3.19.0",
|
||||
"eslint-config-standard": "10.2.1",
|
||||
"eslint-plugin-import": "2.8.0",
|
||||
"eslint-plugin-markdown": "1.0.0-beta.6",
|
||||
"eslint-plugin-node": "5.2.1",
|
||||
"eslint-plugin-promise": "3.6.0",
|
||||
"eslint-plugin-standard": "3.0.1",
|
||||
"istanbul": "0.4.5",
|
||||
"mocha": "1.21.5"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
},
|
||||
"files": [
|
||||
"LICENSE",
|
||||
"HISTORY.md",
|
||||
"index.js"
|
||||
],
|
||||
"homepage": "https://github.com/jshttp/type-is#readme",
|
||||
"keywords": [
|
||||
"content",
|
||||
"type",
|
||||
"checking"
|
||||
],
|
||||
"license": "MIT",
|
||||
"name": "type-is",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/jshttp/type-is.git"
|
||||
},
|
||||
"scripts": {
|
||||
"lint": "eslint --plugin markdown --ext js,md .",
|
||||
"test": "mocha --reporter spec --check-leaks --bail test/",
|
||||
"test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/",
|
||||
"test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/"
|
||||
},
|
||||
"version": "1.6.16"
|
||||
}
|
||||
59
node_modules/body-parser/package.json
generated
vendored
59
node_modules/body-parser/package.json
generated
vendored
@ -1,27 +1,32 @@
|
||||
{
|
||||
"_from": "body-parser@1.18.2",
|
||||
"_id": "body-parser@1.18.2",
|
||||
"_from": "body-parser",
|
||||
"_id": "body-parser@1.18.3",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-h2eKGdhLR9hZuDGZvVm84iKxBFQ=",
|
||||
"_integrity": "sha1-WykhmP/dVTs6DyDe0FkrlWlVyLQ=",
|
||||
"_location": "/body-parser",
|
||||
"_phantomChildren": {},
|
||||
"_phantomChildren": {
|
||||
"inherits": "2.0.3",
|
||||
"media-typer": "0.3.0",
|
||||
"setprototypeof": "1.1.0"
|
||||
},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"type": "tag",
|
||||
"registry": true,
|
||||
"raw": "body-parser@1.18.2",
|
||||
"raw": "body-parser",
|
||||
"name": "body-parser",
|
||||
"escapedName": "body-parser",
|
||||
"rawSpec": "1.18.2",
|
||||
"rawSpec": "",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "1.18.2"
|
||||
"fetchSpec": "latest"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/express"
|
||||
"#USER",
|
||||
"/"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.18.2.tgz",
|
||||
"_shasum": "87678a19d84b47d859b83199bd59bce222b10454",
|
||||
"_spec": "body-parser@1.18.2",
|
||||
"_where": "C:\\Users\\jonio\\Documents\\Programmieren\\Miniportal\\Neu\\MiniportalAPI\\node_modules\\express",
|
||||
"_resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.18.3.tgz",
|
||||
"_shasum": "5b292198ffdd553b3a0f20ded0592b956955c8b4",
|
||||
"_spec": "body-parser",
|
||||
"_where": "C:\\Users\\jonio\\Documents\\Programmieren\\Miniportal\\Neu\\MiniportalAPI",
|
||||
"bugs": {
|
||||
"url": "https://github.com/expressjs/body-parser/issues"
|
||||
},
|
||||
@ -41,28 +46,28 @@
|
||||
"bytes": "3.0.0",
|
||||
"content-type": "~1.0.4",
|
||||
"debug": "2.6.9",
|
||||
"depd": "~1.1.1",
|
||||
"http-errors": "~1.6.2",
|
||||
"iconv-lite": "0.4.19",
|
||||
"depd": "~1.1.2",
|
||||
"http-errors": "~1.6.3",
|
||||
"iconv-lite": "0.4.23",
|
||||
"on-finished": "~2.3.0",
|
||||
"qs": "6.5.1",
|
||||
"raw-body": "2.3.2",
|
||||
"type-is": "~1.6.15"
|
||||
"qs": "6.5.2",
|
||||
"raw-body": "2.3.3",
|
||||
"type-is": "~1.6.16"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "Node.js body parsing middleware",
|
||||
"devDependencies": {
|
||||
"eslint": "3.19.0",
|
||||
"eslint-config-standard": "10.2.1",
|
||||
"eslint-plugin-import": "2.7.0",
|
||||
"eslint": "4.19.1",
|
||||
"eslint-config-standard": "11.0.0",
|
||||
"eslint-plugin-import": "2.11.0",
|
||||
"eslint-plugin-markdown": "1.0.0-beta.6",
|
||||
"eslint-plugin-node": "5.1.1",
|
||||
"eslint-plugin-promise": "3.5.0",
|
||||
"eslint-plugin-standard": "3.0.1",
|
||||
"eslint-plugin-node": "6.0.1",
|
||||
"eslint-plugin-promise": "3.7.0",
|
||||
"eslint-plugin-standard": "3.1.0",
|
||||
"istanbul": "0.4.5",
|
||||
"methods": "1.1.2",
|
||||
"mocha": "2.5.3",
|
||||
"safe-buffer": "5.1.1",
|
||||
"safe-buffer": "5.1.2",
|
||||
"supertest": "1.1.0"
|
||||
},
|
||||
"engines": {
|
||||
@ -87,5 +92,5 @@
|
||||
"test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --require test/support/env --reporter dot --check-leaks test/",
|
||||
"test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --require test/support/env --reporter spec --check-leaks test/"
|
||||
},
|
||||
"version": "1.18.2"
|
||||
"version": "1.18.3"
|
||||
}
|
||||
|
||||
9
node_modules/cors/.eslintrc
generated
vendored
Normal file
9
node_modules/cors/.eslintrc
generated
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
{
|
||||
"env": {
|
||||
"node": true
|
||||
},
|
||||
"rules": {
|
||||
"indent": [2, 2],
|
||||
"quotes": "single"
|
||||
}
|
||||
}
|
||||
4
node_modules/cors/.npmignore
generated
vendored
Normal file
4
node_modules/cors/.npmignore
generated
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
coverage
|
||||
node_modules
|
||||
npm-debug.log
|
||||
package-lock.json
|
||||
19
node_modules/cors/.travis.yml
generated
vendored
Normal file
19
node_modules/cors/.travis.yml
generated
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
language: node_js
|
||||
node_js:
|
||||
- "0.10"
|
||||
- "4.8"
|
||||
- "6.11"
|
||||
- "8.1"
|
||||
sudo: false
|
||||
cache:
|
||||
directories:
|
||||
- node_modules
|
||||
before_install:
|
||||
# Skip updating shrinkwrap / lock
|
||||
- "npm config set shrinkwrap false"
|
||||
# Update Node.js modules
|
||||
- "test ! -d node_modules || npm prune"
|
||||
- "test ! -d node_modules || npm rebuild"
|
||||
after_script:
|
||||
# Report coverage
|
||||
- "test -e ./coverage/lcov.info && npm install coveralls@2 && cat ./coverage/lcov.info | coveralls"
|
||||
33
node_modules/cors/CONTRIBUTING.md
generated
vendored
Normal file
33
node_modules/cors/CONTRIBUTING.md
generated
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
# contributing to `cors`
|
||||
|
||||
CORS is a node.js package for providing a [connect](http://www.senchalabs.org/connect/)/[express](http://expressjs.com/) middleware that can be used to enable [CORS](http://en.wikipedia.org/wiki/Cross-origin_resource_sharing) with various options. Learn more about the project in [the README](README.md).
|
||||
|
||||
## The CORS Spec
|
||||
|
||||
[http://www.w3.org/TR/cors/](http://www.w3.org/TR/cors/)
|
||||
|
||||
## Pull Requests Welcome
|
||||
|
||||
* Include `'use strict';` in every javascript file.
|
||||
* 2 space indentation.
|
||||
* Please run the testing steps below before submitting.
|
||||
|
||||
## Testing
|
||||
|
||||
```bash
|
||||
$ npm install
|
||||
$ npm test
|
||||
```
|
||||
|
||||
## Interactive Testing Harness
|
||||
|
||||
[http://node-cors-client.herokuapp.com](http://node-cors-client.herokuapp.com)
|
||||
|
||||
Related git repositories:
|
||||
|
||||
* [https://github.com/TroyGoode/node-cors-server](https://github.com/TroyGoode/node-cors-server)
|
||||
* [https://github.com/TroyGoode/node-cors-client](https://github.com/TroyGoode/node-cors-client)
|
||||
|
||||
## License
|
||||
|
||||
[MIT License](http://www.opensource.org/licenses/mit-license.php)
|
||||
53
node_modules/cors/HISTORY.md
generated
vendored
Normal file
53
node_modules/cors/HISTORY.md
generated
vendored
Normal file
@ -0,0 +1,53 @@
|
||||
2.8.4 / 2017-07-12
|
||||
==================
|
||||
|
||||
* Work-around Safari bug in default pre-flight response
|
||||
|
||||
2.8.3 / 2017-03-29
|
||||
==================
|
||||
|
||||
* Fix error when options delegate missing `methods` option
|
||||
|
||||
2.8.2 / 2017-03-28
|
||||
==================
|
||||
|
||||
* Fix error when frozen options are passed
|
||||
* Send "Vary: Origin" when using regular expressions
|
||||
* Send "Vary: Access-Control-Request-Headers" when dynamic `allowedHeaders`
|
||||
|
||||
2.8.1 / 2016-09-08
|
||||
==================
|
||||
|
||||
This release only changed documentation.
|
||||
|
||||
2.8.0 / 2016-08-23
|
||||
==================
|
||||
|
||||
* Add `optionsSucccessCode` option
|
||||
|
||||
2.7.2 / 2016-08-23
|
||||
==================
|
||||
|
||||
* Fix error when Node.js running in strict mode
|
||||
|
||||
2.7.1 / 2015-05-28
|
||||
==================
|
||||
|
||||
* Move module into expressjs organization
|
||||
|
||||
2.7.0 / 2015-05-28
|
||||
==================
|
||||
|
||||
* Allow array of matching condition as `origin` option
|
||||
* Allow regular expression as `origin` option
|
||||
|
||||
2.6.1 / 2015-05-28
|
||||
==================
|
||||
|
||||
* Update `license` in pacakge.json
|
||||
|
||||
2.6.0 / 2015-04-27
|
||||
==================
|
||||
|
||||
* Add `preflightContinue` option
|
||||
* Fix "Vary: Origin" header added for "*"
|
||||
9
node_modules/cors/LICENSE
generated
vendored
Normal file
9
node_modules/cors/LICENSE
generated
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2013 Troy Goode <troygoode@gmail.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.
|
||||
228
node_modules/cors/README.md
generated
vendored
Normal file
228
node_modules/cors/README.md
generated
vendored
Normal file
@ -0,0 +1,228 @@
|
||||
# cors
|
||||
|
||||
[![NPM Version][npm-image]][npm-url]
|
||||
[![NPM Downloads][downloads-image]][downloads-url]
|
||||
[![Build Status][travis-image]][travis-url]
|
||||
[![Test Coverage][coveralls-image]][coveralls-url]
|
||||
|
||||
CORS is a node.js package for providing a [Connect](http://www.senchalabs.org/connect/)/[Express](http://expressjs.com/) middleware that can be used to enable [CORS](http://en.wikipedia.org/wiki/Cross-origin_resource_sharing) with various options.
|
||||
|
||||
**[Follow me (@troygoode) on Twitter!](https://twitter.com/intent/user?screen_name=troygoode)**
|
||||
|
||||
* [Installation](#installation)
|
||||
* [Usage](#usage)
|
||||
* [Simple Usage](#simple-usage-enable-all-cors-requests)
|
||||
* [Enable CORS for a Single Route](#enable-cors-for-a-single-route)
|
||||
* [Configuring CORS](#configuring-cors)
|
||||
* [Configuring CORS Asynchronously](#configuring-cors-asynchronously)
|
||||
* [Enabling CORS Pre-Flight](#enabling-cors-pre-flight)
|
||||
* [Configuration Options](#configuration-options)
|
||||
* [Demo](#demo)
|
||||
* [License](#license)
|
||||
* [Author](#author)
|
||||
|
||||
## Installation
|
||||
|
||||
This is a [Node.js](https://nodejs.org/en/) module available through the
|
||||
[npm registry](https://www.npmjs.com/). Installation is done using the
|
||||
[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):
|
||||
|
||||
```sh
|
||||
$ npm install cors
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
### Simple Usage (Enable *All* CORS Requests)
|
||||
|
||||
```javascript
|
||||
var express = require('express')
|
||||
var cors = require('cors')
|
||||
var app = express()
|
||||
|
||||
app.use(cors())
|
||||
|
||||
app.get('/products/:id', function (req, res, next) {
|
||||
res.json({msg: 'This is CORS-enabled for all origins!'})
|
||||
})
|
||||
|
||||
app.listen(80, function () {
|
||||
console.log('CORS-enabled web server listening on port 80')
|
||||
})
|
||||
```
|
||||
|
||||
### Enable CORS for a Single Route
|
||||
|
||||
```javascript
|
||||
var express = require('express')
|
||||
var cors = require('cors')
|
||||
var app = express()
|
||||
|
||||
app.get('/products/:id', cors(), function (req, res, next) {
|
||||
res.json({msg: 'This is CORS-enabled for a Single Route'})
|
||||
})
|
||||
|
||||
app.listen(80, function () {
|
||||
console.log('CORS-enabled web server listening on port 80')
|
||||
})
|
||||
```
|
||||
|
||||
### Configuring CORS
|
||||
|
||||
```javascript
|
||||
var express = require('express')
|
||||
var cors = require('cors')
|
||||
var app = express()
|
||||
|
||||
var corsOptions = {
|
||||
origin: 'http://example.com',
|
||||
optionsSuccessStatus: 200 // some legacy browsers (IE11, various SmartTVs) choke on 204
|
||||
}
|
||||
|
||||
app.get('/products/:id', cors(corsOptions), function (req, res, next) {
|
||||
res.json({msg: 'This is CORS-enabled for only example.com.'})
|
||||
})
|
||||
|
||||
app.listen(80, function () {
|
||||
console.log('CORS-enabled web server listening on port 80')
|
||||
})
|
||||
```
|
||||
|
||||
### Configuring CORS w/ Dynamic Origin
|
||||
|
||||
```javascript
|
||||
var express = require('express')
|
||||
var cors = require('cors')
|
||||
var app = express()
|
||||
|
||||
var whitelist = ['http://example1.com', 'http://example2.com']
|
||||
var corsOptions = {
|
||||
origin: function (origin, callback) {
|
||||
if (whitelist.indexOf(origin) !== -1) {
|
||||
callback(null, true)
|
||||
} else {
|
||||
callback(new Error('Not allowed by CORS'))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
app.get('/products/:id', cors(corsOptions), function (req, res, next) {
|
||||
res.json({msg: 'This is CORS-enabled for a whitelisted domain.'})
|
||||
})
|
||||
|
||||
app.listen(80, function () {
|
||||
console.log('CORS-enabled web server listening on port 80')
|
||||
})
|
||||
```
|
||||
|
||||
### Enabling CORS Pre-Flight
|
||||
|
||||
Certain CORS requests are considered 'complex' and require an initial
|
||||
`OPTIONS` request (called the "pre-flight request"). An example of a
|
||||
'complex' CORS request is one that uses an HTTP verb other than
|
||||
GET/HEAD/POST (such as DELETE) or that uses custom headers. To enable
|
||||
pre-flighting, you must add a new OPTIONS handler for the route you want
|
||||
to support:
|
||||
|
||||
```javascript
|
||||
var express = require('express')
|
||||
var cors = require('cors')
|
||||
var app = express()
|
||||
|
||||
app.options('/products/:id', cors()) // enable pre-flight request for DELETE request
|
||||
app.del('/products/:id', cors(), function (req, res, next) {
|
||||
res.json({msg: 'This is CORS-enabled for all origins!'})
|
||||
})
|
||||
|
||||
app.listen(80, function () {
|
||||
console.log('CORS-enabled web server listening on port 80')
|
||||
})
|
||||
```
|
||||
|
||||
You can also enable pre-flight across-the-board like so:
|
||||
|
||||
```javascript
|
||||
app.options('*', cors()) // include before other routes
|
||||
```
|
||||
|
||||
### Configuring CORS Asynchronously
|
||||
|
||||
```javascript
|
||||
var express = require('express')
|
||||
var cors = require('cors')
|
||||
var app = express()
|
||||
|
||||
var whitelist = ['http://example1.com', 'http://example2.com']
|
||||
var corsOptionsDelegate = function (req, callback) {
|
||||
var corsOptions;
|
||||
if (whitelist.indexOf(req.header('Origin')) !== -1) {
|
||||
corsOptions = { origin: true } // reflect (enable) the requested origin in the CORS response
|
||||
}else{
|
||||
corsOptions = { origin: false } // disable CORS for this request
|
||||
}
|
||||
callback(null, corsOptions) // callback expects two parameters: error and options
|
||||
}
|
||||
|
||||
app.get('/products/:id', cors(corsOptionsDelegate), function (req, res, next) {
|
||||
res.json({msg: 'This is CORS-enabled for a whitelisted domain.'})
|
||||
})
|
||||
|
||||
app.listen(80, function () {
|
||||
console.log('CORS-enabled web server listening on port 80')
|
||||
})
|
||||
```
|
||||
|
||||
## Configuration Options
|
||||
|
||||
* `origin`: Configures the **Access-Control-Allow-Origin** CORS header. Possible values:
|
||||
- `Boolean` - set `origin` to `true` to reflect the [request origin](http://tools.ietf.org/html/draft-abarth-origin-09), as defined by `req.header('Origin')`, or set it to `false` to disable CORS.
|
||||
- `String` - set `origin` to a specific origin. For example if you set it to `"http://example.com"` only requests from "http://example.com" will be allowed.
|
||||
- `RegExp` - set `origin` to a regular expression pattern which will be used to test the request origin. If it's a match, the request origin will be reflected. For example the pattern `/example\.com$/` will reflect any request that is coming from an origin ending with "example.com".
|
||||
- `Array` - set `origin` to an array of valid origins. Each origin can be a `String` or a `RegExp`. For example `["http://example1.com", /\.example2\.com$/]` will accept any request from "http://example1.com" or from a subdomain of "example2.com".
|
||||
- `Function` - set `origin` to a function implementing some custom logic. The function takes the request origin as the first parameter and a callback (which expects the signature `err [object], allow [bool]`) as the second.
|
||||
* `methods`: Configures the **Access-Control-Allow-Methods** CORS header. Expects a comma-delimited string (ex: 'GET,PUT,POST') or an array (ex: `['GET', 'PUT', 'POST']`).
|
||||
* `allowedHeaders`: Configures the **Access-Control-Allow-Headers** CORS header. Expects a comma-delimited string (ex: 'Content-Type,Authorization') or an array (ex: `['Content-Type', 'Authorization']`). If not specified, defaults to reflecting the headers specified in the request's **Access-Control-Request-Headers** header.
|
||||
* `exposedHeaders`: Configures the **Access-Control-Expose-Headers** CORS header. Expects a comma-delimited string (ex: 'Content-Range,X-Content-Range') or an array (ex: `['Content-Range', 'X-Content-Range']`). If not specified, no custom headers are exposed.
|
||||
* `credentials`: Configures the **Access-Control-Allow-Credentials** CORS header. Set to `true` to pass the header, otherwise it is omitted.
|
||||
* `maxAge`: Configures the **Access-Control-Max-Age** CORS header. Set to an integer to pass the header, otherwise it is omitted.
|
||||
* `preflightContinue`: Pass the CORS preflight response to the next handler.
|
||||
* `optionsSuccessStatus`: Provides a status code to use for successful `OPTIONS` requests, since some legacy browsers (IE11, various SmartTVs) choke on `204`.
|
||||
|
||||
The default configuration is the equivalent of:
|
||||
|
||||
```json
|
||||
{
|
||||
"origin": "*",
|
||||
"methods": "GET,HEAD,PUT,PATCH,POST,DELETE",
|
||||
"preflightContinue": false,
|
||||
"optionsSuccessStatus": 204
|
||||
}
|
||||
```
|
||||
|
||||
For details on the effect of each CORS header, read [this](http://www.html5rocks.com/en/tutorials/cors/) article on HTML5 Rocks.
|
||||
|
||||
## Demo
|
||||
|
||||
A demo that illustrates CORS working (and not working) using jQuery is available here: [http://node-cors-client.herokuapp.com/](http://node-cors-client.herokuapp.com/)
|
||||
|
||||
Code for that demo can be found here:
|
||||
|
||||
* Client: [https://github.com/TroyGoode/node-cors-client](https://github.com/TroyGoode/node-cors-client)
|
||||
* Server: [https://github.com/TroyGoode/node-cors-server](https://github.com/TroyGoode/node-cors-server)
|
||||
|
||||
## License
|
||||
|
||||
[MIT License](http://www.opensource.org/licenses/mit-license.php)
|
||||
|
||||
## Author
|
||||
|
||||
[Troy Goode](https://github.com/TroyGoode) ([troygoode@gmail.com](mailto:troygoode@gmail.com))
|
||||
|
||||
[coveralls-image]: https://img.shields.io/coveralls/expressjs/cors/master.svg
|
||||
[coveralls-url]: https://coveralls.io/r/expressjs/cors?branch=master
|
||||
[downloads-image]: https://img.shields.io/npm/dm/cors.svg
|
||||
[downloads-url]: https://npmjs.org/package/cors
|
||||
[npm-image]: https://img.shields.io/npm/v/cors.svg
|
||||
[npm-url]: https://npmjs.org/package/cors
|
||||
[travis-image]: https://img.shields.io/travis/expressjs/cors/master.svg
|
||||
[travis-url]: https://travis-ci.org/expressjs/cors
|
||||
238
node_modules/cors/lib/index.js
generated
vendored
Normal file
238
node_modules/cors/lib/index.js
generated
vendored
Normal file
@ -0,0 +1,238 @@
|
||||
(function () {
|
||||
|
||||
'use strict';
|
||||
|
||||
var assign = require('object-assign');
|
||||
var vary = require('vary');
|
||||
|
||||
var defaults = {
|
||||
origin: '*',
|
||||
methods: 'GET,HEAD,PUT,PATCH,POST,DELETE',
|
||||
preflightContinue: false,
|
||||
optionsSuccessStatus: 204
|
||||
};
|
||||
|
||||
function isString(s) {
|
||||
return typeof s === 'string' || s instanceof String;
|
||||
}
|
||||
|
||||
function isOriginAllowed(origin, allowedOrigin) {
|
||||
if (Array.isArray(allowedOrigin)) {
|
||||
for (var i = 0; i < allowedOrigin.length; ++i) {
|
||||
if (isOriginAllowed(origin, allowedOrigin[i])) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
} else if (isString(allowedOrigin)) {
|
||||
return origin === allowedOrigin;
|
||||
} else if (allowedOrigin instanceof RegExp) {
|
||||
return allowedOrigin.test(origin);
|
||||
} else {
|
||||
return !!allowedOrigin;
|
||||
}
|
||||
}
|
||||
|
||||
function configureOrigin(options, req) {
|
||||
var requestOrigin = req.headers.origin,
|
||||
headers = [],
|
||||
isAllowed;
|
||||
|
||||
if (!options.origin || options.origin === '*') {
|
||||
// allow any origin
|
||||
headers.push([{
|
||||
key: 'Access-Control-Allow-Origin',
|
||||
value: '*'
|
||||
}]);
|
||||
} else if (isString(options.origin)) {
|
||||
// fixed origin
|
||||
headers.push([{
|
||||
key: 'Access-Control-Allow-Origin',
|
||||
value: options.origin
|
||||
}]);
|
||||
headers.push([{
|
||||
key: 'Vary',
|
||||
value: 'Origin'
|
||||
}]);
|
||||
} else {
|
||||
isAllowed = isOriginAllowed(requestOrigin, options.origin);
|
||||
// reflect origin
|
||||
headers.push([{
|
||||
key: 'Access-Control-Allow-Origin',
|
||||
value: isAllowed ? requestOrigin : false
|
||||
}]);
|
||||
headers.push([{
|
||||
key: 'Vary',
|
||||
value: 'Origin'
|
||||
}]);
|
||||
}
|
||||
|
||||
return headers;
|
||||
}
|
||||
|
||||
function configureMethods(options) {
|
||||
var methods = options.methods;
|
||||
if (methods.join) {
|
||||
methods = options.methods.join(','); // .methods is an array, so turn it into a string
|
||||
}
|
||||
return {
|
||||
key: 'Access-Control-Allow-Methods',
|
||||
value: methods
|
||||
};
|
||||
}
|
||||
|
||||
function configureCredentials(options) {
|
||||
if (options.credentials === true) {
|
||||
return {
|
||||
key: 'Access-Control-Allow-Credentials',
|
||||
value: 'true'
|
||||
};
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
function configureAllowedHeaders(options, req) {
|
||||
var allowedHeaders = options.allowedHeaders || options.headers;
|
||||
var headers = [];
|
||||
|
||||
if (!allowedHeaders) {
|
||||
allowedHeaders = req.headers['access-control-request-headers']; // .headers wasn't specified, so reflect the request headers
|
||||
headers.push([{
|
||||
key: 'Vary',
|
||||
value: 'Access-Control-Request-Headers'
|
||||
}]);
|
||||
} else if (allowedHeaders.join) {
|
||||
allowedHeaders = allowedHeaders.join(','); // .headers is an array, so turn it into a string
|
||||
}
|
||||
if (allowedHeaders && allowedHeaders.length) {
|
||||
headers.push([{
|
||||
key: 'Access-Control-Allow-Headers',
|
||||
value: allowedHeaders
|
||||
}]);
|
||||
}
|
||||
|
||||
return headers;
|
||||
}
|
||||
|
||||
function configureExposedHeaders(options) {
|
||||
var headers = options.exposedHeaders;
|
||||
if (!headers) {
|
||||
return null;
|
||||
} else if (headers.join) {
|
||||
headers = headers.join(','); // .headers is an array, so turn it into a string
|
||||
}
|
||||
if (headers && headers.length) {
|
||||
return {
|
||||
key: 'Access-Control-Expose-Headers',
|
||||
value: headers
|
||||
};
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
function configureMaxAge(options) {
|
||||
var maxAge = options.maxAge && options.maxAge.toString();
|
||||
if (maxAge && maxAge.length) {
|
||||
return {
|
||||
key: 'Access-Control-Max-Age',
|
||||
value: maxAge
|
||||
};
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
function applyHeaders(headers, res) {
|
||||
for (var i = 0, n = headers.length; i < n; i++) {
|
||||
var header = headers[i];
|
||||
if (header) {
|
||||
if (Array.isArray(header)) {
|
||||
applyHeaders(header, res);
|
||||
} else if (header.key === 'Vary' && header.value) {
|
||||
vary(res, header.value);
|
||||
} else if (header.value) {
|
||||
res.setHeader(header.key, header.value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function cors(options, req, res, next) {
|
||||
var headers = [],
|
||||
method = req.method && req.method.toUpperCase && req.method.toUpperCase();
|
||||
|
||||
if (method === 'OPTIONS') {
|
||||
// preflight
|
||||
headers.push(configureOrigin(options, req));
|
||||
headers.push(configureCredentials(options, req));
|
||||
headers.push(configureMethods(options, req));
|
||||
headers.push(configureAllowedHeaders(options, req));
|
||||
headers.push(configureMaxAge(options, req));
|
||||
headers.push(configureExposedHeaders(options, req));
|
||||
applyHeaders(headers, res);
|
||||
|
||||
if (options.preflightContinue ) {
|
||||
next();
|
||||
} else {
|
||||
// Safari (and potentially other browsers) need content-length 0,
|
||||
// for 204 or they just hang waiting for a body
|
||||
res.statusCode = options.optionsSuccessStatus || defaults.optionsSuccessStatus;
|
||||
res.setHeader('Content-Length', '0');
|
||||
res.end();
|
||||
}
|
||||
} else {
|
||||
// actual response
|
||||
headers.push(configureOrigin(options, req));
|
||||
headers.push(configureCredentials(options, req));
|
||||
headers.push(configureExposedHeaders(options, req));
|
||||
applyHeaders(headers, res);
|
||||
next();
|
||||
}
|
||||
}
|
||||
|
||||
function middlewareWrapper(o) {
|
||||
// if options are static (either via defaults or custom options passed in), wrap in a function
|
||||
var optionsCallback = null;
|
||||
if (typeof o === 'function') {
|
||||
optionsCallback = o;
|
||||
} else {
|
||||
optionsCallback = function (req, cb) {
|
||||
cb(null, o);
|
||||
};
|
||||
}
|
||||
|
||||
return function corsMiddleware(req, res, next) {
|
||||
optionsCallback(req, function (err, options) {
|
||||
if (err) {
|
||||
next(err);
|
||||
} else {
|
||||
var corsOptions = assign({}, defaults, options);
|
||||
var originCallback = null;
|
||||
if (corsOptions.origin && typeof corsOptions.origin === 'function') {
|
||||
originCallback = corsOptions.origin;
|
||||
} else if (corsOptions.origin) {
|
||||
originCallback = function (origin, cb) {
|
||||
cb(null, corsOptions.origin);
|
||||
};
|
||||
}
|
||||
|
||||
if (originCallback) {
|
||||
originCallback(req.headers.origin, function (err2, origin) {
|
||||
if (err2 || !origin) {
|
||||
next(err2);
|
||||
} else {
|
||||
corsOptions.origin = origin;
|
||||
cors(corsOptions, req, res, next);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
next();
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
// can pass either an options hash, an options delegate, or nothing
|
||||
module.exports = middlewareWrapper;
|
||||
|
||||
}());
|
||||
73
node_modules/cors/package.json
generated
vendored
Normal file
73
node_modules/cors/package.json
generated
vendored
Normal file
@ -0,0 +1,73 @@
|
||||
{
|
||||
"_from": "cors",
|
||||
"_id": "cors@2.8.4",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-K9OB8usgECAQXNUOpZ2mMJBpRoY=",
|
||||
"_location": "/cors",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "tag",
|
||||
"registry": true,
|
||||
"raw": "cors",
|
||||
"name": "cors",
|
||||
"escapedName": "cors",
|
||||
"rawSpec": "",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "latest"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"#USER",
|
||||
"/"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/cors/-/cors-2.8.4.tgz",
|
||||
"_shasum": "2bd381f2eb201020105cd50ea59da63090694686",
|
||||
"_spec": "cors",
|
||||
"_where": "C:\\Users\\jonio\\Documents\\Programmieren\\Miniportal\\Neu\\MiniportalAPI",
|
||||
"author": {
|
||||
"name": "Troy Goode",
|
||||
"email": "troygoode@gmail.com",
|
||||
"url": "https://github.com/troygoode/"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/expressjs/cors/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {
|
||||
"object-assign": "^4",
|
||||
"vary": "^1"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "Node.js CORS middleware",
|
||||
"devDependencies": {
|
||||
"basic-auth-connect": "^1.0.0",
|
||||
"body-parser": "^1.12.4",
|
||||
"eslint": "^0.21.2",
|
||||
"express": "^4.12.4",
|
||||
"istanbul": "^0.4.5",
|
||||
"mocha": "3.4.2",
|
||||
"should": "11.2.1",
|
||||
"supertest": "3.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
},
|
||||
"homepage": "https://github.com/expressjs/cors#readme",
|
||||
"keywords": [
|
||||
"cors",
|
||||
"express",
|
||||
"connect",
|
||||
"middleware"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "./lib/index.js",
|
||||
"name": "cors",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/expressjs/cors.git"
|
||||
},
|
||||
"scripts": {
|
||||
"lint": "eslint lib test",
|
||||
"test": "npm run lint && istanbul cover node_modules/mocha/bin/_mocha"
|
||||
},
|
||||
"version": "2.8.4"
|
||||
}
|
||||
40
node_modules/cors/test/basic-auth.js
generated
vendored
Normal file
40
node_modules/cors/test/basic-auth.js
generated
vendored
Normal file
@ -0,0 +1,40 @@
|
||||
(function () {
|
||||
/*global describe, it*/
|
||||
|
||||
'use strict';
|
||||
|
||||
var should = require('should'),
|
||||
express = require('express'),
|
||||
supertest = require('supertest'),
|
||||
basicAuth = require('basic-auth-connect'),
|
||||
cors = require('../lib');
|
||||
|
||||
var app;
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
app = express();
|
||||
app.use(basicAuth('username', 'password'));
|
||||
app.use(cors());
|
||||
app.post('/', function (req, res) {
|
||||
res.send('hello world');
|
||||
});
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
describe('basic auth', function () {
|
||||
it('POST works', function (done) {
|
||||
supertest(app)
|
||||
.post('/')
|
||||
.auth('username', 'password')
|
||||
.expect(200)
|
||||
.end(function (err, res) {
|
||||
should.not.exist(err);
|
||||
res.headers['access-control-allow-origin'].should.eql('*');
|
||||
res.text.should.eql('hello world');
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
}());
|
||||
81
node_modules/cors/test/body-events.js
generated
vendored
Normal file
81
node_modules/cors/test/body-events.js
generated
vendored
Normal file
@ -0,0 +1,81 @@
|
||||
(function () {
|
||||
/*global describe, it*/
|
||||
|
||||
'use strict';
|
||||
|
||||
var should = require('should'),
|
||||
express = require('express'),
|
||||
supertest = require('supertest'),
|
||||
bodyParser = require('body-parser'),
|
||||
cors = require('../lib');
|
||||
|
||||
var dynamicOrigin,
|
||||
app1,
|
||||
app2,
|
||||
text = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed justo turpis, tempor id sem fringilla, cursus tristique purus. Mauris a sollicitudin magna. Etiam dui lacus, vehicula non dictum at, cursus vitae libero. Curabitur lorem nulla, sollicitudin id enim ut, vehicula rhoncus felis. Ut nec iaculis velit. Vivamus at augue nulla. Fusce at molestie arcu. Duis at dui at tellus mattis tincidunt. Vestibulum sit amet dictum metus. Curabitur nec pretium ante. Proin vulputate elit ac lorem gravida, sit amet placerat lorem fringilla. Mauris fermentum, diam et volutpat auctor, ante enim imperdiet purus, sit amet tincidunt ipsum nulla nec est. Fusce id ipsum in sem malesuada laoreet vitae non magna. Praesent commodo turpis in nulla egestas, eu posuere magna venenatis. Integer in aliquam sem. Fusce quis lorem tincidunt eros rutrum lobortis.\n\nNam aliquam cursus ipsum, a hendrerit purus. Cras ultrices viverra nunc ac lacinia. Sed sed diam orci. Vestibulum ut orci a nibh scelerisque pretium. Sed suscipit vestibulum metus, ac ultricies leo sodales a. Aliquam erat volutpat. Vestibulum mauris massa, luctus et libero vel, cursus suscipit nulla. Cras sed erat quis massa fermentum congue. Mauris ultrices sem ligula, id malesuada lectus tincidunt eget. Donec sed nisl elit. Aenean ac lobortis massa. Phasellus felis nisl, dictum a dui volutpat, dictum sagittis diam. Vestibulum lacinia tellus vel commodo consequat.\n\nNulla at varius nibh, non posuere enim. Curabitur urna est, ultrices vel sem nec, consequat molestie nisi. Aliquam sed augue sit amet ante viverra pretium. Cras aliquam turpis vitae eros gravida egestas. Etiam quis dolor non quam suscipit iaculis. Sed euismod est libero, ac ullamcorper elit hendrerit vitae. Vivamus sollicitudin nulla dolor, vitae porta lacus suscipit ac.\n\nSed volutpat, magna in scelerisque dapibus, eros ante volutpat nisi, ac condimentum diam sem sed justo. Aenean justo risus, bibendum vitae blandit ac, mattis quis nunc. Quisque non felis nec justo auctor accumsan non id odio. Mauris vel dui feugiat dolor dapibus convallis in et neque. Phasellus fermentum sollicitudin tortor ac pretium. Proin tristique accumsan nulla eu venenatis. Cras porta lorem ac arcu accumsan pulvinar. Sed dignissim leo augue, a pretium ante viverra id. Phasellus blandit at purus a malesuada. Nam et cursus mauris. Vivamus accumsan augue laoreet lectus lacinia eleifend. Fusce sit amet felis nunc. Pellentesque eu turpis nisl.\n\nPellentesque vitae quam feugiat, volutpat lectus et, faucibus massa. Maecenas consectetur quis nisi eu aliquam. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Etiam laoreet condimentum laoreet. Praesent sit amet massa sit amet dui porta condimentum. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Sed volutpat massa nec risus malesuada hendrerit.';
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
dynamicOrigin = function (origin, cb) {
|
||||
setTimeout(function () {
|
||||
cb(null, true);
|
||||
}, 200);
|
||||
};
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
app1 = express();
|
||||
app1.use(cors({origin: dynamicOrigin}));
|
||||
app1.use(bodyParser.json());
|
||||
app1.post('/', function (req, res) {
|
||||
res.send(req.body);
|
||||
});
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
app2 = express();
|
||||
app2.use(bodyParser.json());
|
||||
app2.use(cors({origin: dynamicOrigin}));
|
||||
app2.post('/', function (req, res) {
|
||||
res.send(req.body);
|
||||
});
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
describe('body-parser-events', function () {
|
||||
describe('app1 (cors before bodyparser)', function () {
|
||||
it('POST works', function (done) {
|
||||
var body = {
|
||||
example: text
|
||||
};
|
||||
supertest(app1)
|
||||
.post('/')
|
||||
.send(body)
|
||||
.expect(200)
|
||||
.end(function (err, res) {
|
||||
should.not.exist(err);
|
||||
res.body.should.eql(body);
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('app2 (bodyparser before cors)', function () {
|
||||
it('POST works', function (done) {
|
||||
var body = {
|
||||
example: text
|
||||
};
|
||||
supertest(app2)
|
||||
.post('/')
|
||||
.send(body)
|
||||
.expect(200)
|
||||
.end(function (err, res) {
|
||||
should.not.exist(err);
|
||||
res.body.should.eql(body);
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
}());
|
||||
747
node_modules/cors/test/cors.js
generated
vendored
Normal file
747
node_modules/cors/test/cors.js
generated
vendored
Normal file
@ -0,0 +1,747 @@
|
||||
(function () {
|
||||
/*global describe, it*/
|
||||
|
||||
'use strict';
|
||||
|
||||
var should = require('should'),
|
||||
cors = require('../lib');
|
||||
|
||||
var fakeRequest = function (headers) {
|
||||
return {
|
||||
headers: headers || {
|
||||
'origin': 'request.com',
|
||||
'access-control-request-headers': 'requestedHeader1,requestedHeader2'
|
||||
},
|
||||
pause: function () {
|
||||
// do nothing
|
||||
return;
|
||||
},
|
||||
resume: function () {
|
||||
// do nothing
|
||||
return;
|
||||
}
|
||||
};
|
||||
},
|
||||
fakeResponse = function () {
|
||||
var headers = {};
|
||||
return {
|
||||
allHeaders: function () {
|
||||
return headers;
|
||||
},
|
||||
getHeader: function (key) {
|
||||
return headers[key];
|
||||
},
|
||||
setHeader: function (key, value) {
|
||||
headers[key] = value;
|
||||
return;
|
||||
},
|
||||
get: function (key) {
|
||||
return headers[key];
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
describe('cors', function () {
|
||||
it('does not alter `options` configuration object', function () {
|
||||
var options = Object.freeze({
|
||||
origin: 'custom-origin'
|
||||
});
|
||||
(function () {
|
||||
cors(options);
|
||||
}).should.not.throw();
|
||||
});
|
||||
|
||||
it('passes control to next middleware', function (done) {
|
||||
// arrange
|
||||
var req, res, next;
|
||||
req = fakeRequest();
|
||||
res = fakeResponse();
|
||||
next = function () {
|
||||
done();
|
||||
};
|
||||
|
||||
// act
|
||||
cors()(req, res, next);
|
||||
});
|
||||
|
||||
it('shortcircuits preflight requests', function (done) {
|
||||
// arrange
|
||||
var req, res, next;
|
||||
req = fakeRequest();
|
||||
req.method = 'OPTIONS';
|
||||
res = fakeResponse();
|
||||
res.end = function () {
|
||||
// assert
|
||||
res.statusCode.should.equal(204);
|
||||
done();
|
||||
};
|
||||
next = function () {
|
||||
// assert
|
||||
done('should not be called');
|
||||
};
|
||||
|
||||
// act
|
||||
cors()(req, res, next);
|
||||
});
|
||||
|
||||
it('can configure preflight success response status code', function (done) {
|
||||
// arrange
|
||||
var req, res, next;
|
||||
req = fakeRequest();
|
||||
req.method = 'OPTIONS';
|
||||
res = fakeResponse();
|
||||
res.end = function () {
|
||||
// assert
|
||||
res.statusCode.should.equal(200);
|
||||
done();
|
||||
};
|
||||
next = function () {
|
||||
// assert
|
||||
done('should not be called');
|
||||
};
|
||||
|
||||
// act
|
||||
cors({optionsSuccessStatus: 200})(req, res, next);
|
||||
});
|
||||
|
||||
it('doesn\'t shortcircuit preflight requests with preflightContinue option', function (done) {
|
||||
// arrange
|
||||
var req, res, next;
|
||||
req = fakeRequest();
|
||||
req.method = 'OPTIONS';
|
||||
res = fakeResponse();
|
||||
res.end = function () {
|
||||
// assert
|
||||
done('should not be called');
|
||||
};
|
||||
next = function () {
|
||||
// assert
|
||||
done();
|
||||
};
|
||||
|
||||
// act
|
||||
cors({preflightContinue: true})(req, res, next);
|
||||
});
|
||||
|
||||
it('normalizes method names', function (done) {
|
||||
// arrange
|
||||
var req, res, next;
|
||||
req = fakeRequest();
|
||||
req.method = 'options';
|
||||
res = fakeResponse();
|
||||
res.end = function () {
|
||||
// assert
|
||||
res.statusCode.should.equal(204);
|
||||
done();
|
||||
};
|
||||
next = function () {
|
||||
// assert
|
||||
done('should not be called');
|
||||
};
|
||||
|
||||
// act
|
||||
cors()(req, res, next);
|
||||
});
|
||||
|
||||
it('includes Content-Length response header', function (done) {
|
||||
// arrange
|
||||
var req, res, next;
|
||||
req = fakeRequest();
|
||||
req.method = 'options';
|
||||
res = fakeResponse();
|
||||
res.end = function () {
|
||||
// assert
|
||||
res.getHeader('Content-Length').should.equal('0');
|
||||
done();
|
||||
};
|
||||
next = function () {
|
||||
// assert
|
||||
done('should not be called');
|
||||
};
|
||||
|
||||
// act
|
||||
cors()(req, res, next);
|
||||
});
|
||||
|
||||
it('no options enables default CORS to all origins', function (done) {
|
||||
// arrange
|
||||
var req, res, next;
|
||||
req = fakeRequest();
|
||||
res = fakeResponse();
|
||||
next = function () {
|
||||
// assert
|
||||
res.getHeader('Access-Control-Allow-Origin').should.equal('*');
|
||||
should.not.exist(res.getHeader('Access-Control-Allow-Methods'));
|
||||
done();
|
||||
};
|
||||
|
||||
// act
|
||||
cors()(req, res, next);
|
||||
});
|
||||
|
||||
it('OPTION call with no options enables default CORS to all origins and methods', function (done) {
|
||||
// arrange
|
||||
var req, res, next;
|
||||
req = fakeRequest();
|
||||
req.method = 'OPTIONS';
|
||||
res = fakeResponse();
|
||||
res.end = function () {
|
||||
// assert
|
||||
res.statusCode.should.equal(204);
|
||||
done();
|
||||
};
|
||||
next = function () {
|
||||
// assert
|
||||
res.getHeader('Access-Control-Allow-Origin').should.equal('*');
|
||||
res.getHeader('Access-Control-Allow-Methods').should.equal('GET,PUT,PATCH,POST,DELETE');
|
||||
done();
|
||||
};
|
||||
|
||||
// act
|
||||
cors()(req, res, next);
|
||||
});
|
||||
|
||||
describe('passing static options', function () {
|
||||
it('overrides defaults', function (done) {
|
||||
// arrange
|
||||
var req, res, next, options;
|
||||
options = {
|
||||
origin: 'example.com',
|
||||
methods: ['FOO', 'bar'],
|
||||
headers: ['FIZZ', 'buzz'],
|
||||
credentials: true,
|
||||
maxAge: 123
|
||||
};
|
||||
req = fakeRequest();
|
||||
req.method = 'OPTIONS';
|
||||
res = fakeResponse();
|
||||
res.end = function () {
|
||||
// assert
|
||||
res.statusCode.should.equal(204);
|
||||
done();
|
||||
};
|
||||
next = function () {
|
||||
// assert
|
||||
res.getHeader('Access-Control-Allow-Origin').should.equal('example.com');
|
||||
res.getHeader('Access-Control-Allow-Methods').should.equal('FOO,bar');
|
||||
res.getHeader('Access-Control-Allow-Headers').should.equal('FIZZ,buzz');
|
||||
res.getHeader('Access-Control-Allow-Credentials').should.equal('true');
|
||||
res.getHeader('Access-Control-Max-Age').should.equal('123');
|
||||
done();
|
||||
};
|
||||
|
||||
// act
|
||||
cors(options)(req, res, next);
|
||||
});
|
||||
|
||||
it('matches request origin against regexp', function(done) {
|
||||
var req = fakeRequest();
|
||||
var res = fakeResponse();
|
||||
var options = { origin: /^(.+\.)?request.com$/ };
|
||||
cors(options)(req, res, function(err) {
|
||||
should.not.exist(err);
|
||||
res.getHeader('Access-Control-Allow-Origin').should.equal(req.headers.origin);
|
||||
should.exist(res.getHeader('Vary'));
|
||||
res.getHeader('Vary').should.equal('Origin');
|
||||
return done();
|
||||
});
|
||||
});
|
||||
|
||||
it('matches request origin against array of origin checks', function(done) {
|
||||
var req = fakeRequest();
|
||||
var res = fakeResponse();
|
||||
var options = { origin: [ /foo\.com$/, 'request.com' ] };
|
||||
cors(options)(req, res, function(err) {
|
||||
should.not.exist(err);
|
||||
res.getHeader('Access-Control-Allow-Origin').should.equal(req.headers.origin);
|
||||
should.exist(res.getHeader('Vary'));
|
||||
res.getHeader('Vary').should.equal('Origin');
|
||||
return done();
|
||||
});
|
||||
});
|
||||
|
||||
it('doesn\'t match request origin against array of invalid origin checks', function(done) {
|
||||
var req = fakeRequest();
|
||||
var res = fakeResponse();
|
||||
var options = { origin: [ /foo\.com$/, 'bar.com' ] };
|
||||
cors(options)(req, res, function(err) {
|
||||
should.not.exist(err);
|
||||
should.not.exist(res.getHeader('Access-Control-Allow-Origin'));
|
||||
should.exist(res.getHeader('Vary'));
|
||||
res.getHeader('Vary').should.equal('Origin');
|
||||
return done();
|
||||
});
|
||||
});
|
||||
|
||||
it('origin of false disables cors', function (done) {
|
||||
// arrange
|
||||
var req, res, next, options;
|
||||
options = {
|
||||
origin: false,
|
||||
methods: ['FOO', 'bar'],
|
||||
headers: ['FIZZ', 'buzz'],
|
||||
credentials: true,
|
||||
maxAge: 123
|
||||
};
|
||||
req = fakeRequest();
|
||||
res = fakeResponse();
|
||||
next = function () {
|
||||
// assert
|
||||
should.not.exist(res.getHeader('Access-Control-Allow-Origin'));
|
||||
should.not.exist(res.getHeader('Access-Control-Allow-Methods'));
|
||||
should.not.exist(res.getHeader('Access-Control-Allow-Headers'));
|
||||
should.not.exist(res.getHeader('Access-Control-Allow-Credentials'));
|
||||
should.not.exist(res.getHeader('Access-Control-Max-Age'));
|
||||
done();
|
||||
};
|
||||
|
||||
// act
|
||||
cors(options)(req, res, next);
|
||||
});
|
||||
|
||||
it('can override origin', function (done) {
|
||||
// arrange
|
||||
var req, res, next, options;
|
||||
options = {
|
||||
origin: 'example.com'
|
||||
};
|
||||
req = fakeRequest();
|
||||
res = fakeResponse();
|
||||
next = function () {
|
||||
// assert
|
||||
res.getHeader('Access-Control-Allow-Origin').should.equal('example.com');
|
||||
done();
|
||||
};
|
||||
|
||||
// act
|
||||
cors(options)(req, res, next);
|
||||
});
|
||||
|
||||
it('includes Vary header for specific origins', function (done) {
|
||||
// arrange
|
||||
var req, res, next, options;
|
||||
options = {
|
||||
origin: 'example.com'
|
||||
};
|
||||
req = fakeRequest();
|
||||
res = fakeResponse();
|
||||
next = function () {
|
||||
// assert
|
||||
should.exist(res.getHeader('Vary'));
|
||||
res.getHeader('Vary').should.equal('Origin');
|
||||
done();
|
||||
};
|
||||
|
||||
// act
|
||||
cors(options)(req, res, next);
|
||||
});
|
||||
|
||||
it('appends to an existing Vary header', function (done) {
|
||||
// arrange
|
||||
var req, res, next, options;
|
||||
options = {
|
||||
origin: 'example.com'
|
||||
};
|
||||
req = fakeRequest();
|
||||
res = fakeResponse();
|
||||
res.setHeader('Vary', 'Foo');
|
||||
next = function () {
|
||||
// assert
|
||||
res.getHeader('Vary').should.equal('Foo, Origin');
|
||||
done();
|
||||
};
|
||||
|
||||
// act
|
||||
cors(options)(req, res, next);
|
||||
});
|
||||
|
||||
it('origin defaults to *', function (done) {
|
||||
// arrange
|
||||
var req, res, next, options;
|
||||
options = {
|
||||
};
|
||||
req = fakeRequest();
|
||||
res = fakeResponse();
|
||||
next = function () {
|
||||
// assert
|
||||
res.getHeader('Access-Control-Allow-Origin').should.equal('*');
|
||||
done();
|
||||
};
|
||||
|
||||
// act
|
||||
cors(options)(req, res, next);
|
||||
});
|
||||
|
||||
it('specifying true for origin reflects requesting origin', function (done) {
|
||||
// arrange
|
||||
var req, res, next, options;
|
||||
options = {
|
||||
origin: true
|
||||
};
|
||||
req = fakeRequest();
|
||||
res = fakeResponse();
|
||||
next = function () {
|
||||
// assert
|
||||
res.getHeader('Access-Control-Allow-Origin').should.equal('request.com');
|
||||
done();
|
||||
};
|
||||
|
||||
// act
|
||||
cors(options)(req, res, next);
|
||||
});
|
||||
|
||||
it('should allow origin when callback returns true', function (done) {
|
||||
var req, res, next, options;
|
||||
options = {
|
||||
origin: function (sentOrigin, cb) {
|
||||
sentOrigin.should.equal('request.com');
|
||||
cb(null, true);
|
||||
}
|
||||
};
|
||||
req = fakeRequest();
|
||||
res = fakeResponse();
|
||||
next = function () {
|
||||
res.getHeader('Access-Control-Allow-Origin').should.equal('request.com');
|
||||
done();
|
||||
};
|
||||
|
||||
cors(options)(req, res, next);
|
||||
});
|
||||
|
||||
it('should not allow origin when callback returns false', function (done) {
|
||||
var req, res, next, options;
|
||||
options = {
|
||||
origin: function (sentOrigin, cb) {
|
||||
sentOrigin.should.equal('request.com');
|
||||
cb(null, false);
|
||||
}
|
||||
};
|
||||
req = fakeRequest();
|
||||
res = fakeResponse();
|
||||
next = function () {
|
||||
should.not.exist(res.getHeader('Access-Control-Allow-Origin'));
|
||||
should.not.exist(res.getHeader('Access-Control-Allow-Methods'));
|
||||
should.not.exist(res.getHeader('Access-Control-Allow-Headers'));
|
||||
should.not.exist(res.getHeader('Access-Control-Allow-Credentials'));
|
||||
should.not.exist(res.getHeader('Access-Control-Max-Age'));
|
||||
done();
|
||||
};
|
||||
|
||||
cors(options)(req, res, next);
|
||||
});
|
||||
|
||||
it('should not override options.origin callback', function (done) {
|
||||
var req, res, next, options;
|
||||
options = {
|
||||
origin: function (sentOrigin, cb) {
|
||||
var isValid = sentOrigin === 'request.com';
|
||||
cb(null, isValid);
|
||||
}
|
||||
};
|
||||
|
||||
req = fakeRequest();
|
||||
res = fakeResponse();
|
||||
next = function () {
|
||||
res.getHeader('Access-Control-Allow-Origin').should.equal('request.com');
|
||||
};
|
||||
|
||||
cors(options)(req, res, next);
|
||||
|
||||
req = fakeRequest({
|
||||
'origin': 'invalid-request.com'
|
||||
});
|
||||
res = fakeResponse();
|
||||
|
||||
next = function () {
|
||||
should.not.exist(res.getHeader('Access-Control-Allow-Origin'));
|
||||
should.not.exist(res.getHeader('Access-Control-Allow-Methods'));
|
||||
should.not.exist(res.getHeader('Access-Control-Allow-Headers'));
|
||||
should.not.exist(res.getHeader('Access-Control-Allow-Credentials'));
|
||||
should.not.exist(res.getHeader('Access-Control-Max-Age'));
|
||||
done();
|
||||
};
|
||||
|
||||
cors(options)(req, res, next);
|
||||
});
|
||||
|
||||
|
||||
it('can override methods', function (done) {
|
||||
// arrange
|
||||
var req, res, next, options;
|
||||
options = {
|
||||
methods: ['method1', 'method2']
|
||||
};
|
||||
req = fakeRequest();
|
||||
req.method = 'OPTIONS';
|
||||
res = fakeResponse();
|
||||
res.end = function () {
|
||||
// assert
|
||||
res.statusCode.should.equal(204);
|
||||
done();
|
||||
};
|
||||
next = function () {
|
||||
// assert
|
||||
res.getHeader('Access-Control-Allow-Methods').should.equal('method1,method2');
|
||||
done();
|
||||
};
|
||||
|
||||
// act
|
||||
cors(options)(req, res, next);
|
||||
});
|
||||
|
||||
it('methods defaults to GET, PUT, PATCH, POST, DELETE', function (done) {
|
||||
// arrange
|
||||
var req, res, next, options;
|
||||
options = {
|
||||
};
|
||||
req = fakeRequest();
|
||||
req.method = 'OPTIONS';
|
||||
res = fakeResponse();
|
||||
res.end = function () {
|
||||
// assert
|
||||
res.statusCode.should.equal(204);
|
||||
done();
|
||||
};
|
||||
next = function () {
|
||||
// assert
|
||||
res.getHeader('Access-Control-Allow-Methods').should.equal('GET,PUT,PATCH,POST,DELETE');
|
||||
done();
|
||||
};
|
||||
|
||||
// act
|
||||
cors(options)(req, res, next);
|
||||
});
|
||||
|
||||
it('can specify allowed headers', function (done) {
|
||||
// arrange
|
||||
var req, res, options;
|
||||
options = {
|
||||
allowedHeaders: ['header1', 'header2']
|
||||
};
|
||||
req = fakeRequest();
|
||||
req.method = 'OPTIONS';
|
||||
res = fakeResponse();
|
||||
res.end = function () {
|
||||
// assert
|
||||
res.getHeader('Access-Control-Allow-Headers').should.equal('header1,header2');
|
||||
should.not.exist(res.getHeader('Vary'));
|
||||
done();
|
||||
};
|
||||
|
||||
// act
|
||||
cors(options)(req, res, null);
|
||||
});
|
||||
|
||||
it('specifying an empty list or string of allowed headers will result in no response header for allowed headers', function (done) {
|
||||
// arrange
|
||||
var req, res, next, options;
|
||||
options = {
|
||||
allowedHeaders: []
|
||||
};
|
||||
req = fakeRequest();
|
||||
res = fakeResponse();
|
||||
next = function () {
|
||||
// assert
|
||||
should.not.exist(res.getHeader('Access-Control-Allow-Headers'));
|
||||
should.not.exist(res.getHeader('Vary'));
|
||||
done();
|
||||
};
|
||||
|
||||
// act
|
||||
cors(options)(req, res, next);
|
||||
});
|
||||
|
||||
it('if no allowed headers are specified, defaults to requested allowed headers', function (done) {
|
||||
// arrange
|
||||
var req, res, options;
|
||||
options = {
|
||||
};
|
||||
req = fakeRequest();
|
||||
req.method = 'OPTIONS';
|
||||
res = fakeResponse();
|
||||
res.end = function () {
|
||||
// assert
|
||||
res.getHeader('Access-Control-Allow-Headers').should.equal('requestedHeader1,requestedHeader2');
|
||||
should.exist(res.getHeader('Vary'));
|
||||
res.getHeader('Vary').should.equal('Access-Control-Request-Headers');
|
||||
done();
|
||||
};
|
||||
|
||||
// act
|
||||
cors(options)(req, res, null);
|
||||
});
|
||||
|
||||
it('can specify exposed headers', function (done) {
|
||||
// arrange
|
||||
var req, res, options, next;
|
||||
options = {
|
||||
exposedHeaders: ['custom-header1', 'custom-header2']
|
||||
};
|
||||
req = fakeRequest();
|
||||
res = fakeResponse();
|
||||
next = function () {
|
||||
// assert
|
||||
res.getHeader('Access-Control-Expose-Headers').should.equal('custom-header1,custom-header2');
|
||||
done();
|
||||
};
|
||||
|
||||
// act
|
||||
cors(options)(req, res, next);
|
||||
});
|
||||
|
||||
it('specifying an empty list or string of exposed headers will result in no response header for exposed headers', function (done) {
|
||||
// arrange
|
||||
var req, res, next, options;
|
||||
options = {
|
||||
exposedHeaders: []
|
||||
};
|
||||
req = fakeRequest();
|
||||
res = fakeResponse();
|
||||
next = function () {
|
||||
// assert
|
||||
should.not.exist(res.getHeader('Access-Control-Expose-Headers'));
|
||||
done();
|
||||
};
|
||||
|
||||
// act
|
||||
cors(options)(req, res, next);
|
||||
});
|
||||
|
||||
it('includes credentials if explicitly enabled', function (done) {
|
||||
// arrange
|
||||
var req, res, options;
|
||||
options = {
|
||||
credentials: true
|
||||
};
|
||||
req = fakeRequest();
|
||||
req.method = 'OPTIONS';
|
||||
res = fakeResponse();
|
||||
res.end = function () {
|
||||
// assert
|
||||
res.getHeader('Access-Control-Allow-Credentials').should.equal('true');
|
||||
done();
|
||||
};
|
||||
|
||||
// act
|
||||
cors(options)(req, res, null);
|
||||
});
|
||||
|
||||
it('does not includes credentials unless explicitly enabled', function (done) {
|
||||
// arrange
|
||||
var req, res, next, options;
|
||||
options = {
|
||||
};
|
||||
req = fakeRequest();
|
||||
res = fakeResponse();
|
||||
next = function () {
|
||||
// assert
|
||||
should.not.exist(res.getHeader('Access-Control-Allow-Credentials'));
|
||||
done();
|
||||
};
|
||||
|
||||
// act
|
||||
cors(options)(req, res, next);
|
||||
});
|
||||
|
||||
it('includes maxAge when specified', function (done) {
|
||||
// arrange
|
||||
var req, res, options;
|
||||
options = {
|
||||
maxAge: 456
|
||||
};
|
||||
req = fakeRequest();
|
||||
req.method = 'OPTIONS';
|
||||
res = fakeResponse();
|
||||
res.end = function () {
|
||||
// assert
|
||||
res.getHeader('Access-Control-Max-Age').should.equal('456');
|
||||
done();
|
||||
};
|
||||
|
||||
// act
|
||||
cors(options)(req, res, null);
|
||||
});
|
||||
|
||||
it('does not includes maxAge unless specified', function (done) {
|
||||
// arrange
|
||||
var req, res, next, options;
|
||||
options = {
|
||||
};
|
||||
req = fakeRequest();
|
||||
res = fakeResponse();
|
||||
next = function () {
|
||||
// assert
|
||||
should.not.exist(res.getHeader('Access-Control-Max-Age'));
|
||||
done();
|
||||
};
|
||||
|
||||
// act
|
||||
cors(options)(req, res, next);
|
||||
});
|
||||
});
|
||||
|
||||
describe('passing a function to build options', function () {
|
||||
it('handles options specified via callback', function (done) {
|
||||
// arrange
|
||||
var req, res, next, delegate;
|
||||
delegate = function (req2, cb) {
|
||||
cb(null, {
|
||||
origin: 'delegate.com'
|
||||
});
|
||||
};
|
||||
req = fakeRequest();
|
||||
res = fakeResponse();
|
||||
next = function () {
|
||||
// assert
|
||||
res.getHeader('Access-Control-Allow-Origin').should.equal('delegate.com');
|
||||
done();
|
||||
};
|
||||
|
||||
// act
|
||||
cors(delegate)(req, res, next);
|
||||
});
|
||||
|
||||
it('handles options specified via callback for preflight', function (done) {
|
||||
// arrange
|
||||
var req, res, delegate;
|
||||
delegate = function (req2, cb) {
|
||||
cb(null, {
|
||||
origin: 'delegate.com',
|
||||
maxAge: 1000
|
||||
});
|
||||
};
|
||||
req = fakeRequest();
|
||||
req.method = 'OPTIONS';
|
||||
res = fakeResponse();
|
||||
res.end = function () {
|
||||
// assert
|
||||
res.getHeader('Access-Control-Allow-Origin').should.equal('delegate.com');
|
||||
res.getHeader('Access-Control-Max-Age').should.equal('1000');
|
||||
done();
|
||||
};
|
||||
|
||||
// act
|
||||
cors(delegate)(req, res, null);
|
||||
});
|
||||
|
||||
it('handles error specified via callback', function (done) {
|
||||
// arrange
|
||||
var req, res, next, delegate;
|
||||
delegate = function (req2, cb) {
|
||||
cb('some error');
|
||||
};
|
||||
req = fakeRequest();
|
||||
res = fakeResponse();
|
||||
next = function (err) {
|
||||
// assert
|
||||
err.should.equal('some error');
|
||||
done();
|
||||
};
|
||||
|
||||
// act
|
||||
cors(delegate)(req, res, next);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
}());
|
||||
77
node_modules/cors/test/error-response.js
generated
vendored
Normal file
77
node_modules/cors/test/error-response.js
generated
vendored
Normal file
@ -0,0 +1,77 @@
|
||||
(function () {
|
||||
/*global describe, it*/
|
||||
|
||||
'use strict';
|
||||
|
||||
var should = require('should'),
|
||||
express = require('express'),
|
||||
supertest = require('supertest'),
|
||||
cors = require('../lib');
|
||||
|
||||
var app;
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
app = express();
|
||||
app.use(cors());
|
||||
|
||||
app.post('/five-hundred', function (req, res, next) {
|
||||
next(new Error('nope'));
|
||||
});
|
||||
|
||||
app.post('/four-oh-one', function (req, res, next) {
|
||||
next(new Error('401'));
|
||||
});
|
||||
|
||||
app.post('/four-oh-four', function (req, res, next) {
|
||||
next();
|
||||
});
|
||||
|
||||
app.use(function (err, req, res, next) {
|
||||
if (err.message === '401') {
|
||||
res.status(401).send('unauthorized');
|
||||
} else {
|
||||
next(err);
|
||||
}
|
||||
});
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
describe('error response', function () {
|
||||
it('500', function (done) {
|
||||
supertest(app)
|
||||
.post('/five-hundred')
|
||||
.expect(500)
|
||||
.end(function (err, res) {
|
||||
should.not.exist(err);
|
||||
res.headers['access-control-allow-origin'].should.eql('*');
|
||||
res.text.should.containEql('Error: nope');
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('401', function (done) {
|
||||
supertest(app)
|
||||
.post('/four-oh-one')
|
||||
.expect(401)
|
||||
.end(function (err, res) {
|
||||
should.not.exist(err);
|
||||
res.headers['access-control-allow-origin'].should.eql('*');
|
||||
res.text.should.eql('unauthorized');
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('404', function (done) {
|
||||
supertest(app)
|
||||
.post('/four-oh-four')
|
||||
.expect(404)
|
||||
.end(function (err, res) {
|
||||
should.not.exist(err);
|
||||
res.headers['access-control-allow-origin'].should.eql('*');
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
}());
|
||||
98
node_modules/cors/test/example-app.js
generated
vendored
Normal file
98
node_modules/cors/test/example-app.js
generated
vendored
Normal file
@ -0,0 +1,98 @@
|
||||
(function () {
|
||||
/*global describe, it*/
|
||||
|
||||
'use strict';
|
||||
|
||||
var should = require('should'),
|
||||
express = require('express'),
|
||||
supertest = require('supertest'),
|
||||
cors = require('../lib');
|
||||
|
||||
var simpleApp,
|
||||
complexApp;
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
simpleApp = express();
|
||||
simpleApp.head('/', cors(), function (req, res) {
|
||||
res.status(204).send();
|
||||
});
|
||||
simpleApp.get('/', cors(), function (req, res) {
|
||||
res.send('Hello World (Get)');
|
||||
});
|
||||
simpleApp.post('/', cors(), function (req, res) {
|
||||
res.send('Hello World (Post)');
|
||||
});
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
complexApp = express();
|
||||
complexApp.options('/', cors());
|
||||
complexApp.delete('/', cors(), function (req, res) {
|
||||
res.send('Hello World (Delete)');
|
||||
});
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
describe('example app(s)', function () {
|
||||
describe('simple methods', function () {
|
||||
it('GET works', function (done) {
|
||||
supertest(simpleApp)
|
||||
.get('/')
|
||||
.expect(200)
|
||||
.end(function (err, res) {
|
||||
should.not.exist(err);
|
||||
res.headers['access-control-allow-origin'].should.eql('*');
|
||||
res.text.should.eql('Hello World (Get)');
|
||||
done();
|
||||
});
|
||||
});
|
||||
it('HEAD works', function (done) {
|
||||
supertest(simpleApp)
|
||||
.head('/')
|
||||
.expect(204)
|
||||
.end(function (err, res) {
|
||||
should.not.exist(err);
|
||||
res.headers['access-control-allow-origin'].should.eql('*');
|
||||
done();
|
||||
});
|
||||
});
|
||||
it('POST works', function (done) {
|
||||
supertest(simpleApp)
|
||||
.post('/')
|
||||
.expect(200)
|
||||
.end(function (err, res) {
|
||||
should.not.exist(err);
|
||||
res.headers['access-control-allow-origin'].should.eql('*');
|
||||
res.text.should.eql('Hello World (Post)');
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('complex methods', function () {
|
||||
it('OPTIONS works', function (done) {
|
||||
supertest(complexApp)
|
||||
.options('/')
|
||||
.expect(204)
|
||||
.end(function (err, res) {
|
||||
should.not.exist(err);
|
||||
res.headers['access-control-allow-origin'].should.eql('*');
|
||||
done();
|
||||
});
|
||||
});
|
||||
it('DELETE works', function (done) {
|
||||
supertest(complexApp)
|
||||
.del('/')
|
||||
.expect(200)
|
||||
.end(function (err, res) {
|
||||
should.not.exist(err);
|
||||
res.headers['access-control-allow-origin'].should.eql('*');
|
||||
res.text.should.eql('Hello World (Delete)');
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
}());
|
||||
56
node_modules/cors/test/issue-2.js
generated
vendored
Normal file
56
node_modules/cors/test/issue-2.js
generated
vendored
Normal file
@ -0,0 +1,56 @@
|
||||
(function () {
|
||||
/*global describe, it*/
|
||||
|
||||
'use strict';
|
||||
|
||||
var should = require('should'),
|
||||
express = require('express'),
|
||||
supertest = require('supertest'),
|
||||
cors = require('../lib');
|
||||
|
||||
var app,
|
||||
corsOptions;
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
app = express();
|
||||
corsOptions = {
|
||||
origin: true,
|
||||
methods: ['POST'],
|
||||
credentials: true,
|
||||
maxAge: 3600
|
||||
};
|
||||
app.options('/api/login', cors(corsOptions));
|
||||
app.post('/api/login', cors(corsOptions), function (req, res) {
|
||||
res.send('LOGIN');
|
||||
});
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
describe('issue #2', function () {
|
||||
it('OPTIONS works', function (done) {
|
||||
supertest(app)
|
||||
.options('/api/login')
|
||||
.expect(204)
|
||||
.set('Origin', 'http://example.com')
|
||||
.end(function (err, res) {
|
||||
should.not.exist(err);
|
||||
res.headers['access-control-allow-origin'].should.eql('http://example.com');
|
||||
done();
|
||||
});
|
||||
});
|
||||
it('POST works', function (done) {
|
||||
supertest(app)
|
||||
.post('/api/login')
|
||||
.expect(200)
|
||||
.set('Origin', 'http://example.com')
|
||||
.end(function (err, res) {
|
||||
should.not.exist(err);
|
||||
res.headers['access-control-allow-origin'].should.eql('http://example.com');
|
||||
res.text.should.eql('LOGIN');
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
}());
|
||||
58
node_modules/cors/test/issue-31.js
generated
vendored
Normal file
58
node_modules/cors/test/issue-31.js
generated
vendored
Normal file
@ -0,0 +1,58 @@
|
||||
(function () {
|
||||
/*global describe, it*/
|
||||
|
||||
'use strict';
|
||||
|
||||
var should = require('should'),
|
||||
express = require('express'),
|
||||
supertest = require('supertest'),
|
||||
cors = require('../lib');
|
||||
|
||||
var app,
|
||||
mainRouter,
|
||||
itemsRouter;
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
itemsRouter = new express.Router();
|
||||
itemsRouter.get('/', function (req, res) {
|
||||
res.send('hello world');
|
||||
});
|
||||
|
||||
mainRouter = new express.Router();
|
||||
mainRouter.use('/items', itemsRouter);
|
||||
|
||||
app = express();
|
||||
app.use(cors());
|
||||
app.use(mainRouter);
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
describe('issue #31', function () {
|
||||
it('OPTIONS works', function (done) {
|
||||
supertest(app)
|
||||
.options('/items')
|
||||
.expect(204)
|
||||
.set('Origin', 'http://example.com')
|
||||
.end(function (err, res) {
|
||||
should.not.exist(err);
|
||||
res.headers['access-control-allow-origin'].should.eql('*');
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('GET works', function (done) {
|
||||
supertest(app)
|
||||
.get('/items')
|
||||
.expect(200)
|
||||
.set('Origin', 'http://example.com')
|
||||
.end(function (err, res) {
|
||||
should.not.exist(err);
|
||||
res.headers['access-control-allow-origin'].should.eql('*');
|
||||
res.text.should.eql('hello world');
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
}());
|
||||
4
node_modules/cors/test/mocha.opts
generated
vendored
Normal file
4
node_modules/cors/test/mocha.opts
generated
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
--ui bdd
|
||||
--reporter spec
|
||||
--require should
|
||||
--require test/support/env
|
||||
2
node_modules/cors/test/support/env.js
generated
vendored
Normal file
2
node_modules/cors/test/support/env.js
generated
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
|
||||
process.env.NODE_ENV = 'test';
|
||||
568
node_modules/express/node_modules/body-parser/HISTORY.md
generated
vendored
Normal file
568
node_modules/express/node_modules/body-parser/HISTORY.md
generated
vendored
Normal file
@ -0,0 +1,568 @@
|
||||
1.18.2 / 2017-09-22
|
||||
===================
|
||||
|
||||
* deps: debug@2.6.9
|
||||
* perf: remove argument reassignment
|
||||
|
||||
1.18.1 / 2017-09-12
|
||||
===================
|
||||
|
||||
* deps: content-type@~1.0.4
|
||||
- perf: remove argument reassignment
|
||||
- perf: skip parameter parsing when no parameters
|
||||
* deps: iconv-lite@0.4.19
|
||||
- Fix ISO-8859-1 regression
|
||||
- Update Windows-1255
|
||||
* deps: qs@6.5.1
|
||||
- Fix parsing & compacting very deep objects
|
||||
* deps: raw-body@2.3.2
|
||||
- deps: iconv-lite@0.4.19
|
||||
|
||||
1.18.0 / 2017-09-08
|
||||
===================
|
||||
|
||||
* Fix JSON strict violation error to match native parse error
|
||||
* Include the `body` property on verify errors
|
||||
* Include the `type` property on all generated errors
|
||||
* Use `http-errors` to set status code on errors
|
||||
* deps: bytes@3.0.0
|
||||
* deps: debug@2.6.8
|
||||
* deps: depd@~1.1.1
|
||||
- Remove unnecessary `Buffer` loading
|
||||
* deps: http-errors@~1.6.2
|
||||
- deps: depd@1.1.1
|
||||
* deps: iconv-lite@0.4.18
|
||||
- Add support for React Native
|
||||
- Add a warning if not loaded as utf-8
|
||||
- Fix CESU-8 decoding in Node.js 8
|
||||
- Improve speed of ISO-8859-1 encoding
|
||||
* deps: qs@6.5.0
|
||||
* deps: raw-body@2.3.1
|
||||
- Use `http-errors` for standard emitted errors
|
||||
- deps: bytes@3.0.0
|
||||
- deps: iconv-lite@0.4.18
|
||||
- perf: skip buffer decoding on overage chunk
|
||||
* perf: prevent internal `throw` when missing charset
|
||||
|
||||
1.17.2 / 2017-05-17
|
||||
===================
|
||||
|
||||
* deps: debug@2.6.7
|
||||
- Fix `DEBUG_MAX_ARRAY_LENGTH`
|
||||
- deps: ms@2.0.0
|
||||
* deps: type-is@~1.6.15
|
||||
- deps: mime-types@~2.1.15
|
||||
|
||||
1.17.1 / 2017-03-06
|
||||
===================
|
||||
|
||||
* deps: qs@6.4.0
|
||||
- Fix regression parsing keys starting with `[`
|
||||
|
||||
1.17.0 / 2017-03-01
|
||||
===================
|
||||
|
||||
* deps: http-errors@~1.6.1
|
||||
- Make `message` property enumerable for `HttpError`s
|
||||
- deps: setprototypeof@1.0.3
|
||||
* deps: qs@6.3.1
|
||||
- Fix compacting nested arrays
|
||||
|
||||
1.16.1 / 2017-02-10
|
||||
===================
|
||||
|
||||
* deps: debug@2.6.1
|
||||
- Fix deprecation messages in WebStorm and other editors
|
||||
- Undeprecate `DEBUG_FD` set to `1` or `2`
|
||||
|
||||
1.16.0 / 2017-01-17
|
||||
===================
|
||||
|
||||
* deps: debug@2.6.0
|
||||
- Allow colors in workers
|
||||
- Deprecated `DEBUG_FD` environment variable
|
||||
- Fix error when running under React Native
|
||||
- Use same color for same namespace
|
||||
- deps: ms@0.7.2
|
||||
* deps: http-errors@~1.5.1
|
||||
- deps: inherits@2.0.3
|
||||
- deps: setprototypeof@1.0.2
|
||||
- deps: statuses@'>= 1.3.1 < 2'
|
||||
* deps: iconv-lite@0.4.15
|
||||
- Added encoding MS-31J
|
||||
- Added encoding MS-932
|
||||
- Added encoding MS-936
|
||||
- Added encoding MS-949
|
||||
- Added encoding MS-950
|
||||
- Fix GBK/GB18030 handling of Euro character
|
||||
* deps: qs@6.2.1
|
||||
- Fix array parsing from skipping empty values
|
||||
* deps: raw-body@~2.2.0
|
||||
- deps: iconv-lite@0.4.15
|
||||
* deps: type-is@~1.6.14
|
||||
- deps: mime-types@~2.1.13
|
||||
|
||||
1.15.2 / 2016-06-19
|
||||
===================
|
||||
|
||||
* deps: bytes@2.4.0
|
||||
* deps: content-type@~1.0.2
|
||||
- perf: enable strict mode
|
||||
* deps: http-errors@~1.5.0
|
||||
- Use `setprototypeof` module to replace `__proto__` setting
|
||||
- deps: statuses@'>= 1.3.0 < 2'
|
||||
- perf: enable strict mode
|
||||
* deps: qs@6.2.0
|
||||
* deps: raw-body@~2.1.7
|
||||
- deps: bytes@2.4.0
|
||||
- perf: remove double-cleanup on happy path
|
||||
* deps: type-is@~1.6.13
|
||||
- deps: mime-types@~2.1.11
|
||||
|
||||
1.15.1 / 2016-05-05
|
||||
===================
|
||||
|
||||
* deps: bytes@2.3.0
|
||||
- Drop partial bytes on all parsed units
|
||||
- Fix parsing byte string that looks like hex
|
||||
* deps: raw-body@~2.1.6
|
||||
- deps: bytes@2.3.0
|
||||
* deps: type-is@~1.6.12
|
||||
- deps: mime-types@~2.1.10
|
||||
|
||||
1.15.0 / 2016-02-10
|
||||
===================
|
||||
|
||||
* deps: http-errors@~1.4.0
|
||||
- Add `HttpError` export, for `err instanceof createError.HttpError`
|
||||
- deps: inherits@2.0.1
|
||||
- deps: statuses@'>= 1.2.1 < 2'
|
||||
* deps: qs@6.1.0
|
||||
* deps: type-is@~1.6.11
|
||||
- deps: mime-types@~2.1.9
|
||||
|
||||
1.14.2 / 2015-12-16
|
||||
===================
|
||||
|
||||
* deps: bytes@2.2.0
|
||||
* deps: iconv-lite@0.4.13
|
||||
* deps: qs@5.2.0
|
||||
* deps: raw-body@~2.1.5
|
||||
- deps: bytes@2.2.0
|
||||
- deps: iconv-lite@0.4.13
|
||||
* deps: type-is@~1.6.10
|
||||
- deps: mime-types@~2.1.8
|
||||
|
||||
1.14.1 / 2015-09-27
|
||||
===================
|
||||
|
||||
* Fix issue where invalid charset results in 400 when `verify` used
|
||||
* deps: iconv-lite@0.4.12
|
||||
- Fix CESU-8 decoding in Node.js 4.x
|
||||
* deps: raw-body@~2.1.4
|
||||
- Fix masking critical errors from `iconv-lite`
|
||||
- deps: iconv-lite@0.4.12
|
||||
* deps: type-is@~1.6.9
|
||||
- deps: mime-types@~2.1.7
|
||||
|
||||
1.14.0 / 2015-09-16
|
||||
===================
|
||||
|
||||
* Fix JSON strict parse error to match syntax errors
|
||||
* Provide static `require` analysis in `urlencoded` parser
|
||||
* deps: depd@~1.1.0
|
||||
- Support web browser loading
|
||||
* deps: qs@5.1.0
|
||||
* deps: raw-body@~2.1.3
|
||||
- Fix sync callback when attaching data listener causes sync read
|
||||
* deps: type-is@~1.6.8
|
||||
- Fix type error when given invalid type to match against
|
||||
- deps: mime-types@~2.1.6
|
||||
|
||||
1.13.3 / 2015-07-31
|
||||
===================
|
||||
|
||||
* deps: type-is@~1.6.6
|
||||
- deps: mime-types@~2.1.4
|
||||
|
||||
1.13.2 / 2015-07-05
|
||||
===================
|
||||
|
||||
* deps: iconv-lite@0.4.11
|
||||
* deps: qs@4.0.0
|
||||
- Fix dropping parameters like `hasOwnProperty`
|
||||
- Fix user-visible incompatibilities from 3.1.0
|
||||
- Fix various parsing edge cases
|
||||
* deps: raw-body@~2.1.2
|
||||
- Fix error stack traces to skip `makeError`
|
||||
- deps: iconv-lite@0.4.11
|
||||
* deps: type-is@~1.6.4
|
||||
- deps: mime-types@~2.1.2
|
||||
- perf: enable strict mode
|
||||
- perf: remove argument reassignment
|
||||
|
||||
1.13.1 / 2015-06-16
|
||||
===================
|
||||
|
||||
* deps: qs@2.4.2
|
||||
- Downgraded from 3.1.0 because of user-visible incompatibilities
|
||||
|
||||
1.13.0 / 2015-06-14
|
||||
===================
|
||||
|
||||
* Add `statusCode` property on `Error`s, in addition to `status`
|
||||
* Change `type` default to `application/json` for JSON parser
|
||||
* Change `type` default to `application/x-www-form-urlencoded` for urlencoded parser
|
||||
* Provide static `require` analysis
|
||||
* Use the `http-errors` module to generate errors
|
||||
* deps: bytes@2.1.0
|
||||
- Slight optimizations
|
||||
* deps: iconv-lite@0.4.10
|
||||
- The encoding UTF-16 without BOM now defaults to UTF-16LE when detection fails
|
||||
- Leading BOM is now removed when decoding
|
||||
* deps: on-finished@~2.3.0
|
||||
- Add defined behavior for HTTP `CONNECT` requests
|
||||
- Add defined behavior for HTTP `Upgrade` requests
|
||||
- deps: ee-first@1.1.1
|
||||
* deps: qs@3.1.0
|
||||
- Fix dropping parameters like `hasOwnProperty`
|
||||
- Fix various parsing edge cases
|
||||
- Parsed object now has `null` prototype
|
||||
* deps: raw-body@~2.1.1
|
||||
- Use `unpipe` module for unpiping requests
|
||||
- deps: iconv-lite@0.4.10
|
||||
* deps: type-is@~1.6.3
|
||||
- deps: mime-types@~2.1.1
|
||||
- perf: reduce try block size
|
||||
- perf: remove bitwise operations
|
||||
* perf: enable strict mode
|
||||
* perf: remove argument reassignment
|
||||
* perf: remove delete call
|
||||
|
||||
1.12.4 / 2015-05-10
|
||||
===================
|
||||
|
||||
* deps: debug@~2.2.0
|
||||
* deps: qs@2.4.2
|
||||
- Fix allowing parameters like `constructor`
|
||||
* deps: on-finished@~2.2.1
|
||||
* deps: raw-body@~2.0.1
|
||||
- Fix a false-positive when unpiping in Node.js 0.8
|
||||
- deps: bytes@2.0.1
|
||||
* deps: type-is@~1.6.2
|
||||
- deps: mime-types@~2.0.11
|
||||
|
||||
1.12.3 / 2015-04-15
|
||||
===================
|
||||
|
||||
* Slight efficiency improvement when not debugging
|
||||
* deps: depd@~1.0.1
|
||||
* deps: iconv-lite@0.4.8
|
||||
- Add encoding alias UNICODE-1-1-UTF-7
|
||||
* deps: raw-body@1.3.4
|
||||
- Fix hanging callback if request aborts during read
|
||||
- deps: iconv-lite@0.4.8
|
||||
|
||||
1.12.2 / 2015-03-16
|
||||
===================
|
||||
|
||||
* deps: qs@2.4.1
|
||||
- Fix error when parameter `hasOwnProperty` is present
|
||||
|
||||
1.12.1 / 2015-03-15
|
||||
===================
|
||||
|
||||
* deps: debug@~2.1.3
|
||||
- Fix high intensity foreground color for bold
|
||||
- deps: ms@0.7.0
|
||||
* deps: type-is@~1.6.1
|
||||
- deps: mime-types@~2.0.10
|
||||
|
||||
1.12.0 / 2015-02-13
|
||||
===================
|
||||
|
||||
* add `debug` messages
|
||||
* accept a function for the `type` option
|
||||
* use `content-type` to parse `Content-Type` headers
|
||||
* deps: iconv-lite@0.4.7
|
||||
- Gracefully support enumerables on `Object.prototype`
|
||||
* deps: raw-body@1.3.3
|
||||
- deps: iconv-lite@0.4.7
|
||||
* deps: type-is@~1.6.0
|
||||
- fix argument reassignment
|
||||
- fix false-positives in `hasBody` `Transfer-Encoding` check
|
||||
- support wildcard for both type and subtype (`*/*`)
|
||||
- deps: mime-types@~2.0.9
|
||||
|
||||
1.11.0 / 2015-01-30
|
||||
===================
|
||||
|
||||
* make internal `extended: true` depth limit infinity
|
||||
* deps: type-is@~1.5.6
|
||||
- deps: mime-types@~2.0.8
|
||||
|
||||
1.10.2 / 2015-01-20
|
||||
===================
|
||||
|
||||
* deps: iconv-lite@0.4.6
|
||||
- Fix rare aliases of single-byte encodings
|
||||
* deps: raw-body@1.3.2
|
||||
- deps: iconv-lite@0.4.6
|
||||
|
||||
1.10.1 / 2015-01-01
|
||||
===================
|
||||
|
||||
* deps: on-finished@~2.2.0
|
||||
* deps: type-is@~1.5.5
|
||||
- deps: mime-types@~2.0.7
|
||||
|
||||
1.10.0 / 2014-12-02
|
||||
===================
|
||||
|
||||
* make internal `extended: true` array limit dynamic
|
||||
|
||||
1.9.3 / 2014-11-21
|
||||
==================
|
||||
|
||||
* deps: iconv-lite@0.4.5
|
||||
- Fix Windows-31J and X-SJIS encoding support
|
||||
* deps: qs@2.3.3
|
||||
- Fix `arrayLimit` behavior
|
||||
* deps: raw-body@1.3.1
|
||||
- deps: iconv-lite@0.4.5
|
||||
* deps: type-is@~1.5.3
|
||||
- deps: mime-types@~2.0.3
|
||||
|
||||
1.9.2 / 2014-10-27
|
||||
==================
|
||||
|
||||
* deps: qs@2.3.2
|
||||
- Fix parsing of mixed objects and values
|
||||
|
||||
1.9.1 / 2014-10-22
|
||||
==================
|
||||
|
||||
* deps: on-finished@~2.1.1
|
||||
- Fix handling of pipelined requests
|
||||
* deps: qs@2.3.0
|
||||
- Fix parsing of mixed implicit and explicit arrays
|
||||
* deps: type-is@~1.5.2
|
||||
- deps: mime-types@~2.0.2
|
||||
|
||||
1.9.0 / 2014-09-24
|
||||
==================
|
||||
|
||||
* include the charset in "unsupported charset" error message
|
||||
* include the encoding in "unsupported content encoding" error message
|
||||
* deps: depd@~1.0.0
|
||||
|
||||
1.8.4 / 2014-09-23
|
||||
==================
|
||||
|
||||
* fix content encoding to be case-insensitive
|
||||
|
||||
1.8.3 / 2014-09-19
|
||||
==================
|
||||
|
||||
* deps: qs@2.2.4
|
||||
- Fix issue with object keys starting with numbers truncated
|
||||
|
||||
1.8.2 / 2014-09-15
|
||||
==================
|
||||
|
||||
* deps: depd@0.4.5
|
||||
|
||||
1.8.1 / 2014-09-07
|
||||
==================
|
||||
|
||||
* deps: media-typer@0.3.0
|
||||
* deps: type-is@~1.5.1
|
||||
|
||||
1.8.0 / 2014-09-05
|
||||
==================
|
||||
|
||||
* make empty-body-handling consistent between chunked requests
|
||||
- empty `json` produces `{}`
|
||||
- empty `raw` produces `new Buffer(0)`
|
||||
- empty `text` produces `''`
|
||||
- empty `urlencoded` produces `{}`
|
||||
* deps: qs@2.2.3
|
||||
- Fix issue where first empty value in array is discarded
|
||||
* deps: type-is@~1.5.0
|
||||
- fix `hasbody` to be true for `content-length: 0`
|
||||
|
||||
1.7.0 / 2014-09-01
|
||||
==================
|
||||
|
||||
* add `parameterLimit` option to `urlencoded` parser
|
||||
* change `urlencoded` extended array limit to 100
|
||||
* respond with 413 when over `parameterLimit` in `urlencoded`
|
||||
|
||||
1.6.7 / 2014-08-29
|
||||
==================
|
||||
|
||||
* deps: qs@2.2.2
|
||||
- Remove unnecessary cloning
|
||||
|
||||
1.6.6 / 2014-08-27
|
||||
==================
|
||||
|
||||
* deps: qs@2.2.0
|
||||
- Array parsing fix
|
||||
- Performance improvements
|
||||
|
||||
1.6.5 / 2014-08-16
|
||||
==================
|
||||
|
||||
* deps: on-finished@2.1.0
|
||||
|
||||
1.6.4 / 2014-08-14
|
||||
==================
|
||||
|
||||
* deps: qs@1.2.2
|
||||
|
||||
1.6.3 / 2014-08-10
|
||||
==================
|
||||
|
||||
* deps: qs@1.2.1
|
||||
|
||||
1.6.2 / 2014-08-07
|
||||
==================
|
||||
|
||||
* deps: qs@1.2.0
|
||||
- Fix parsing array of objects
|
||||
|
||||
1.6.1 / 2014-08-06
|
||||
==================
|
||||
|
||||
* deps: qs@1.1.0
|
||||
- Accept urlencoded square brackets
|
||||
- Accept empty values in implicit array notation
|
||||
|
||||
1.6.0 / 2014-08-05
|
||||
==================
|
||||
|
||||
* deps: qs@1.0.2
|
||||
- Complete rewrite
|
||||
- Limits array length to 20
|
||||
- Limits object depth to 5
|
||||
- Limits parameters to 1,000
|
||||
|
||||
1.5.2 / 2014-07-27
|
||||
==================
|
||||
|
||||
* deps: depd@0.4.4
|
||||
- Work-around v8 generating empty stack traces
|
||||
|
||||
1.5.1 / 2014-07-26
|
||||
==================
|
||||
|
||||
* deps: depd@0.4.3
|
||||
- Fix exception when global `Error.stackTraceLimit` is too low
|
||||
|
||||
1.5.0 / 2014-07-20
|
||||
==================
|
||||
|
||||
* deps: depd@0.4.2
|
||||
- Add `TRACE_DEPRECATION` environment variable
|
||||
- Remove non-standard grey color from color output
|
||||
- Support `--no-deprecation` argument
|
||||
- Support `--trace-deprecation` argument
|
||||
* deps: iconv-lite@0.4.4
|
||||
- Added encoding UTF-7
|
||||
* deps: raw-body@1.3.0
|
||||
- deps: iconv-lite@0.4.4
|
||||
- Added encoding UTF-7
|
||||
- Fix `Cannot switch to old mode now` error on Node.js 0.10+
|
||||
* deps: type-is@~1.3.2
|
||||
|
||||
1.4.3 / 2014-06-19
|
||||
==================
|
||||
|
||||
* deps: type-is@1.3.1
|
||||
- fix global variable leak
|
||||
|
||||
1.4.2 / 2014-06-19
|
||||
==================
|
||||
|
||||
* deps: type-is@1.3.0
|
||||
- improve type parsing
|
||||
|
||||
1.4.1 / 2014-06-19
|
||||
==================
|
||||
|
||||
* fix urlencoded extended deprecation message
|
||||
|
||||
1.4.0 / 2014-06-19
|
||||
==================
|
||||
|
||||
* add `text` parser
|
||||
* add `raw` parser
|
||||
* check accepted charset in content-type (accepts utf-8)
|
||||
* check accepted encoding in content-encoding (accepts identity)
|
||||
* deprecate `bodyParser()` middleware; use `.json()` and `.urlencoded()` as needed
|
||||
* deprecate `urlencoded()` without provided `extended` option
|
||||
* lazy-load urlencoded parsers
|
||||
* parsers split into files for reduced mem usage
|
||||
* support gzip and deflate bodies
|
||||
- set `inflate: false` to turn off
|
||||
* deps: raw-body@1.2.2
|
||||
- Support all encodings from `iconv-lite`
|
||||
|
||||
1.3.1 / 2014-06-11
|
||||
==================
|
||||
|
||||
* deps: type-is@1.2.1
|
||||
- Switch dependency from mime to mime-types@1.0.0
|
||||
|
||||
1.3.0 / 2014-05-31
|
||||
==================
|
||||
|
||||
* add `extended` option to urlencoded parser
|
||||
|
||||
1.2.2 / 2014-05-27
|
||||
==================
|
||||
|
||||
* deps: raw-body@1.1.6
|
||||
- assert stream encoding on node.js 0.8
|
||||
- assert stream encoding on node.js < 0.10.6
|
||||
- deps: bytes@1
|
||||
|
||||
1.2.1 / 2014-05-26
|
||||
==================
|
||||
|
||||
* invoke `next(err)` after request fully read
|
||||
- prevents hung responses and socket hang ups
|
||||
|
||||
1.2.0 / 2014-05-11
|
||||
==================
|
||||
|
||||
* add `verify` option
|
||||
* deps: type-is@1.2.0
|
||||
- support suffix matching
|
||||
|
||||
1.1.2 / 2014-05-11
|
||||
==================
|
||||
|
||||
* improve json parser speed
|
||||
|
||||
1.1.1 / 2014-05-11
|
||||
==================
|
||||
|
||||
* fix repeated limit parsing with every request
|
||||
|
||||
1.1.0 / 2014-05-10
|
||||
==================
|
||||
|
||||
* add `type` option
|
||||
* deps: pin for safety and consistency
|
||||
|
||||
1.0.2 / 2014-04-14
|
||||
==================
|
||||
|
||||
* use `type-is` module
|
||||
|
||||
1.0.1 / 2014-03-20
|
||||
==================
|
||||
|
||||
* lower default limits to 100kb
|
||||
23
node_modules/express/node_modules/body-parser/LICENSE
generated
vendored
Normal file
23
node_modules/express/node_modules/body-parser/LICENSE
generated
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
(The MIT License)
|
||||
|
||||
Copyright (c) 2014 Jonathan Ong <me@jongleberry.com>
|
||||
Copyright (c) 2014-2015 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.
|
||||
438
node_modules/express/node_modules/body-parser/README.md
generated
vendored
Normal file
438
node_modules/express/node_modules/body-parser/README.md
generated
vendored
Normal file
@ -0,0 +1,438 @@
|
||||
# body-parser
|
||||
|
||||
[![NPM Version][npm-image]][npm-url]
|
||||
[![NPM Downloads][downloads-image]][downloads-url]
|
||||
[![Build Status][travis-image]][travis-url]
|
||||
[![Test Coverage][coveralls-image]][coveralls-url]
|
||||
[![Gratipay][gratipay-image]][gratipay-url]
|
||||
|
||||
Node.js body parsing middleware.
|
||||
|
||||
Parse incoming request bodies in a middleware before your handlers, available
|
||||
under the `req.body` property.
|
||||
|
||||
[Learn about the anatomy of an HTTP transaction in Node.js](https://nodejs.org/en/docs/guides/anatomy-of-an-http-transaction/).
|
||||
|
||||
_This does not handle multipart bodies_, due to their complex and typically
|
||||
large nature. For multipart bodies, you may be interested in the following
|
||||
modules:
|
||||
|
||||
* [busboy](https://www.npmjs.org/package/busboy#readme) and
|
||||
[connect-busboy](https://www.npmjs.org/package/connect-busboy#readme)
|
||||
* [multiparty](https://www.npmjs.org/package/multiparty#readme) and
|
||||
[connect-multiparty](https://www.npmjs.org/package/connect-multiparty#readme)
|
||||
* [formidable](https://www.npmjs.org/package/formidable#readme)
|
||||
* [multer](https://www.npmjs.org/package/multer#readme)
|
||||
|
||||
This module provides the following parsers:
|
||||
|
||||
* [JSON body parser](#bodyparserjsonoptions)
|
||||
* [Raw body parser](#bodyparserrawoptions)
|
||||
* [Text body parser](#bodyparsertextoptions)
|
||||
* [URL-encoded form body parser](#bodyparserurlencodedoptions)
|
||||
|
||||
Other body parsers you might be interested in:
|
||||
|
||||
- [body](https://www.npmjs.org/package/body#readme)
|
||||
- [co-body](https://www.npmjs.org/package/co-body#readme)
|
||||
|
||||
## Installation
|
||||
|
||||
```sh
|
||||
$ npm install body-parser
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
<!-- eslint-disable no-unused-vars -->
|
||||
|
||||
```js
|
||||
var bodyParser = require('body-parser')
|
||||
```
|
||||
|
||||
The `bodyParser` object exposes various factories to create middlewares. All
|
||||
middlewares will populate the `req.body` property with the parsed body when
|
||||
the `Content-Type` request header matches the `type` option, or an empty
|
||||
object (`{}`) if there was no body to parse, the `Content-Type` was not matched,
|
||||
or an error occurred.
|
||||
|
||||
The various errors returned by this module are described in the
|
||||
[errors section](#errors).
|
||||
|
||||
### bodyParser.json([options])
|
||||
|
||||
Returns middleware that only parses `json` and only looks at requests where
|
||||
the `Content-Type` header matches the `type` option. This parser accepts any
|
||||
Unicode encoding of the body and supports automatic inflation of `gzip` and
|
||||
`deflate` encodings.
|
||||
|
||||
A new `body` object containing the parsed data is populated on the `request`
|
||||
object after the middleware (i.e. `req.body`).
|
||||
|
||||
#### Options
|
||||
|
||||
The `json` function takes an optional `options` object that may contain any of
|
||||
the following keys:
|
||||
|
||||
##### inflate
|
||||
|
||||
When set to `true`, then deflated (compressed) bodies will be inflated; when
|
||||
`false`, deflated bodies are rejected. Defaults to `true`.
|
||||
|
||||
##### limit
|
||||
|
||||
Controls the maximum request body size. If this is a number, then the value
|
||||
specifies the number of bytes; if it is a string, the value is passed to the
|
||||
[bytes](https://www.npmjs.com/package/bytes) library for parsing. Defaults
|
||||
to `'100kb'`.
|
||||
|
||||
##### reviver
|
||||
|
||||
The `reviver` option is passed directly to `JSON.parse` as the second
|
||||
argument. You can find more information on this argument
|
||||
[in the MDN documentation about JSON.parse](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse#Example.3A_Using_the_reviver_parameter).
|
||||
|
||||
##### strict
|
||||
|
||||
When set to `true`, will only accept arrays and objects; when `false` will
|
||||
accept anything `JSON.parse` accepts. Defaults to `true`.
|
||||
|
||||
##### type
|
||||
|
||||
The `type` option is used to determine what media type the middleware will
|
||||
parse. This option can be a function or a string. If a string, `type` option
|
||||
is passed directly to the [type-is](https://www.npmjs.org/package/type-is#readme)
|
||||
library and this can be an extension name (like `json`), a mime type (like
|
||||
`application/json`), or a mime type with a wildcard (like `*/*` or `*/json`).
|
||||
If a function, the `type` option is called as `fn(req)` and the request is
|
||||
parsed if it returns a truthy value. Defaults to `application/json`.
|
||||
|
||||
##### verify
|
||||
|
||||
The `verify` option, if supplied, is called as `verify(req, res, buf, encoding)`,
|
||||
where `buf` is a `Buffer` of the raw request body and `encoding` is the
|
||||
encoding of the request. The parsing can be aborted by throwing an error.
|
||||
|
||||
### bodyParser.raw([options])
|
||||
|
||||
Returns middleware that parses all bodies as a `Buffer` and only looks at
|
||||
requests where the `Content-Type` header matches the `type` option. This
|
||||
parser supports automatic inflation of `gzip` and `deflate` encodings.
|
||||
|
||||
A new `body` object containing the parsed data is populated on the `request`
|
||||
object after the middleware (i.e. `req.body`). This will be a `Buffer` object
|
||||
of the body.
|
||||
|
||||
#### Options
|
||||
|
||||
The `raw` function takes an optional `options` object that may contain any of
|
||||
the following keys:
|
||||
|
||||
##### inflate
|
||||
|
||||
When set to `true`, then deflated (compressed) bodies will be inflated; when
|
||||
`false`, deflated bodies are rejected. Defaults to `true`.
|
||||
|
||||
##### limit
|
||||
|
||||
Controls the maximum request body size. If this is a number, then the value
|
||||
specifies the number of bytes; if it is a string, the value is passed to the
|
||||
[bytes](https://www.npmjs.com/package/bytes) library for parsing. Defaults
|
||||
to `'100kb'`.
|
||||
|
||||
##### type
|
||||
|
||||
The `type` option is used to determine what media type the middleware will
|
||||
parse. This option can be a function or a string. If a string, `type` option
|
||||
is passed directly to the [type-is](https://www.npmjs.org/package/type-is#readme)
|
||||
library and this can be an extension name (like `bin`), a mime type (like
|
||||
`application/octet-stream`), or a mime type with a wildcard (like `*/*` or
|
||||
`application/*`). If a function, the `type` option is called as `fn(req)`
|
||||
and the request is parsed if it returns a truthy value. Defaults to
|
||||
`application/octet-stream`.
|
||||
|
||||
##### verify
|
||||
|
||||
The `verify` option, if supplied, is called as `verify(req, res, buf, encoding)`,
|
||||
where `buf` is a `Buffer` of the raw request body and `encoding` is the
|
||||
encoding of the request. The parsing can be aborted by throwing an error.
|
||||
|
||||
### bodyParser.text([options])
|
||||
|
||||
Returns middleware that parses all bodies as a string and only looks at
|
||||
requests where the `Content-Type` header matches the `type` option. This
|
||||
parser supports automatic inflation of `gzip` and `deflate` encodings.
|
||||
|
||||
A new `body` string containing the parsed data is populated on the `request`
|
||||
object after the middleware (i.e. `req.body`). This will be a string of the
|
||||
body.
|
||||
|
||||
#### Options
|
||||
|
||||
The `text` function takes an optional `options` object that may contain any of
|
||||
the following keys:
|
||||
|
||||
##### defaultCharset
|
||||
|
||||
Specify the default character set for the text content if the charset is not
|
||||
specified in the `Content-Type` header of the request. Defaults to `utf-8`.
|
||||
|
||||
##### inflate
|
||||
|
||||
When set to `true`, then deflated (compressed) bodies will be inflated; when
|
||||
`false`, deflated bodies are rejected. Defaults to `true`.
|
||||
|
||||
##### limit
|
||||
|
||||
Controls the maximum request body size. If this is a number, then the value
|
||||
specifies the number of bytes; if it is a string, the value is passed to the
|
||||
[bytes](https://www.npmjs.com/package/bytes) library for parsing. Defaults
|
||||
to `'100kb'`.
|
||||
|
||||
##### type
|
||||
|
||||
The `type` option is used to determine what media type the middleware will
|
||||
parse. This option can be a function or a string. If a string, `type` option
|
||||
is passed directly to the [type-is](https://www.npmjs.org/package/type-is#readme)
|
||||
library and this can be an extension name (like `txt`), a mime type (like
|
||||
`text/plain`), or a mime type with a wildcard (like `*/*` or `text/*`).
|
||||
If a function, the `type` option is called as `fn(req)` and the request is
|
||||
parsed if it returns a truthy value. Defaults to `text/plain`.
|
||||
|
||||
##### verify
|
||||
|
||||
The `verify` option, if supplied, is called as `verify(req, res, buf, encoding)`,
|
||||
where `buf` is a `Buffer` of the raw request body and `encoding` is the
|
||||
encoding of the request. The parsing can be aborted by throwing an error.
|
||||
|
||||
### bodyParser.urlencoded([options])
|
||||
|
||||
Returns middleware that only parses `urlencoded` bodies and only looks at
|
||||
requests where the `Content-Type` header matches the `type` option. This
|
||||
parser accepts only UTF-8 encoding of the body and supports automatic
|
||||
inflation of `gzip` and `deflate` encodings.
|
||||
|
||||
A new `body` object containing the parsed data is populated on the `request`
|
||||
object after the middleware (i.e. `req.body`). This object will contain
|
||||
key-value pairs, where the value can be a string or array (when `extended` is
|
||||
`false`), or any type (when `extended` is `true`).
|
||||
|
||||
#### Options
|
||||
|
||||
The `urlencoded` function takes an optional `options` object that may contain
|
||||
any of the following keys:
|
||||
|
||||
##### extended
|
||||
|
||||
The `extended` option allows to choose between parsing the URL-encoded data
|
||||
with the `querystring` library (when `false`) or the `qs` library (when
|
||||
`true`). The "extended" syntax allows for rich objects and arrays to be
|
||||
encoded into the URL-encoded format, allowing for a JSON-like experience
|
||||
with URL-encoded. For more information, please
|
||||
[see the qs library](https://www.npmjs.org/package/qs#readme).
|
||||
|
||||
Defaults to `true`, but using the default has been deprecated. Please
|
||||
research into the difference between `qs` and `querystring` and choose the
|
||||
appropriate setting.
|
||||
|
||||
##### inflate
|
||||
|
||||
When set to `true`, then deflated (compressed) bodies will be inflated; when
|
||||
`false`, deflated bodies are rejected. Defaults to `true`.
|
||||
|
||||
##### limit
|
||||
|
||||
Controls the maximum request body size. If this is a number, then the value
|
||||
specifies the number of bytes; if it is a string, the value is passed to the
|
||||
[bytes](https://www.npmjs.com/package/bytes) library for parsing. Defaults
|
||||
to `'100kb'`.
|
||||
|
||||
##### parameterLimit
|
||||
|
||||
The `parameterLimit` option controls the maximum number of parameters that
|
||||
are allowed in the URL-encoded data. If a request contains more parameters
|
||||
than this value, a 413 will be returned to the client. Defaults to `1000`.
|
||||
|
||||
##### type
|
||||
|
||||
The `type` option is used to determine what media type the middleware will
|
||||
parse. This option can be a function or a string. If a string, `type` option
|
||||
is passed directly to the [type-is](https://www.npmjs.org/package/type-is#readme)
|
||||
library and this can be an extension name (like `urlencoded`), a mime type (like
|
||||
`application/x-www-form-urlencoded`), or a mime type with a wildcard (like
|
||||
`*/x-www-form-urlencoded`). If a function, the `type` option is called as
|
||||
`fn(req)` and the request is parsed if it returns a truthy value. Defaults
|
||||
to `application/x-www-form-urlencoded`.
|
||||
|
||||
##### verify
|
||||
|
||||
The `verify` option, if supplied, is called as `verify(req, res, buf, encoding)`,
|
||||
where `buf` is a `Buffer` of the raw request body and `encoding` is the
|
||||
encoding of the request. The parsing can be aborted by throwing an error.
|
||||
|
||||
## Errors
|
||||
|
||||
The middlewares provided by this module create errors depending on the error
|
||||
condition during parsing. The errors will typically have a `status`/`statusCode`
|
||||
property that contains the suggested HTTP response code, an `expose` property
|
||||
to determine if the `message` property should be displayed to the client, a
|
||||
`type` property to determine the type of error without matching against the
|
||||
`message`, and a `body` property containing the read body, if available.
|
||||
|
||||
The following are the common errors emitted, though any error can come through
|
||||
for various reasons.
|
||||
|
||||
### content encoding unsupported
|
||||
|
||||
This error will occur when the request had a `Content-Encoding` header that
|
||||
contained an encoding but the "inflation" option was set to `false`. The
|
||||
`status` property is set to `415`, the `type` property is set to
|
||||
`'encoding.unsupported'`, and the `charset` property will be set to the
|
||||
encoding that is unsupported.
|
||||
|
||||
### request aborted
|
||||
|
||||
This error will occur when the request is aborted by the client before reading
|
||||
the body has finished. The `received` property will be set to the number of
|
||||
bytes received before the request was aborted and the `expected` property is
|
||||
set to the number of expected bytes. The `status` property is set to `400`
|
||||
and `type` property is set to `'request.aborted'`.
|
||||
|
||||
### request entity too large
|
||||
|
||||
This error will occur when the request body's size is larger than the "limit"
|
||||
option. The `limit` property will be set to the byte limit and the `length`
|
||||
property will be set to the request body's length. The `status` property is
|
||||
set to `413` and the `type` property is set to `'entity.too.large'`.
|
||||
|
||||
### request size did not match content length
|
||||
|
||||
This error will occur when the request's length did not match the length from
|
||||
the `Content-Length` header. This typically occurs when the request is malformed,
|
||||
typically when the `Content-Length` header was calculated based on characters
|
||||
instead of bytes. The `status` property is set to `400` and the `type` property
|
||||
is set to `'request.size.invalid'`.
|
||||
|
||||
### stream encoding should not be set
|
||||
|
||||
This error will occur when something called the `req.setEncoding` method prior
|
||||
to this middleware. This module operates directly on bytes only and you cannot
|
||||
call `req.setEncoding` when using this module. The `status` property is set to
|
||||
`500` and the `type` property is set to `'stream.encoding.set'`.
|
||||
|
||||
### too many parameters
|
||||
|
||||
This error will occur when the content of the request exceeds the configured
|
||||
`parameterLimit` for the `urlencoded` parser. The `status` property is set to
|
||||
`413` and the `type` property is set to `'parameters.too.many'`.
|
||||
|
||||
### unsupported charset "BOGUS"
|
||||
|
||||
This error will occur when the request had a charset parameter in the
|
||||
`Content-Type` header, but the `iconv-lite` module does not support it OR the
|
||||
parser does not support it. The charset is contained in the message as well
|
||||
as in the `charset` property. The `status` property is set to `415`, the
|
||||
`type` property is set to `'charset.unsupported'`, and the `charset` property
|
||||
is set to the charset that is unsupported.
|
||||
|
||||
### unsupported content encoding "bogus"
|
||||
|
||||
This error will occur when the request had a `Content-Encoding` header that
|
||||
contained an unsupported encoding. The encoding is contained in the message
|
||||
as well as in the `encoding` property. The `status` property is set to `415`,
|
||||
the `type` property is set to `'encoding.unsupported'`, and the `encoding`
|
||||
property is set to the encoding that is unsupported.
|
||||
|
||||
## Examples
|
||||
|
||||
### Express/Connect top-level generic
|
||||
|
||||
This example demonstrates adding a generic JSON and URL-encoded parser as a
|
||||
top-level middleware, which will parse the bodies of all incoming requests.
|
||||
This is the simplest setup.
|
||||
|
||||
```js
|
||||
var express = require('express')
|
||||
var bodyParser = require('body-parser')
|
||||
|
||||
var app = express()
|
||||
|
||||
// parse application/x-www-form-urlencoded
|
||||
app.use(bodyParser.urlencoded({ extended: false }))
|
||||
|
||||
// parse application/json
|
||||
app.use(bodyParser.json())
|
||||
|
||||
app.use(function (req, res) {
|
||||
res.setHeader('Content-Type', 'text/plain')
|
||||
res.write('you posted:\n')
|
||||
res.end(JSON.stringify(req.body, null, 2))
|
||||
})
|
||||
```
|
||||
|
||||
### Express route-specific
|
||||
|
||||
This example demonstrates adding body parsers specifically to the routes that
|
||||
need them. In general, this is the most recommended way to use body-parser with
|
||||
Express.
|
||||
|
||||
```js
|
||||
var express = require('express')
|
||||
var bodyParser = require('body-parser')
|
||||
|
||||
var app = express()
|
||||
|
||||
// create application/json parser
|
||||
var jsonParser = bodyParser.json()
|
||||
|
||||
// create application/x-www-form-urlencoded parser
|
||||
var urlencodedParser = bodyParser.urlencoded({ extended: false })
|
||||
|
||||
// POST /login gets urlencoded bodies
|
||||
app.post('/login', urlencodedParser, function (req, res) {
|
||||
if (!req.body) return res.sendStatus(400)
|
||||
res.send('welcome, ' + req.body.username)
|
||||
})
|
||||
|
||||
// POST /api/users gets JSON bodies
|
||||
app.post('/api/users', jsonParser, function (req, res) {
|
||||
if (!req.body) return res.sendStatus(400)
|
||||
// create user in req.body
|
||||
})
|
||||
```
|
||||
|
||||
### Change accepted type for parsers
|
||||
|
||||
All the parsers accept a `type` option which allows you to change the
|
||||
`Content-Type` that the middleware will parse.
|
||||
|
||||
```js
|
||||
var express = require('express')
|
||||
var bodyParser = require('body-parser')
|
||||
|
||||
var app = express()
|
||||
|
||||
// parse various different custom JSON types as JSON
|
||||
app.use(bodyParser.json({ type: 'application/*+json' }))
|
||||
|
||||
// parse some custom thing into a Buffer
|
||||
app.use(bodyParser.raw({ type: 'application/vnd.custom-type' }))
|
||||
|
||||
// parse an HTML body into a string
|
||||
app.use(bodyParser.text({ type: 'text/html' }))
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
[MIT](LICENSE)
|
||||
|
||||
[npm-image]: https://img.shields.io/npm/v/body-parser.svg
|
||||
[npm-url]: https://npmjs.org/package/body-parser
|
||||
[travis-image]: https://img.shields.io/travis/expressjs/body-parser/master.svg
|
||||
[travis-url]: https://travis-ci.org/expressjs/body-parser
|
||||
[coveralls-image]: https://img.shields.io/coveralls/expressjs/body-parser/master.svg
|
||||
[coveralls-url]: https://coveralls.io/r/expressjs/body-parser?branch=master
|
||||
[downloads-image]: https://img.shields.io/npm/dm/body-parser.svg
|
||||
[downloads-url]: https://npmjs.org/package/body-parser
|
||||
[gratipay-image]: https://img.shields.io/gratipay/dougwilson.svg
|
||||
[gratipay-url]: https://www.gratipay.com/dougwilson/
|
||||
157
node_modules/express/node_modules/body-parser/index.js
generated
vendored
Normal file
157
node_modules/express/node_modules/body-parser/index.js
generated
vendored
Normal file
@ -0,0 +1,157 @@
|
||||
/*!
|
||||
* body-parser
|
||||
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
||||
* MIT Licensed
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
/**
|
||||
* Module dependencies.
|
||||
* @private
|
||||
*/
|
||||
|
||||
var deprecate = require('depd')('body-parser')
|
||||
|
||||
/**
|
||||
* Cache of loaded parsers.
|
||||
* @private
|
||||
*/
|
||||
|
||||
var parsers = Object.create(null)
|
||||
|
||||
/**
|
||||
* @typedef Parsers
|
||||
* @type {function}
|
||||
* @property {function} json
|
||||
* @property {function} raw
|
||||
* @property {function} text
|
||||
* @property {function} urlencoded
|
||||
*/
|
||||
|
||||
/**
|
||||
* Module exports.
|
||||
* @type {Parsers}
|
||||
*/
|
||||
|
||||
exports = module.exports = deprecate.function(bodyParser,
|
||||
'bodyParser: use individual json/urlencoded middlewares')
|
||||
|
||||
/**
|
||||
* JSON parser.
|
||||
* @public
|
||||
*/
|
||||
|
||||
Object.defineProperty(exports, 'json', {
|
||||
configurable: true,
|
||||
enumerable: true,
|
||||
get: createParserGetter('json')
|
||||
})
|
||||
|
||||
/**
|
||||
* Raw parser.
|
||||
* @public
|
||||
*/
|
||||
|
||||
Object.defineProperty(exports, 'raw', {
|
||||
configurable: true,
|
||||
enumerable: true,
|
||||
get: createParserGetter('raw')
|
||||
})
|
||||
|
||||
/**
|
||||
* Text parser.
|
||||
* @public
|
||||
*/
|
||||
|
||||
Object.defineProperty(exports, 'text', {
|
||||
configurable: true,
|
||||
enumerable: true,
|
||||
get: createParserGetter('text')
|
||||
})
|
||||
|
||||
/**
|
||||
* URL-encoded parser.
|
||||
* @public
|
||||
*/
|
||||
|
||||
Object.defineProperty(exports, 'urlencoded', {
|
||||
configurable: true,
|
||||
enumerable: true,
|
||||
get: createParserGetter('urlencoded')
|
||||
})
|
||||
|
||||
/**
|
||||
* Create a middleware to parse json and urlencoded bodies.
|
||||
*
|
||||
* @param {object} [options]
|
||||
* @return {function}
|
||||
* @deprecated
|
||||
* @public
|
||||
*/
|
||||
|
||||
function bodyParser (options) {
|
||||
var opts = {}
|
||||
|
||||
// exclude type option
|
||||
if (options) {
|
||||
for (var prop in options) {
|
||||
if (prop !== 'type') {
|
||||
opts[prop] = options[prop]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var _urlencoded = exports.urlencoded(opts)
|
||||
var _json = exports.json(opts)
|
||||
|
||||
return function bodyParser (req, res, next) {
|
||||
_json(req, res, function (err) {
|
||||
if (err) return next(err)
|
||||
_urlencoded(req, res, next)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a getter for loading a parser.
|
||||
* @private
|
||||
*/
|
||||
|
||||
function createParserGetter (name) {
|
||||
return function get () {
|
||||
return loadParser(name)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Load a parser module.
|
||||
* @private
|
||||
*/
|
||||
|
||||
function loadParser (parserName) {
|
||||
var parser = parsers[parserName]
|
||||
|
||||
if (parser !== undefined) {
|
||||
return parser
|
||||
}
|
||||
|
||||
// this uses a switch for static require analysis
|
||||
switch (parserName) {
|
||||
case 'json':
|
||||
parser = require('./lib/types/json')
|
||||
break
|
||||
case 'raw':
|
||||
parser = require('./lib/types/raw')
|
||||
break
|
||||
case 'text':
|
||||
parser = require('./lib/types/text')
|
||||
break
|
||||
case 'urlencoded':
|
||||
parser = require('./lib/types/urlencoded')
|
||||
break
|
||||
}
|
||||
|
||||
// store to prevent invoking require()
|
||||
return (parsers[parserName] = parser)
|
||||
}
|
||||
181
node_modules/express/node_modules/body-parser/lib/read.js
generated
vendored
Normal file
181
node_modules/express/node_modules/body-parser/lib/read.js
generated
vendored
Normal file
@ -0,0 +1,181 @@
|
||||
/*!
|
||||
* body-parser
|
||||
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
||||
* MIT Licensed
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
/**
|
||||
* Module dependencies.
|
||||
* @private
|
||||
*/
|
||||
|
||||
var createError = require('http-errors')
|
||||
var getBody = require('raw-body')
|
||||
var iconv = require('iconv-lite')
|
||||
var onFinished = require('on-finished')
|
||||
var zlib = require('zlib')
|
||||
|
||||
/**
|
||||
* Module exports.
|
||||
*/
|
||||
|
||||
module.exports = read
|
||||
|
||||
/**
|
||||
* Read a request into a buffer and parse.
|
||||
*
|
||||
* @param {object} req
|
||||
* @param {object} res
|
||||
* @param {function} next
|
||||
* @param {function} parse
|
||||
* @param {function} debug
|
||||
* @param {object} options
|
||||
* @private
|
||||
*/
|
||||
|
||||
function read (req, res, next, parse, debug, options) {
|
||||
var length
|
||||
var opts = options
|
||||
var stream
|
||||
|
||||
// flag as parsed
|
||||
req._body = true
|
||||
|
||||
// read options
|
||||
var encoding = opts.encoding !== null
|
||||
? opts.encoding
|
||||
: null
|
||||
var verify = opts.verify
|
||||
|
||||
try {
|
||||
// get the content stream
|
||||
stream = contentstream(req, debug, opts.inflate)
|
||||
length = stream.length
|
||||
stream.length = undefined
|
||||
} catch (err) {
|
||||
return next(err)
|
||||
}
|
||||
|
||||
// set raw-body options
|
||||
opts.length = length
|
||||
opts.encoding = verify
|
||||
? null
|
||||
: encoding
|
||||
|
||||
// assert charset is supported
|
||||
if (opts.encoding === null && encoding !== null && !iconv.encodingExists(encoding)) {
|
||||
return next(createError(415, 'unsupported charset "' + encoding.toUpperCase() + '"', {
|
||||
charset: encoding.toLowerCase(),
|
||||
type: 'charset.unsupported'
|
||||
}))
|
||||
}
|
||||
|
||||
// read body
|
||||
debug('read body')
|
||||
getBody(stream, opts, function (error, body) {
|
||||
if (error) {
|
||||
var _error
|
||||
|
||||
if (error.type === 'encoding.unsupported') {
|
||||
// echo back charset
|
||||
_error = createError(415, 'unsupported charset "' + encoding.toUpperCase() + '"', {
|
||||
charset: encoding.toLowerCase(),
|
||||
type: 'charset.unsupported'
|
||||
})
|
||||
} else {
|
||||
// set status code on error
|
||||
_error = createError(400, error)
|
||||
}
|
||||
|
||||
// read off entire request
|
||||
stream.resume()
|
||||
onFinished(req, function onfinished () {
|
||||
next(createError(400, _error))
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
// verify
|
||||
if (verify) {
|
||||
try {
|
||||
debug('verify body')
|
||||
verify(req, res, body, encoding)
|
||||
} catch (err) {
|
||||
next(createError(403, err, {
|
||||
body: body,
|
||||
type: err.type || 'entity.verify.failed'
|
||||
}))
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
// parse
|
||||
var str = body
|
||||
try {
|
||||
debug('parse body')
|
||||
str = typeof body !== 'string' && encoding !== null
|
||||
? iconv.decode(body, encoding)
|
||||
: body
|
||||
req.body = parse(str)
|
||||
} catch (err) {
|
||||
next(createError(400, err, {
|
||||
body: str,
|
||||
type: err.type || 'entity.parse.failed'
|
||||
}))
|
||||
return
|
||||
}
|
||||
|
||||
next()
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the content stream of the request.
|
||||
*
|
||||
* @param {object} req
|
||||
* @param {function} debug
|
||||
* @param {boolean} [inflate=true]
|
||||
* @return {object}
|
||||
* @api private
|
||||
*/
|
||||
|
||||
function contentstream (req, debug, inflate) {
|
||||
var encoding = (req.headers['content-encoding'] || 'identity').toLowerCase()
|
||||
var length = req.headers['content-length']
|
||||
var stream
|
||||
|
||||
debug('content-encoding "%s"', encoding)
|
||||
|
||||
if (inflate === false && encoding !== 'identity') {
|
||||
throw createError(415, 'content encoding unsupported', {
|
||||
encoding: encoding,
|
||||
type: 'encoding.unsupported'
|
||||
})
|
||||
}
|
||||
|
||||
switch (encoding) {
|
||||
case 'deflate':
|
||||
stream = zlib.createInflate()
|
||||
debug('inflate body')
|
||||
req.pipe(stream)
|
||||
break
|
||||
case 'gzip':
|
||||
stream = zlib.createGunzip()
|
||||
debug('gunzip body')
|
||||
req.pipe(stream)
|
||||
break
|
||||
case 'identity':
|
||||
stream = req
|
||||
stream.length = length
|
||||
break
|
||||
default:
|
||||
throw createError(415, 'unsupported content encoding "' + encoding + '"', {
|
||||
encoding: encoding,
|
||||
type: 'encoding.unsupported'
|
||||
})
|
||||
}
|
||||
|
||||
return stream
|
||||
}
|
||||
232
node_modules/express/node_modules/body-parser/lib/types/json.js
generated
vendored
Normal file
232
node_modules/express/node_modules/body-parser/lib/types/json.js
generated
vendored
Normal file
@ -0,0 +1,232 @@
|
||||
/*!
|
||||
* body-parser
|
||||
* Copyright(c) 2014 Jonathan Ong
|
||||
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
||||
* MIT Licensed
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
/**
|
||||
* Module dependencies.
|
||||
* @private
|
||||
*/
|
||||
|
||||
var bytes = require('bytes')
|
||||
var contentType = require('content-type')
|
||||
var createError = require('http-errors')
|
||||
var debug = require('debug')('body-parser:json')
|
||||
var read = require('../read')
|
||||
var typeis = require('type-is')
|
||||
|
||||
/**
|
||||
* Module exports.
|
||||
*/
|
||||
|
||||
module.exports = json
|
||||
|
||||
/**
|
||||
* RegExp to match the first non-space in a string.
|
||||
*
|
||||
* Allowed whitespace is defined in RFC 7159:
|
||||
*
|
||||
* ws = *(
|
||||
* %x20 / ; Space
|
||||
* %x09 / ; Horizontal tab
|
||||
* %x0A / ; Line feed or New line
|
||||
* %x0D ) ; Carriage return
|
||||
*/
|
||||
|
||||
var FIRST_CHAR_REGEXP = /^[\x20\x09\x0a\x0d]*(.)/ // eslint-disable-line no-control-regex
|
||||
|
||||
/**
|
||||
* Create a middleware to parse JSON bodies.
|
||||
*
|
||||
* @param {object} [options]
|
||||
* @return {function}
|
||||
* @public
|
||||
*/
|
||||
|
||||
function json (options) {
|
||||
var opts = options || {}
|
||||
|
||||
var limit = typeof opts.limit !== 'number'
|
||||
? bytes.parse(opts.limit || '100kb')
|
||||
: opts.limit
|
||||
var inflate = opts.inflate !== false
|
||||
var reviver = opts.reviver
|
||||
var strict = opts.strict !== false
|
||||
var type = opts.type || 'application/json'
|
||||
var verify = opts.verify || false
|
||||
|
||||
if (verify !== false && typeof verify !== 'function') {
|
||||
throw new TypeError('option verify must be function')
|
||||
}
|
||||
|
||||
// create the appropriate type checking function
|
||||
var shouldParse = typeof type !== 'function'
|
||||
? typeChecker(type)
|
||||
: type
|
||||
|
||||
function parse (body) {
|
||||
if (body.length === 0) {
|
||||
// special-case empty json body, as it's a common client-side mistake
|
||||
// TODO: maybe make this configurable or part of "strict" option
|
||||
return {}
|
||||
}
|
||||
|
||||
if (strict) {
|
||||
var first = firstchar(body)
|
||||
|
||||
if (first !== '{' && first !== '[') {
|
||||
debug('strict violation')
|
||||
throw createStrictSyntaxError(body, first)
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
debug('parse json')
|
||||
return JSON.parse(body, reviver)
|
||||
} catch (e) {
|
||||
throw normalizeJsonSyntaxError(e, {
|
||||
stack: e.stack
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
return function jsonParser (req, res, next) {
|
||||
if (req._body) {
|
||||
debug('body already parsed')
|
||||
next()
|
||||
return
|
||||
}
|
||||
|
||||
req.body = req.body || {}
|
||||
|
||||
// skip requests without bodies
|
||||
if (!typeis.hasBody(req)) {
|
||||
debug('skip empty body')
|
||||
next()
|
||||
return
|
||||
}
|
||||
|
||||
debug('content-type %j', req.headers['content-type'])
|
||||
|
||||
// determine if request should be parsed
|
||||
if (!shouldParse(req)) {
|
||||
debug('skip parsing')
|
||||
next()
|
||||
return
|
||||
}
|
||||
|
||||
// assert charset per RFC 7159 sec 8.1
|
||||
var charset = getCharset(req) || 'utf-8'
|
||||
if (charset.substr(0, 4) !== 'utf-') {
|
||||
debug('invalid charset')
|
||||
next(createError(415, 'unsupported charset "' + charset.toUpperCase() + '"', {
|
||||
charset: charset,
|
||||
type: 'charset.unsupported'
|
||||
}))
|
||||
return
|
||||
}
|
||||
|
||||
// read
|
||||
read(req, res, next, parse, debug, {
|
||||
encoding: charset,
|
||||
inflate: inflate,
|
||||
limit: limit,
|
||||
verify: verify
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create strict violation syntax error matching native error.
|
||||
*
|
||||
* @param {string} str
|
||||
* @param {string} char
|
||||
* @return {Error}
|
||||
* @private
|
||||
*/
|
||||
|
||||
function createStrictSyntaxError (str, char) {
|
||||
var index = str.indexOf(char)
|
||||
var partial = str.substring(0, index) + '#'
|
||||
|
||||
try {
|
||||
JSON.parse(partial); /* istanbul ignore next */ throw new SyntaxError('strict violation')
|
||||
} catch (e) {
|
||||
return normalizeJsonSyntaxError(e, {
|
||||
message: e.message.replace('#', char),
|
||||
stack: e.stack
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the first non-whitespace character in a string.
|
||||
*
|
||||
* @param {string} str
|
||||
* @return {function}
|
||||
* @private
|
||||
*/
|
||||
|
||||
function firstchar (str) {
|
||||
return FIRST_CHAR_REGEXP.exec(str)[1]
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the charset of a request.
|
||||
*
|
||||
* @param {object} req
|
||||
* @api private
|
||||
*/
|
||||
|
||||
function getCharset (req) {
|
||||
try {
|
||||
return (contentType.parse(req).parameters.charset || '').toLowerCase()
|
||||
} catch (e) {
|
||||
return undefined
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Normalize a SyntaxError for JSON.parse.
|
||||
*
|
||||
* @param {SyntaxError} error
|
||||
* @param {object} obj
|
||||
* @return {SyntaxError}
|
||||
*/
|
||||
|
||||
function normalizeJsonSyntaxError (error, obj) {
|
||||
var keys = Object.getOwnPropertyNames(error)
|
||||
|
||||
for (var i = 0; i < keys.length; i++) {
|
||||
var key = keys[i]
|
||||
if (key !== 'stack' && key !== 'message') {
|
||||
delete error[key]
|
||||
}
|
||||
}
|
||||
|
||||
var props = Object.keys(obj)
|
||||
|
||||
for (var j = 0; j < props.length; j++) {
|
||||
var prop = props[j]
|
||||
error[prop] = obj[prop]
|
||||
}
|
||||
|
||||
return error
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the simple type checker.
|
||||
*
|
||||
* @param {string} type
|
||||
* @return {function}
|
||||
*/
|
||||
|
||||
function typeChecker (type) {
|
||||
return function checkType (req) {
|
||||
return Boolean(typeis(req, type))
|
||||
}
|
||||
}
|
||||
101
node_modules/express/node_modules/body-parser/lib/types/raw.js
generated
vendored
Normal file
101
node_modules/express/node_modules/body-parser/lib/types/raw.js
generated
vendored
Normal file
@ -0,0 +1,101 @@
|
||||
/*!
|
||||
* body-parser
|
||||
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
||||
* MIT Licensed
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
/**
|
||||
* Module dependencies.
|
||||
*/
|
||||
|
||||
var bytes = require('bytes')
|
||||
var debug = require('debug')('body-parser:raw')
|
||||
var read = require('../read')
|
||||
var typeis = require('type-is')
|
||||
|
||||
/**
|
||||
* Module exports.
|
||||
*/
|
||||
|
||||
module.exports = raw
|
||||
|
||||
/**
|
||||
* Create a middleware to parse raw bodies.
|
||||
*
|
||||
* @param {object} [options]
|
||||
* @return {function}
|
||||
* @api public
|
||||
*/
|
||||
|
||||
function raw (options) {
|
||||
var opts = options || {}
|
||||
|
||||
var inflate = opts.inflate !== false
|
||||
var limit = typeof opts.limit !== 'number'
|
||||
? bytes.parse(opts.limit || '100kb')
|
||||
: opts.limit
|
||||
var type = opts.type || 'application/octet-stream'
|
||||
var verify = opts.verify || false
|
||||
|
||||
if (verify !== false && typeof verify !== 'function') {
|
||||
throw new TypeError('option verify must be function')
|
||||
}
|
||||
|
||||
// create the appropriate type checking function
|
||||
var shouldParse = typeof type !== 'function'
|
||||
? typeChecker(type)
|
||||
: type
|
||||
|
||||
function parse (buf) {
|
||||
return buf
|
||||
}
|
||||
|
||||
return function rawParser (req, res, next) {
|
||||
if (req._body) {
|
||||
debug('body already parsed')
|
||||
next()
|
||||
return
|
||||
}
|
||||
|
||||
req.body = req.body || {}
|
||||
|
||||
// skip requests without bodies
|
||||
if (!typeis.hasBody(req)) {
|
||||
debug('skip empty body')
|
||||
next()
|
||||
return
|
||||
}
|
||||
|
||||
debug('content-type %j', req.headers['content-type'])
|
||||
|
||||
// determine if request should be parsed
|
||||
if (!shouldParse(req)) {
|
||||
debug('skip parsing')
|
||||
next()
|
||||
return
|
||||
}
|
||||
|
||||
// read
|
||||
read(req, res, next, parse, debug, {
|
||||
encoding: null,
|
||||
inflate: inflate,
|
||||
limit: limit,
|
||||
verify: verify
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the simple type checker.
|
||||
*
|
||||
* @param {string} type
|
||||
* @return {function}
|
||||
*/
|
||||
|
||||
function typeChecker (type) {
|
||||
return function checkType (req) {
|
||||
return Boolean(typeis(req, type))
|
||||
}
|
||||
}
|
||||
121
node_modules/express/node_modules/body-parser/lib/types/text.js
generated
vendored
Normal file
121
node_modules/express/node_modules/body-parser/lib/types/text.js
generated
vendored
Normal file
@ -0,0 +1,121 @@
|
||||
/*!
|
||||
* body-parser
|
||||
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
||||
* MIT Licensed
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
/**
|
||||
* Module dependencies.
|
||||
*/
|
||||
|
||||
var bytes = require('bytes')
|
||||
var contentType = require('content-type')
|
||||
var debug = require('debug')('body-parser:text')
|
||||
var read = require('../read')
|
||||
var typeis = require('type-is')
|
||||
|
||||
/**
|
||||
* Module exports.
|
||||
*/
|
||||
|
||||
module.exports = text
|
||||
|
||||
/**
|
||||
* Create a middleware to parse text bodies.
|
||||
*
|
||||
* @param {object} [options]
|
||||
* @return {function}
|
||||
* @api public
|
||||
*/
|
||||
|
||||
function text (options) {
|
||||
var opts = options || {}
|
||||
|
||||
var defaultCharset = opts.defaultCharset || 'utf-8'
|
||||
var inflate = opts.inflate !== false
|
||||
var limit = typeof opts.limit !== 'number'
|
||||
? bytes.parse(opts.limit || '100kb')
|
||||
: opts.limit
|
||||
var type = opts.type || 'text/plain'
|
||||
var verify = opts.verify || false
|
||||
|
||||
if (verify !== false && typeof verify !== 'function') {
|
||||
throw new TypeError('option verify must be function')
|
||||
}
|
||||
|
||||
// create the appropriate type checking function
|
||||
var shouldParse = typeof type !== 'function'
|
||||
? typeChecker(type)
|
||||
: type
|
||||
|
||||
function parse (buf) {
|
||||
return buf
|
||||
}
|
||||
|
||||
return function textParser (req, res, next) {
|
||||
if (req._body) {
|
||||
debug('body already parsed')
|
||||
next()
|
||||
return
|
||||
}
|
||||
|
||||
req.body = req.body || {}
|
||||
|
||||
// skip requests without bodies
|
||||
if (!typeis.hasBody(req)) {
|
||||
debug('skip empty body')
|
||||
next()
|
||||
return
|
||||
}
|
||||
|
||||
debug('content-type %j', req.headers['content-type'])
|
||||
|
||||
// determine if request should be parsed
|
||||
if (!shouldParse(req)) {
|
||||
debug('skip parsing')
|
||||
next()
|
||||
return
|
||||
}
|
||||
|
||||
// get charset
|
||||
var charset = getCharset(req) || defaultCharset
|
||||
|
||||
// read
|
||||
read(req, res, next, parse, debug, {
|
||||
encoding: charset,
|
||||
inflate: inflate,
|
||||
limit: limit,
|
||||
verify: verify
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the charset of a request.
|
||||
*
|
||||
* @param {object} req
|
||||
* @api private
|
||||
*/
|
||||
|
||||
function getCharset (req) {
|
||||
try {
|
||||
return (contentType.parse(req).parameters.charset || '').toLowerCase()
|
||||
} catch (e) {
|
||||
return undefined
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the simple type checker.
|
||||
*
|
||||
* @param {string} type
|
||||
* @return {function}
|
||||
*/
|
||||
|
||||
function typeChecker (type) {
|
||||
return function checkType (req) {
|
||||
return Boolean(typeis(req, type))
|
||||
}
|
||||
}
|
||||
284
node_modules/express/node_modules/body-parser/lib/types/urlencoded.js
generated
vendored
Normal file
284
node_modules/express/node_modules/body-parser/lib/types/urlencoded.js
generated
vendored
Normal file
@ -0,0 +1,284 @@
|
||||
/*!
|
||||
* body-parser
|
||||
* Copyright(c) 2014 Jonathan Ong
|
||||
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
||||
* MIT Licensed
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
/**
|
||||
* Module dependencies.
|
||||
* @private
|
||||
*/
|
||||
|
||||
var bytes = require('bytes')
|
||||
var contentType = require('content-type')
|
||||
var createError = require('http-errors')
|
||||
var debug = require('debug')('body-parser:urlencoded')
|
||||
var deprecate = require('depd')('body-parser')
|
||||
var read = require('../read')
|
||||
var typeis = require('type-is')
|
||||
|
||||
/**
|
||||
* Module exports.
|
||||
*/
|
||||
|
||||
module.exports = urlencoded
|
||||
|
||||
/**
|
||||
* Cache of parser modules.
|
||||
*/
|
||||
|
||||
var parsers = Object.create(null)
|
||||
|
||||
/**
|
||||
* Create a middleware to parse urlencoded bodies.
|
||||
*
|
||||
* @param {object} [options]
|
||||
* @return {function}
|
||||
* @public
|
||||
*/
|
||||
|
||||
function urlencoded (options) {
|
||||
var opts = options || {}
|
||||
|
||||
// notice because option default will flip in next major
|
||||
if (opts.extended === undefined) {
|
||||
deprecate('undefined extended: provide extended option')
|
||||
}
|
||||
|
||||
var extended = opts.extended !== false
|
||||
var inflate = opts.inflate !== false
|
||||
var limit = typeof opts.limit !== 'number'
|
||||
? bytes.parse(opts.limit || '100kb')
|
||||
: opts.limit
|
||||
var type = opts.type || 'application/x-www-form-urlencoded'
|
||||
var verify = opts.verify || false
|
||||
|
||||
if (verify !== false && typeof verify !== 'function') {
|
||||
throw new TypeError('option verify must be function')
|
||||
}
|
||||
|
||||
// create the appropriate query parser
|
||||
var queryparse = extended
|
||||
? extendedparser(opts)
|
||||
: simpleparser(opts)
|
||||
|
||||
// create the appropriate type checking function
|
||||
var shouldParse = typeof type !== 'function'
|
||||
? typeChecker(type)
|
||||
: type
|
||||
|
||||
function parse (body) {
|
||||
return body.length
|
||||
? queryparse(body)
|
||||
: {}
|
||||
}
|
||||
|
||||
return function urlencodedParser (req, res, next) {
|
||||
if (req._body) {
|
||||
debug('body already parsed')
|
||||
next()
|
||||
return
|
||||
}
|
||||
|
||||
req.body = req.body || {}
|
||||
|
||||
// skip requests without bodies
|
||||
if (!typeis.hasBody(req)) {
|
||||
debug('skip empty body')
|
||||
next()
|
||||
return
|
||||
}
|
||||
|
||||
debug('content-type %j', req.headers['content-type'])
|
||||
|
||||
// determine if request should be parsed
|
||||
if (!shouldParse(req)) {
|
||||
debug('skip parsing')
|
||||
next()
|
||||
return
|
||||
}
|
||||
|
||||
// assert charset
|
||||
var charset = getCharset(req) || 'utf-8'
|
||||
if (charset !== 'utf-8') {
|
||||
debug('invalid charset')
|
||||
next(createError(415, 'unsupported charset "' + charset.toUpperCase() + '"', {
|
||||
charset: charset,
|
||||
type: 'charset.unsupported'
|
||||
}))
|
||||
return
|
||||
}
|
||||
|
||||
// read
|
||||
read(req, res, next, parse, debug, {
|
||||
debug: debug,
|
||||
encoding: charset,
|
||||
inflate: inflate,
|
||||
limit: limit,
|
||||
verify: verify
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the extended query parser.
|
||||
*
|
||||
* @param {object} options
|
||||
*/
|
||||
|
||||
function extendedparser (options) {
|
||||
var parameterLimit = options.parameterLimit !== undefined
|
||||
? options.parameterLimit
|
||||
: 1000
|
||||
var parse = parser('qs')
|
||||
|
||||
if (isNaN(parameterLimit) || parameterLimit < 1) {
|
||||
throw new TypeError('option parameterLimit must be a positive number')
|
||||
}
|
||||
|
||||
if (isFinite(parameterLimit)) {
|
||||
parameterLimit = parameterLimit | 0
|
||||
}
|
||||
|
||||
return function queryparse (body) {
|
||||
var paramCount = parameterCount(body, parameterLimit)
|
||||
|
||||
if (paramCount === undefined) {
|
||||
debug('too many parameters')
|
||||
throw createError(413, 'too many parameters', {
|
||||
type: 'parameters.too.many'
|
||||
})
|
||||
}
|
||||
|
||||
var arrayLimit = Math.max(100, paramCount)
|
||||
|
||||
debug('parse extended urlencoding')
|
||||
return parse(body, {
|
||||
allowPrototypes: true,
|
||||
arrayLimit: arrayLimit,
|
||||
depth: Infinity,
|
||||
parameterLimit: parameterLimit
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the charset of a request.
|
||||
*
|
||||
* @param {object} req
|
||||
* @api private
|
||||
*/
|
||||
|
||||
function getCharset (req) {
|
||||
try {
|
||||
return (contentType.parse(req).parameters.charset || '').toLowerCase()
|
||||
} catch (e) {
|
||||
return undefined
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Count the number of parameters, stopping once limit reached
|
||||
*
|
||||
* @param {string} body
|
||||
* @param {number} limit
|
||||
* @api private
|
||||
*/
|
||||
|
||||
function parameterCount (body, limit) {
|
||||
var count = 0
|
||||
var index = 0
|
||||
|
||||
while ((index = body.indexOf('&', index)) !== -1) {
|
||||
count++
|
||||
index++
|
||||
|
||||
if (count === limit) {
|
||||
return undefined
|
||||
}
|
||||
}
|
||||
|
||||
return count
|
||||
}
|
||||
|
||||
/**
|
||||
* Get parser for module name dynamically.
|
||||
*
|
||||
* @param {string} name
|
||||
* @return {function}
|
||||
* @api private
|
||||
*/
|
||||
|
||||
function parser (name) {
|
||||
var mod = parsers[name]
|
||||
|
||||
if (mod !== undefined) {
|
||||
return mod.parse
|
||||
}
|
||||
|
||||
// this uses a switch for static require analysis
|
||||
switch (name) {
|
||||
case 'qs':
|
||||
mod = require('qs')
|
||||
break
|
||||
case 'querystring':
|
||||
mod = require('querystring')
|
||||
break
|
||||
}
|
||||
|
||||
// store to prevent invoking require()
|
||||
parsers[name] = mod
|
||||
|
||||
return mod.parse
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the simple query parser.
|
||||
*
|
||||
* @param {object} options
|
||||
*/
|
||||
|
||||
function simpleparser (options) {
|
||||
var parameterLimit = options.parameterLimit !== undefined
|
||||
? options.parameterLimit
|
||||
: 1000
|
||||
var parse = parser('querystring')
|
||||
|
||||
if (isNaN(parameterLimit) || parameterLimit < 1) {
|
||||
throw new TypeError('option parameterLimit must be a positive number')
|
||||
}
|
||||
|
||||
if (isFinite(parameterLimit)) {
|
||||
parameterLimit = parameterLimit | 0
|
||||
}
|
||||
|
||||
return function queryparse (body) {
|
||||
var paramCount = parameterCount(body, parameterLimit)
|
||||
|
||||
if (paramCount === undefined) {
|
||||
debug('too many parameters')
|
||||
throw createError(413, 'too many parameters', {
|
||||
type: 'parameters.too.many'
|
||||
})
|
||||
}
|
||||
|
||||
debug('parse urlencoding')
|
||||
return parse(body, undefined, undefined, {maxKeys: parameterLimit})
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the simple type checker.
|
||||
*
|
||||
* @param {string} type
|
||||
* @return {function}
|
||||
*/
|
||||
|
||||
function typeChecker (type) {
|
||||
return function checkType (req) {
|
||||
return Boolean(typeis(req, type))
|
||||
}
|
||||
}
|
||||
91
node_modules/express/node_modules/body-parser/package.json
generated
vendored
Normal file
91
node_modules/express/node_modules/body-parser/package.json
generated
vendored
Normal file
@ -0,0 +1,91 @@
|
||||
{
|
||||
"_from": "body-parser@1.18.2",
|
||||
"_id": "body-parser@1.18.2",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-h2eKGdhLR9hZuDGZvVm84iKxBFQ=",
|
||||
"_location": "/express/body-parser",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "body-parser@1.18.2",
|
||||
"name": "body-parser",
|
||||
"escapedName": "body-parser",
|
||||
"rawSpec": "1.18.2",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "1.18.2"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/express"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.18.2.tgz",
|
||||
"_shasum": "87678a19d84b47d859b83199bd59bce222b10454",
|
||||
"_spec": "body-parser@1.18.2",
|
||||
"_where": "C:\\Users\\jonio\\Documents\\Programmieren\\Miniportal\\Neu\\MiniportalAPI\\node_modules\\express",
|
||||
"bugs": {
|
||||
"url": "https://github.com/expressjs/body-parser/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Douglas Christopher Wilson",
|
||||
"email": "doug@somethingdoug.com"
|
||||
},
|
||||
{
|
||||
"name": "Jonathan Ong",
|
||||
"email": "me@jongleberry.com",
|
||||
"url": "http://jongleberry.com"
|
||||
}
|
||||
],
|
||||
"dependencies": {
|
||||
"bytes": "3.0.0",
|
||||
"content-type": "~1.0.4",
|
||||
"debug": "2.6.9",
|
||||
"depd": "~1.1.1",
|
||||
"http-errors": "~1.6.2",
|
||||
"iconv-lite": "0.4.19",
|
||||
"on-finished": "~2.3.0",
|
||||
"qs": "6.5.1",
|
||||
"raw-body": "2.3.2",
|
||||
"type-is": "~1.6.15"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "Node.js body parsing middleware",
|
||||
"devDependencies": {
|
||||
"eslint": "3.19.0",
|
||||
"eslint-config-standard": "10.2.1",
|
||||
"eslint-plugin-import": "2.7.0",
|
||||
"eslint-plugin-markdown": "1.0.0-beta.6",
|
||||
"eslint-plugin-node": "5.1.1",
|
||||
"eslint-plugin-promise": "3.5.0",
|
||||
"eslint-plugin-standard": "3.0.1",
|
||||
"istanbul": "0.4.5",
|
||||
"methods": "1.1.2",
|
||||
"mocha": "2.5.3",
|
||||
"safe-buffer": "5.1.1",
|
||||
"supertest": "1.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
},
|
||||
"files": [
|
||||
"lib/",
|
||||
"LICENSE",
|
||||
"HISTORY.md",
|
||||
"index.js"
|
||||
],
|
||||
"homepage": "https://github.com/expressjs/body-parser#readme",
|
||||
"license": "MIT",
|
||||
"name": "body-parser",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/expressjs/body-parser.git"
|
||||
},
|
||||
"scripts": {
|
||||
"lint": "eslint --plugin markdown --ext js,md .",
|
||||
"test": "mocha --require test/support/env --reporter spec --check-leaks --bail test/",
|
||||
"test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --require test/support/env --reporter dot --check-leaks test/",
|
||||
"test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --require test/support/env --reporter spec --check-leaks test/"
|
||||
},
|
||||
"version": "1.18.2"
|
||||
}
|
||||
23
node_modules/express/node_modules/iconv-lite/.travis.yml
generated
vendored
Normal file
23
node_modules/express/node_modules/iconv-lite/.travis.yml
generated
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
sudo: false
|
||||
language: node_js
|
||||
node_js:
|
||||
- "0.10"
|
||||
- "0.11"
|
||||
- "0.12"
|
||||
- "iojs"
|
||||
- "4"
|
||||
- "6"
|
||||
- "8"
|
||||
- "node"
|
||||
|
||||
|
||||
env:
|
||||
- CXX=g++-4.8
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
packages:
|
||||
- gcc-4.8
|
||||
- g++-4.8
|
||||
|
||||
134
node_modules/express/node_modules/iconv-lite/Changelog.md
generated
vendored
Normal file
134
node_modules/express/node_modules/iconv-lite/Changelog.md
generated
vendored
Normal file
@ -0,0 +1,134 @@
|
||||
|
||||
# 0.4.19 / 2017-09-09
|
||||
|
||||
* Fixed iso8859-1 codec regression in handling untranslatable characters (#162, caused by #147)
|
||||
* Re-generated windows1255 codec, because it was updated in iconv project
|
||||
* Fixed grammar in error message when iconv-lite is loaded with encoding other than utf8
|
||||
|
||||
|
||||
# 0.4.18 / 2017-06-13
|
||||
|
||||
* Fixed CESU-8 regression in Node v8.
|
||||
|
||||
|
||||
# 0.4.17 / 2017-04-22
|
||||
|
||||
* Updated typescript definition file to support Angular 2 AoT mode (#153 by @larssn)
|
||||
|
||||
|
||||
# 0.4.16 / 2017-04-22
|
||||
|
||||
* Added support for React Native (#150)
|
||||
* Changed iso8859-1 encoding to usine internal 'binary' encoding, as it's the same thing (#147 by @mscdex)
|
||||
* Fixed typo in Readme (#138 by @jiangzhuo)
|
||||
* Fixed build for Node v6.10+ by making correct version comparison
|
||||
* Added a warning if iconv-lite is loaded not as utf-8 (see #142)
|
||||
|
||||
|
||||
# 0.4.15 / 2016-11-21
|
||||
|
||||
* Fixed typescript type definition (#137)
|
||||
|
||||
|
||||
# 0.4.14 / 2016-11-20
|
||||
|
||||
* Preparation for v1.0
|
||||
* Added Node v6 and latest Node versions to Travis CI test rig
|
||||
* Deprecated Node v0.8 support
|
||||
* Typescript typings (@larssn)
|
||||
* Fix encoding of Euro character in GB 18030 (inspired by @lygstate)
|
||||
* Add ms prefix to dbcs windows encodings (@rokoroku)
|
||||
|
||||
|
||||
# 0.4.13 / 2015-10-01
|
||||
|
||||
* Fix silly mistake in deprecation notice.
|
||||
|
||||
|
||||
# 0.4.12 / 2015-09-26
|
||||
|
||||
* Node v4 support:
|
||||
* Added CESU-8 decoding (#106)
|
||||
* Added deprecation notice for `extendNodeEncodings`
|
||||
* Added Travis tests for Node v4 and io.js latest (#105 by @Mithgol)
|
||||
|
||||
|
||||
# 0.4.11 / 2015-07-03
|
||||
|
||||
* Added CESU-8 encoding.
|
||||
|
||||
|
||||
# 0.4.10 / 2015-05-26
|
||||
|
||||
* Changed UTF-16 endianness heuristic to take into account any ASCII chars, not
|
||||
just spaces. This should minimize the importance of "default" endianness.
|
||||
|
||||
|
||||
# 0.4.9 / 2015-05-24
|
||||
|
||||
* Streamlined BOM handling: strip BOM by default, add BOM when encoding if
|
||||
addBOM: true. Added docs to Readme.
|
||||
* UTF16 now uses UTF16-LE by default.
|
||||
* Fixed minor issue with big5 encoding.
|
||||
* Added io.js testing on Travis; updated node-iconv version to test against.
|
||||
Now we just skip testing SBCS encodings that node-iconv doesn't support.
|
||||
* (internal refactoring) Updated codec interface to use classes.
|
||||
* Use strict mode in all files.
|
||||
|
||||
|
||||
# 0.4.8 / 2015-04-14
|
||||
|
||||
* added alias UNICODE-1-1-UTF-7 for UTF-7 encoding (#94)
|
||||
|
||||
|
||||
# 0.4.7 / 2015-02-05
|
||||
|
||||
* stop official support of Node.js v0.8. Should still work, but no guarantees.
|
||||
reason: Packages needed for testing are hard to get on Travis CI.
|
||||
* work in environment where Object.prototype is monkey patched with enumerable
|
||||
props (#89).
|
||||
|
||||
|
||||
# 0.4.6 / 2015-01-12
|
||||
|
||||
* fix rare aliases of single-byte encodings (thanks @mscdex)
|
||||
* double the timeout for dbcs tests to make them less flaky on travis
|
||||
|
||||
|
||||
# 0.4.5 / 2014-11-20
|
||||
|
||||
* fix windows-31j and x-sjis encoding support (@nleush)
|
||||
* minor fix: undefined variable reference when internal error happens
|
||||
|
||||
|
||||
# 0.4.4 / 2014-07-16
|
||||
|
||||
* added encodings UTF-7 (RFC2152) and UTF-7-IMAP (RFC3501 Section 5.1.3)
|
||||
* fixed streaming base64 encoding
|
||||
|
||||
|
||||
# 0.4.3 / 2014-06-14
|
||||
|
||||
* added encodings UTF-16BE and UTF-16 with BOM
|
||||
|
||||
|
||||
# 0.4.2 / 2014-06-12
|
||||
|
||||
* don't throw exception if `extendNodeEncodings()` is called more than once
|
||||
|
||||
|
||||
# 0.4.1 / 2014-06-11
|
||||
|
||||
* codepage 808 added
|
||||
|
||||
|
||||
# 0.4.0 / 2014-06-10
|
||||
|
||||
* code is rewritten from scratch
|
||||
* all widespread encodings are supported
|
||||
* streaming interface added
|
||||
* browserify compatibility added
|
||||
* (optional) extend core primitive encodings to make usage even simpler
|
||||
* moved from vows to mocha as the testing framework
|
||||
|
||||
|
||||
21
node_modules/express/node_modules/iconv-lite/LICENSE
generated
vendored
Normal file
21
node_modules/express/node_modules/iconv-lite/LICENSE
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
Copyright (c) 2011 Alexander Shtuchkin
|
||||
|
||||
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.
|
||||
|
||||
160
node_modules/express/node_modules/iconv-lite/README.md
generated
vendored
Normal file
160
node_modules/express/node_modules/iconv-lite/README.md
generated
vendored
Normal file
@ -0,0 +1,160 @@
|
||||
## Pure JS character encoding conversion [](https://travis-ci.org/ashtuchkin/iconv-lite)
|
||||
|
||||
* Doesn't need native code compilation. Works on Windows and in sandboxed environments like [Cloud9](http://c9.io).
|
||||
* Used in popular projects like [Express.js (body_parser)](https://github.com/expressjs/body-parser),
|
||||
[Grunt](http://gruntjs.com/), [Nodemailer](http://www.nodemailer.com/), [Yeoman](http://yeoman.io/) and others.
|
||||
* Faster than [node-iconv](https://github.com/bnoordhuis/node-iconv) (see below for performance comparison).
|
||||
* Intuitive encode/decode API
|
||||
* Streaming support for Node v0.10+
|
||||
* [Deprecated] Can extend Node.js primitives (buffers, streams) to support all iconv-lite encodings.
|
||||
* In-browser usage via [Browserify](https://github.com/substack/node-browserify) (~180k gzip compressed with Buffer shim included).
|
||||
* Typescript [type definition file](https://github.com/ashtuchkin/iconv-lite/blob/master/lib/index.d.ts) included.
|
||||
* React Native is supported (need to explicitly `npm install` two more modules: `buffer` and `stream`).
|
||||
* License: MIT.
|
||||
|
||||
[](https://npmjs.org/packages/iconv-lite/)
|
||||
|
||||
## Usage
|
||||
### Basic API
|
||||
```javascript
|
||||
var iconv = require('iconv-lite');
|
||||
|
||||
// Convert from an encoded buffer to js string.
|
||||
str = iconv.decode(new Buffer([0x68, 0x65, 0x6c, 0x6c, 0x6f]), 'win1251');
|
||||
|
||||
// Convert from js string to an encoded buffer.
|
||||
buf = iconv.encode("Sample input string", 'win1251');
|
||||
|
||||
// Check if encoding is supported
|
||||
iconv.encodingExists("us-ascii")
|
||||
```
|
||||
|
||||
### Streaming API (Node v0.10+)
|
||||
```javascript
|
||||
|
||||
// Decode stream (from binary stream to js strings)
|
||||
http.createServer(function(req, res) {
|
||||
var converterStream = iconv.decodeStream('win1251');
|
||||
req.pipe(converterStream);
|
||||
|
||||
converterStream.on('data', function(str) {
|
||||
console.log(str); // Do something with decoded strings, chunk-by-chunk.
|
||||
});
|
||||
});
|
||||
|
||||
// Convert encoding streaming example
|
||||
fs.createReadStream('file-in-win1251.txt')
|
||||
.pipe(iconv.decodeStream('win1251'))
|
||||
.pipe(iconv.encodeStream('ucs2'))
|
||||
.pipe(fs.createWriteStream('file-in-ucs2.txt'));
|
||||
|
||||
// Sugar: all encode/decode streams have .collect(cb) method to accumulate data.
|
||||
http.createServer(function(req, res) {
|
||||
req.pipe(iconv.decodeStream('win1251')).collect(function(err, body) {
|
||||
assert(typeof body == 'string');
|
||||
console.log(body); // full request body string
|
||||
});
|
||||
});
|
||||
```
|
||||
|
||||
### [Deprecated] Extend Node.js own encodings
|
||||
> NOTE: This doesn't work on latest Node versions. See [details](https://github.com/ashtuchkin/iconv-lite/wiki/Node-v4-compatibility).
|
||||
|
||||
```javascript
|
||||
// After this call all Node basic primitives will understand iconv-lite encodings.
|
||||
iconv.extendNodeEncodings();
|
||||
|
||||
// Examples:
|
||||
buf = new Buffer(str, 'win1251');
|
||||
buf.write(str, 'gbk');
|
||||
str = buf.toString('latin1');
|
||||
assert(Buffer.isEncoding('iso-8859-15'));
|
||||
Buffer.byteLength(str, 'us-ascii');
|
||||
|
||||
http.createServer(function(req, res) {
|
||||
req.setEncoding('big5');
|
||||
req.collect(function(err, body) {
|
||||
console.log(body);
|
||||
});
|
||||
});
|
||||
|
||||
fs.createReadStream("file.txt", "shift_jis");
|
||||
|
||||
// External modules are also supported (if they use Node primitives, which they probably do).
|
||||
request = require('request');
|
||||
request({
|
||||
url: "http://github.com/",
|
||||
encoding: "cp932"
|
||||
});
|
||||
|
||||
// To remove extensions
|
||||
iconv.undoExtendNodeEncodings();
|
||||
```
|
||||
|
||||
## Supported encodings
|
||||
|
||||
* All node.js native encodings: utf8, ucs2 / utf16-le, ascii, binary, base64, hex.
|
||||
* Additional unicode encodings: utf16, utf16-be, utf-7, utf-7-imap.
|
||||
* All widespread singlebyte encodings: Windows 125x family, ISO-8859 family,
|
||||
IBM/DOS codepages, Macintosh family, KOI8 family, all others supported by iconv library.
|
||||
Aliases like 'latin1', 'us-ascii' also supported.
|
||||
* All widespread multibyte encodings: CP932, CP936, CP949, CP950, GB2312, GBK, GB18030, Big5, Shift_JIS, EUC-JP.
|
||||
|
||||
See [all supported encodings on wiki](https://github.com/ashtuchkin/iconv-lite/wiki/Supported-Encodings).
|
||||
|
||||
Most singlebyte encodings are generated automatically from [node-iconv](https://github.com/bnoordhuis/node-iconv). Thank you Ben Noordhuis and libiconv authors!
|
||||
|
||||
Multibyte encodings are generated from [Unicode.org mappings](http://www.unicode.org/Public/MAPPINGS/) and [WHATWG Encoding Standard mappings](http://encoding.spec.whatwg.org/). Thank you, respective authors!
|
||||
|
||||
|
||||
## Encoding/decoding speed
|
||||
|
||||
Comparison with node-iconv module (1000x256kb, on MacBook Pro, Core i5/2.6 GHz, Node v0.12.0).
|
||||
Note: your results may vary, so please always check on your hardware.
|
||||
|
||||
operation iconv@2.1.4 iconv-lite@0.4.7
|
||||
----------------------------------------------------------
|
||||
encode('win1251') ~96 Mb/s ~320 Mb/s
|
||||
decode('win1251') ~95 Mb/s ~246 Mb/s
|
||||
|
||||
## BOM handling
|
||||
|
||||
* Decoding: BOM is stripped by default, unless overridden by passing `stripBOM: false` in options
|
||||
(f.ex. `iconv.decode(buf, enc, {stripBOM: false})`).
|
||||
A callback might also be given as a `stripBOM` parameter - it'll be called if BOM character was actually found.
|
||||
* If you want to detect UTF-8 BOM when decoding other encodings, use [node-autodetect-decoder-stream](https://github.com/danielgindi/node-autodetect-decoder-stream) module.
|
||||
* Encoding: No BOM added, unless overridden by `addBOM: true` option.
|
||||
|
||||
## UTF-16 Encodings
|
||||
|
||||
This library supports UTF-16LE, UTF-16BE and UTF-16 encodings. First two are straightforward, but UTF-16 is trying to be
|
||||
smart about endianness in the following ways:
|
||||
* Decoding: uses BOM and 'spaces heuristic' to determine input endianness. Default is UTF-16LE, but can be
|
||||
overridden with `defaultEncoding: 'utf-16be'` option. Strips BOM unless `stripBOM: false`.
|
||||
* Encoding: uses UTF-16LE and writes BOM by default. Use `addBOM: false` to override.
|
||||
|
||||
## Other notes
|
||||
|
||||
When decoding, be sure to supply a Buffer to decode() method, otherwise [bad things usually happen](https://github.com/ashtuchkin/iconv-lite/wiki/Use-Buffers-when-decoding).
|
||||
Untranslatable characters are set to <20> or ?. No transliteration is currently supported.
|
||||
Node versions 0.10.31 and 0.11.13 are buggy, don't use them (see #65, #77).
|
||||
|
||||
## Testing
|
||||
|
||||
```bash
|
||||
$ git clone git@github.com:ashtuchkin/iconv-lite.git
|
||||
$ cd iconv-lite
|
||||
$ npm install
|
||||
$ npm test
|
||||
|
||||
$ # To view performance:
|
||||
$ node test/performance.js
|
||||
|
||||
$ # To view test coverage:
|
||||
$ npm run coverage
|
||||
$ open coverage/lcov-report/index.html
|
||||
```
|
||||
|
||||
## Adoption
|
||||
[](https://nodei.co/npm/iconv-lite/)
|
||||
[](https://www.codeship.com/projects/29053)
|
||||
555
node_modules/express/node_modules/iconv-lite/encodings/dbcs-codec.js
generated
vendored
Normal file
555
node_modules/express/node_modules/iconv-lite/encodings/dbcs-codec.js
generated
vendored
Normal file
@ -0,0 +1,555 @@
|
||||
"use strict";
|
||||
var Buffer = require("buffer").Buffer;
|
||||
|
||||
// Multibyte codec. In this scheme, a character is represented by 1 or more bytes.
|
||||
// Our codec supports UTF-16 surrogates, extensions for GB18030 and unicode sequences.
|
||||
// To save memory and loading time, we read table files only when requested.
|
||||
|
||||
exports._dbcs = DBCSCodec;
|
||||
|
||||
var UNASSIGNED = -1,
|
||||
GB18030_CODE = -2,
|
||||
SEQ_START = -10,
|
||||
NODE_START = -1000,
|
||||
UNASSIGNED_NODE = new Array(0x100),
|
||||
DEF_CHAR = -1;
|
||||
|
||||
for (var i = 0; i < 0x100; i++)
|
||||
UNASSIGNED_NODE[i] = UNASSIGNED;
|
||||
|
||||
|
||||
// Class DBCSCodec reads and initializes mapping tables.
|
||||
function DBCSCodec(codecOptions, iconv) {
|
||||
this.encodingName = codecOptions.encodingName;
|
||||
if (!codecOptions)
|
||||
throw new Error("DBCS codec is called without the data.")
|
||||
if (!codecOptions.table)
|
||||
throw new Error("Encoding '" + this.encodingName + "' has no data.");
|
||||
|
||||
// Load tables.
|
||||
var mappingTable = codecOptions.table();
|
||||
|
||||
|
||||
// Decode tables: MBCS -> Unicode.
|
||||
|
||||
// decodeTables is a trie, encoded as an array of arrays of integers. Internal arrays are trie nodes and all have len = 256.
|
||||
// Trie root is decodeTables[0].
|
||||
// Values: >= 0 -> unicode character code. can be > 0xFFFF
|
||||
// == UNASSIGNED -> unknown/unassigned sequence.
|
||||
// == GB18030_CODE -> this is the end of a GB18030 4-byte sequence.
|
||||
// <= NODE_START -> index of the next node in our trie to process next byte.
|
||||
// <= SEQ_START -> index of the start of a character code sequence, in decodeTableSeq.
|
||||
this.decodeTables = [];
|
||||
this.decodeTables[0] = UNASSIGNED_NODE.slice(0); // Create root node.
|
||||
|
||||
// Sometimes a MBCS char corresponds to a sequence of unicode chars. We store them as arrays of integers here.
|
||||
this.decodeTableSeq = [];
|
||||
|
||||
// Actual mapping tables consist of chunks. Use them to fill up decode tables.
|
||||
for (var i = 0; i < mappingTable.length; i++)
|
||||
this._addDecodeChunk(mappingTable[i]);
|
||||
|
||||
this.defaultCharUnicode = iconv.defaultCharUnicode;
|
||||
|
||||
|
||||
// Encode tables: Unicode -> DBCS.
|
||||
|
||||
// `encodeTable` is array mapping from unicode char to encoded char. All its values are integers for performance.
|
||||
// Because it can be sparse, it is represented as array of buckets by 256 chars each. Bucket can be null.
|
||||
// Values: >= 0 -> it is a normal char. Write the value (if <=256 then 1 byte, if <=65536 then 2 bytes, etc.).
|
||||
// == UNASSIGNED -> no conversion found. Output a default char.
|
||||
// <= SEQ_START -> it's an index in encodeTableSeq, see below. The character starts a sequence.
|
||||
this.encodeTable = [];
|
||||
|
||||
// `encodeTableSeq` is used when a sequence of unicode characters is encoded as a single code. We use a tree of
|
||||
// objects where keys correspond to characters in sequence and leafs are the encoded dbcs values. A special DEF_CHAR key
|
||||
// means end of sequence (needed when one sequence is a strict subsequence of another).
|
||||
// Objects are kept separately from encodeTable to increase performance.
|
||||
this.encodeTableSeq = [];
|
||||
|
||||
// Some chars can be decoded, but need not be encoded.
|
||||
var skipEncodeChars = {};
|
||||
if (codecOptions.encodeSkipVals)
|
||||
for (var i = 0; i < codecOptions.encodeSkipVals.length; i++) {
|
||||
var val = codecOptions.encodeSkipVals[i];
|
||||
if (typeof val === 'number')
|
||||
skipEncodeChars[val] = true;
|
||||
else
|
||||
for (var j = val.from; j <= val.to; j++)
|
||||
skipEncodeChars[j] = true;
|
||||
}
|
||||
|
||||
// Use decode trie to recursively fill out encode tables.
|
||||
this._fillEncodeTable(0, 0, skipEncodeChars);
|
||||
|
||||
// Add more encoding pairs when needed.
|
||||
if (codecOptions.encodeAdd) {
|
||||
for (var uChar in codecOptions.encodeAdd)
|
||||
if (Object.prototype.hasOwnProperty.call(codecOptions.encodeAdd, uChar))
|
||||
this._setEncodeChar(uChar.charCodeAt(0), codecOptions.encodeAdd[uChar]);
|
||||
}
|
||||
|
||||
this.defCharSB = this.encodeTable[0][iconv.defaultCharSingleByte.charCodeAt(0)];
|
||||
if (this.defCharSB === UNASSIGNED) this.defCharSB = this.encodeTable[0]['?'];
|
||||
if (this.defCharSB === UNASSIGNED) this.defCharSB = "?".charCodeAt(0);
|
||||
|
||||
|
||||
// Load & create GB18030 tables when needed.
|
||||
if (typeof codecOptions.gb18030 === 'function') {
|
||||
this.gb18030 = codecOptions.gb18030(); // Load GB18030 ranges.
|
||||
|
||||
// Add GB18030 decode tables.
|
||||
var thirdByteNodeIdx = this.decodeTables.length;
|
||||
var thirdByteNode = this.decodeTables[thirdByteNodeIdx] = UNASSIGNED_NODE.slice(0);
|
||||
|
||||
var fourthByteNodeIdx = this.decodeTables.length;
|
||||
var fourthByteNode = this.decodeTables[fourthByteNodeIdx] = UNASSIGNED_NODE.slice(0);
|
||||
|
||||
for (var i = 0x81; i <= 0xFE; i++) {
|
||||
var secondByteNodeIdx = NODE_START - this.decodeTables[0][i];
|
||||
var secondByteNode = this.decodeTables[secondByteNodeIdx];
|
||||
for (var j = 0x30; j <= 0x39; j++)
|
||||
secondByteNode[j] = NODE_START - thirdByteNodeIdx;
|
||||
}
|
||||
for (var i = 0x81; i <= 0xFE; i++)
|
||||
thirdByteNode[i] = NODE_START - fourthByteNodeIdx;
|
||||
for (var i = 0x30; i <= 0x39; i++)
|
||||
fourthByteNode[i] = GB18030_CODE
|
||||
}
|
||||
}
|
||||
|
||||
DBCSCodec.prototype.encoder = DBCSEncoder;
|
||||
DBCSCodec.prototype.decoder = DBCSDecoder;
|
||||
|
||||
// Decoder helpers
|
||||
DBCSCodec.prototype._getDecodeTrieNode = function(addr) {
|
||||
var bytes = [];
|
||||
for (; addr > 0; addr >>= 8)
|
||||
bytes.push(addr & 0xFF);
|
||||
if (bytes.length == 0)
|
||||
bytes.push(0);
|
||||
|
||||
var node = this.decodeTables[0];
|
||||
for (var i = bytes.length-1; i > 0; i--) { // Traverse nodes deeper into the trie.
|
||||
var val = node[bytes[i]];
|
||||
|
||||
if (val == UNASSIGNED) { // Create new node.
|
||||
node[bytes[i]] = NODE_START - this.decodeTables.length;
|
||||
this.decodeTables.push(node = UNASSIGNED_NODE.slice(0));
|
||||
}
|
||||
else if (val <= NODE_START) { // Existing node.
|
||||
node = this.decodeTables[NODE_START - val];
|
||||
}
|
||||
else
|
||||
throw new Error("Overwrite byte in " + this.encodingName + ", addr: " + addr.toString(16));
|
||||
}
|
||||
return node;
|
||||
}
|
||||
|
||||
|
||||
DBCSCodec.prototype._addDecodeChunk = function(chunk) {
|
||||
// First element of chunk is the hex mbcs code where we start.
|
||||
var curAddr = parseInt(chunk[0], 16);
|
||||
|
||||
// Choose the decoding node where we'll write our chars.
|
||||
var writeTable = this._getDecodeTrieNode(curAddr);
|
||||
curAddr = curAddr & 0xFF;
|
||||
|
||||
// Write all other elements of the chunk to the table.
|
||||
for (var k = 1; k < chunk.length; k++) {
|
||||
var part = chunk[k];
|
||||
if (typeof part === "string") { // String, write as-is.
|
||||
for (var l = 0; l < part.length;) {
|
||||
var code = part.charCodeAt(l++);
|
||||
if (0xD800 <= code && code < 0xDC00) { // Decode surrogate
|
||||
var codeTrail = part.charCodeAt(l++);
|
||||
if (0xDC00 <= codeTrail && codeTrail < 0xE000)
|
||||
writeTable[curAddr++] = 0x10000 + (code - 0xD800) * 0x400 + (codeTrail - 0xDC00);
|
||||
else
|
||||
throw new Error("Incorrect surrogate pair in " + this.encodingName + " at chunk " + chunk[0]);
|
||||
}
|
||||
else if (0x0FF0 < code && code <= 0x0FFF) { // Character sequence (our own encoding used)
|
||||
var len = 0xFFF - code + 2;
|
||||
var seq = [];
|
||||
for (var m = 0; m < len; m++)
|
||||
seq.push(part.charCodeAt(l++)); // Simple variation: don't support surrogates or subsequences in seq.
|
||||
|
||||
writeTable[curAddr++] = SEQ_START - this.decodeTableSeq.length;
|
||||
this.decodeTableSeq.push(seq);
|
||||
}
|
||||
else
|
||||
writeTable[curAddr++] = code; // Basic char
|
||||
}
|
||||
}
|
||||
else if (typeof part === "number") { // Integer, meaning increasing sequence starting with prev character.
|
||||
var charCode = writeTable[curAddr - 1] + 1;
|
||||
for (var l = 0; l < part; l++)
|
||||
writeTable[curAddr++] = charCode++;
|
||||
}
|
||||
else
|
||||
throw new Error("Incorrect type '" + typeof part + "' given in " + this.encodingName + " at chunk " + chunk[0]);
|
||||
}
|
||||
if (curAddr > 0xFF)
|
||||
throw new Error("Incorrect chunk in " + this.encodingName + " at addr " + chunk[0] + ": too long" + curAddr);
|
||||
}
|
||||
|
||||
// Encoder helpers
|
||||
DBCSCodec.prototype._getEncodeBucket = function(uCode) {
|
||||
var high = uCode >> 8; // This could be > 0xFF because of astral characters.
|
||||
if (this.encodeTable[high] === undefined)
|
||||
this.encodeTable[high] = UNASSIGNED_NODE.slice(0); // Create bucket on demand.
|
||||
return this.encodeTable[high];
|
||||
}
|
||||
|
||||
DBCSCodec.prototype._setEncodeChar = function(uCode, dbcsCode) {
|
||||
var bucket = this._getEncodeBucket(uCode);
|
||||
var low = uCode & 0xFF;
|
||||
if (bucket[low] <= SEQ_START)
|
||||
this.encodeTableSeq[SEQ_START-bucket[low]][DEF_CHAR] = dbcsCode; // There's already a sequence, set a single-char subsequence of it.
|
||||
else if (bucket[low] == UNASSIGNED)
|
||||
bucket[low] = dbcsCode;
|
||||
}
|
||||
|
||||
DBCSCodec.prototype._setEncodeSequence = function(seq, dbcsCode) {
|
||||
|
||||
// Get the root of character tree according to first character of the sequence.
|
||||
var uCode = seq[0];
|
||||
var bucket = this._getEncodeBucket(uCode);
|
||||
var low = uCode & 0xFF;
|
||||
|
||||
var node;
|
||||
if (bucket[low] <= SEQ_START) {
|
||||
// There's already a sequence with - use it.
|
||||
node = this.encodeTableSeq[SEQ_START-bucket[low]];
|
||||
}
|
||||
else {
|
||||
// There was no sequence object - allocate a new one.
|
||||
node = {};
|
||||
if (bucket[low] !== UNASSIGNED) node[DEF_CHAR] = bucket[low]; // If a char was set before - make it a single-char subsequence.
|
||||
bucket[low] = SEQ_START - this.encodeTableSeq.length;
|
||||
this.encodeTableSeq.push(node);
|
||||
}
|
||||
|
||||
// Traverse the character tree, allocating new nodes as needed.
|
||||
for (var j = 1; j < seq.length-1; j++) {
|
||||
var oldVal = node[uCode];
|
||||
if (typeof oldVal === 'object')
|
||||
node = oldVal;
|
||||
else {
|
||||
node = node[uCode] = {}
|
||||
if (oldVal !== undefined)
|
||||
node[DEF_CHAR] = oldVal
|
||||
}
|
||||
}
|
||||
|
||||
// Set the leaf to given dbcsCode.
|
||||
uCode = seq[seq.length-1];
|
||||
node[uCode] = dbcsCode;
|
||||
}
|
||||
|
||||
DBCSCodec.prototype._fillEncodeTable = function(nodeIdx, prefix, skipEncodeChars) {
|
||||
var node = this.decodeTables[nodeIdx];
|
||||
for (var i = 0; i < 0x100; i++) {
|
||||
var uCode = node[i];
|
||||
var mbCode = prefix + i;
|
||||
if (skipEncodeChars[mbCode])
|
||||
continue;
|
||||
|
||||
if (uCode >= 0)
|
||||
this._setEncodeChar(uCode, mbCode);
|
||||
else if (uCode <= NODE_START)
|
||||
this._fillEncodeTable(NODE_START - uCode, mbCode << 8, skipEncodeChars);
|
||||
else if (uCode <= SEQ_START)
|
||||
this._setEncodeSequence(this.decodeTableSeq[SEQ_START - uCode], mbCode);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// == Encoder ==================================================================
|
||||
|
||||
function DBCSEncoder(options, codec) {
|
||||
// Encoder state
|
||||
this.leadSurrogate = -1;
|
||||
this.seqObj = undefined;
|
||||
|
||||
// Static data
|
||||
this.encodeTable = codec.encodeTable;
|
||||
this.encodeTableSeq = codec.encodeTableSeq;
|
||||
this.defaultCharSingleByte = codec.defCharSB;
|
||||
this.gb18030 = codec.gb18030;
|
||||
}
|
||||
|
||||
DBCSEncoder.prototype.write = function(str) {
|
||||
var newBuf = new Buffer(str.length * (this.gb18030 ? 4 : 3)),
|
||||
leadSurrogate = this.leadSurrogate,
|
||||
seqObj = this.seqObj, nextChar = -1,
|
||||
i = 0, j = 0;
|
||||
|
||||
while (true) {
|
||||
// 0. Get next character.
|
||||
if (nextChar === -1) {
|
||||
if (i == str.length) break;
|
||||
var uCode = str.charCodeAt(i++);
|
||||
}
|
||||
else {
|
||||
var uCode = nextChar;
|
||||
nextChar = -1;
|
||||
}
|
||||
|
||||
// 1. Handle surrogates.
|
||||
if (0xD800 <= uCode && uCode < 0xE000) { // Char is one of surrogates.
|
||||
if (uCode < 0xDC00) { // We've got lead surrogate.
|
||||
if (leadSurrogate === -1) {
|
||||
leadSurrogate = uCode;
|
||||
continue;
|
||||
} else {
|
||||
leadSurrogate = uCode;
|
||||
// Double lead surrogate found.
|
||||
uCode = UNASSIGNED;
|
||||
}
|
||||
} else { // We've got trail surrogate.
|
||||
if (leadSurrogate !== -1) {
|
||||
uCode = 0x10000 + (leadSurrogate - 0xD800) * 0x400 + (uCode - 0xDC00);
|
||||
leadSurrogate = -1;
|
||||
} else {
|
||||
// Incomplete surrogate pair - only trail surrogate found.
|
||||
uCode = UNASSIGNED;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
else if (leadSurrogate !== -1) {
|
||||
// Incomplete surrogate pair - only lead surrogate found.
|
||||
nextChar = uCode; uCode = UNASSIGNED; // Write an error, then current char.
|
||||
leadSurrogate = -1;
|
||||
}
|
||||
|
||||
// 2. Convert uCode character.
|
||||
var dbcsCode = UNASSIGNED;
|
||||
if (seqObj !== undefined && uCode != UNASSIGNED) { // We are in the middle of the sequence
|
||||
var resCode = seqObj[uCode];
|
||||
if (typeof resCode === 'object') { // Sequence continues.
|
||||
seqObj = resCode;
|
||||
continue;
|
||||
|
||||
} else if (typeof resCode == 'number') { // Sequence finished. Write it.
|
||||
dbcsCode = resCode;
|
||||
|
||||
} else if (resCode == undefined) { // Current character is not part of the sequence.
|
||||
|
||||
// Try default character for this sequence
|
||||
resCode = seqObj[DEF_CHAR];
|
||||
if (resCode !== undefined) {
|
||||
dbcsCode = resCode; // Found. Write it.
|
||||
nextChar = uCode; // Current character will be written too in the next iteration.
|
||||
|
||||
} else {
|
||||
// TODO: What if we have no default? (resCode == undefined)
|
||||
// Then, we should write first char of the sequence as-is and try the rest recursively.
|
||||
// Didn't do it for now because no encoding has this situation yet.
|
||||
// Currently, just skip the sequence and write current char.
|
||||
}
|
||||
}
|
||||
seqObj = undefined;
|
||||
}
|
||||
else if (uCode >= 0) { // Regular character
|
||||
var subtable = this.encodeTable[uCode >> 8];
|
||||
if (subtable !== undefined)
|
||||
dbcsCode = subtable[uCode & 0xFF];
|
||||
|
||||
if (dbcsCode <= SEQ_START) { // Sequence start
|
||||
seqObj = this.encodeTableSeq[SEQ_START-dbcsCode];
|
||||
continue;
|
||||
}
|
||||
|
||||
if (dbcsCode == UNASSIGNED && this.gb18030) {
|
||||
// Use GB18030 algorithm to find character(s) to write.
|
||||
var idx = findIdx(this.gb18030.uChars, uCode);
|
||||
if (idx != -1) {
|
||||
var dbcsCode = this.gb18030.gbChars[idx] + (uCode - this.gb18030.uChars[idx]);
|
||||
newBuf[j++] = 0x81 + Math.floor(dbcsCode / 12600); dbcsCode = dbcsCode % 12600;
|
||||
newBuf[j++] = 0x30 + Math.floor(dbcsCode / 1260); dbcsCode = dbcsCode % 1260;
|
||||
newBuf[j++] = 0x81 + Math.floor(dbcsCode / 10); dbcsCode = dbcsCode % 10;
|
||||
newBuf[j++] = 0x30 + dbcsCode;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 3. Write dbcsCode character.
|
||||
if (dbcsCode === UNASSIGNED)
|
||||
dbcsCode = this.defaultCharSingleByte;
|
||||
|
||||
if (dbcsCode < 0x100) {
|
||||
newBuf[j++] = dbcsCode;
|
||||
}
|
||||
else if (dbcsCode < 0x10000) {
|
||||
newBuf[j++] = dbcsCode >> 8; // high byte
|
||||
newBuf[j++] = dbcsCode & 0xFF; // low byte
|
||||
}
|
||||
else {
|
||||
newBuf[j++] = dbcsCode >> 16;
|
||||
newBuf[j++] = (dbcsCode >> 8) & 0xFF;
|
||||
newBuf[j++] = dbcsCode & 0xFF;
|
||||
}
|
||||
}
|
||||
|
||||
this.seqObj = seqObj;
|
||||
this.leadSurrogate = leadSurrogate;
|
||||
return newBuf.slice(0, j);
|
||||
}
|
||||
|
||||
DBCSEncoder.prototype.end = function() {
|
||||
if (this.leadSurrogate === -1 && this.seqObj === undefined)
|
||||
return; // All clean. Most often case.
|
||||
|
||||
var newBuf = new Buffer(10), j = 0;
|
||||
|
||||
if (this.seqObj) { // We're in the sequence.
|
||||
var dbcsCode = this.seqObj[DEF_CHAR];
|
||||
if (dbcsCode !== undefined) { // Write beginning of the sequence.
|
||||
if (dbcsCode < 0x100) {
|
||||
newBuf[j++] = dbcsCode;
|
||||
}
|
||||
else {
|
||||
newBuf[j++] = dbcsCode >> 8; // high byte
|
||||
newBuf[j++] = dbcsCode & 0xFF; // low byte
|
||||
}
|
||||
} else {
|
||||
// See todo above.
|
||||
}
|
||||
this.seqObj = undefined;
|
||||
}
|
||||
|
||||
if (this.leadSurrogate !== -1) {
|
||||
// Incomplete surrogate pair - only lead surrogate found.
|
||||
newBuf[j++] = this.defaultCharSingleByte;
|
||||
this.leadSurrogate = -1;
|
||||
}
|
||||
|
||||
return newBuf.slice(0, j);
|
||||
}
|
||||
|
||||
// Export for testing
|
||||
DBCSEncoder.prototype.findIdx = findIdx;
|
||||
|
||||
|
||||
// == Decoder ==================================================================
|
||||
|
||||
function DBCSDecoder(options, codec) {
|
||||
// Decoder state
|
||||
this.nodeIdx = 0;
|
||||
this.prevBuf = new Buffer(0);
|
||||
|
||||
// Static data
|
||||
this.decodeTables = codec.decodeTables;
|
||||
this.decodeTableSeq = codec.decodeTableSeq;
|
||||
this.defaultCharUnicode = codec.defaultCharUnicode;
|
||||
this.gb18030 = codec.gb18030;
|
||||
}
|
||||
|
||||
DBCSDecoder.prototype.write = function(buf) {
|
||||
var newBuf = new Buffer(buf.length*2),
|
||||
nodeIdx = this.nodeIdx,
|
||||
prevBuf = this.prevBuf, prevBufOffset = this.prevBuf.length,
|
||||
seqStart = -this.prevBuf.length, // idx of the start of current parsed sequence.
|
||||
uCode;
|
||||
|
||||
if (prevBufOffset > 0) // Make prev buf overlap a little to make it easier to slice later.
|
||||
prevBuf = Buffer.concat([prevBuf, buf.slice(0, 10)]);
|
||||
|
||||
for (var i = 0, j = 0; i < buf.length; i++) {
|
||||
var curByte = (i >= 0) ? buf[i] : prevBuf[i + prevBufOffset];
|
||||
|
||||
// Lookup in current trie node.
|
||||
var uCode = this.decodeTables[nodeIdx][curByte];
|
||||
|
||||
if (uCode >= 0) {
|
||||
// Normal character, just use it.
|
||||
}
|
||||
else if (uCode === UNASSIGNED) { // Unknown char.
|
||||
// TODO: Callback with seq.
|
||||
//var curSeq = (seqStart >= 0) ? buf.slice(seqStart, i+1) : prevBuf.slice(seqStart + prevBufOffset, i+1 + prevBufOffset);
|
||||
i = seqStart; // Try to parse again, after skipping first byte of the sequence ('i' will be incremented by 'for' cycle).
|
||||
uCode = this.defaultCharUnicode.charCodeAt(0);
|
||||
}
|
||||
else if (uCode === GB18030_CODE) {
|
||||
var curSeq = (seqStart >= 0) ? buf.slice(seqStart, i+1) : prevBuf.slice(seqStart + prevBufOffset, i+1 + prevBufOffset);
|
||||
var ptr = (curSeq[0]-0x81)*12600 + (curSeq[1]-0x30)*1260 + (curSeq[2]-0x81)*10 + (curSeq[3]-0x30);
|
||||
var idx = findIdx(this.gb18030.gbChars, ptr);
|
||||
uCode = this.gb18030.uChars[idx] + ptr - this.gb18030.gbChars[idx];
|
||||
}
|
||||
else if (uCode <= NODE_START) { // Go to next trie node.
|
||||
nodeIdx = NODE_START - uCode;
|
||||
continue;
|
||||
}
|
||||
else if (uCode <= SEQ_START) { // Output a sequence of chars.
|
||||
var seq = this.decodeTableSeq[SEQ_START - uCode];
|
||||
for (var k = 0; k < seq.length - 1; k++) {
|
||||
uCode = seq[k];
|
||||
newBuf[j++] = uCode & 0xFF;
|
||||
newBuf[j++] = uCode >> 8;
|
||||
}
|
||||
uCode = seq[seq.length-1];
|
||||
}
|
||||
else
|
||||
throw new Error("iconv-lite internal error: invalid decoding table value " + uCode + " at " + nodeIdx + "/" + curByte);
|
||||
|
||||
// Write the character to buffer, handling higher planes using surrogate pair.
|
||||
if (uCode > 0xFFFF) {
|
||||
uCode -= 0x10000;
|
||||
var uCodeLead = 0xD800 + Math.floor(uCode / 0x400);
|
||||
newBuf[j++] = uCodeLead & 0xFF;
|
||||
newBuf[j++] = uCodeLead >> 8;
|
||||
|
||||
uCode = 0xDC00 + uCode % 0x400;
|
||||
}
|
||||
newBuf[j++] = uCode & 0xFF;
|
||||
newBuf[j++] = uCode >> 8;
|
||||
|
||||
// Reset trie node.
|
||||
nodeIdx = 0; seqStart = i+1;
|
||||
}
|
||||
|
||||
this.nodeIdx = nodeIdx;
|
||||
this.prevBuf = (seqStart >= 0) ? buf.slice(seqStart) : prevBuf.slice(seqStart + prevBufOffset);
|
||||
return newBuf.slice(0, j).toString('ucs2');
|
||||
}
|
||||
|
||||
DBCSDecoder.prototype.end = function() {
|
||||
var ret = '';
|
||||
|
||||
// Try to parse all remaining chars.
|
||||
while (this.prevBuf.length > 0) {
|
||||
// Skip 1 character in the buffer.
|
||||
ret += this.defaultCharUnicode;
|
||||
var buf = this.prevBuf.slice(1);
|
||||
|
||||
// Parse remaining as usual.
|
||||
this.prevBuf = new Buffer(0);
|
||||
this.nodeIdx = 0;
|
||||
if (buf.length > 0)
|
||||
ret += this.write(buf);
|
||||
}
|
||||
|
||||
this.nodeIdx = 0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
// Binary search for GB18030. Returns largest i such that table[i] <= val.
|
||||
function findIdx(table, val) {
|
||||
if (table[0] > val)
|
||||
return -1;
|
||||
|
||||
var l = 0, r = table.length;
|
||||
while (l < r-1) { // always table[l] <= val < table[r]
|
||||
var mid = l + Math.floor((r-l+1)/2);
|
||||
if (table[mid] <= val)
|
||||
l = mid;
|
||||
else
|
||||
r = mid;
|
||||
}
|
||||
return l;
|
||||
}
|
||||
|
||||
176
node_modules/express/node_modules/iconv-lite/encodings/dbcs-data.js
generated
vendored
Normal file
176
node_modules/express/node_modules/iconv-lite/encodings/dbcs-data.js
generated
vendored
Normal file
@ -0,0 +1,176 @@
|
||||
"use strict";
|
||||
|
||||
// Description of supported double byte encodings and aliases.
|
||||
// Tables are not require()-d until they are needed to speed up library load.
|
||||
// require()-s are direct to support Browserify.
|
||||
|
||||
module.exports = {
|
||||
|
||||
// == Japanese/ShiftJIS ====================================================
|
||||
// All japanese encodings are based on JIS X set of standards:
|
||||
// JIS X 0201 - Single-byte encoding of ASCII + ¥ + Kana chars at 0xA1-0xDF.
|
||||
// JIS X 0208 - Main set of 6879 characters, placed in 94x94 plane, to be encoded by 2 bytes.
|
||||
// Has several variations in 1978, 1983, 1990 and 1997.
|
||||
// JIS X 0212 - Supplementary plane of 6067 chars in 94x94 plane. 1990. Effectively dead.
|
||||
// JIS X 0213 - Extension and modern replacement of 0208 and 0212. Total chars: 11233.
|
||||
// 2 planes, first is superset of 0208, second - revised 0212.
|
||||
// Introduced in 2000, revised 2004. Some characters are in Unicode Plane 2 (0x2xxxx)
|
||||
|
||||
// Byte encodings are:
|
||||
// * Shift_JIS: Compatible with 0201, uses not defined chars in top half as lead bytes for double-byte
|
||||
// encoding of 0208. Lead byte ranges: 0x81-0x9F, 0xE0-0xEF; Trail byte ranges: 0x40-0x7E, 0x80-0x9E, 0x9F-0xFC.
|
||||
// Windows CP932 is a superset of Shift_JIS. Some companies added more chars, notably KDDI.
|
||||
// * EUC-JP: Up to 3 bytes per character. Used mostly on *nixes.
|
||||
// 0x00-0x7F - lower part of 0201
|
||||
// 0x8E, 0xA1-0xDF - upper part of 0201
|
||||
// (0xA1-0xFE)x2 - 0208 plane (94x94).
|
||||
// 0x8F, (0xA1-0xFE)x2 - 0212 plane (94x94).
|
||||
// * JIS X 208: 7-bit, direct encoding of 0208. Byte ranges: 0x21-0x7E (94 values). Uncommon.
|
||||
// Used as-is in ISO2022 family.
|
||||
// * ISO2022-JP: Stateful encoding, with escape sequences to switch between ASCII,
|
||||
// 0201-1976 Roman, 0208-1978, 0208-1983.
|
||||
// * ISO2022-JP-1: Adds esc seq for 0212-1990.
|
||||
// * ISO2022-JP-2: Adds esc seq for GB2313-1980, KSX1001-1992, ISO8859-1, ISO8859-7.
|
||||
// * ISO2022-JP-3: Adds esc seq for 0201-1976 Kana set, 0213-2000 Planes 1, 2.
|
||||
// * ISO2022-JP-2004: Adds 0213-2004 Plane 1.
|
||||
//
|
||||
// After JIS X 0213 appeared, Shift_JIS-2004, EUC-JISX0213 and ISO2022-JP-2004 followed, with just changing the planes.
|
||||
//
|
||||
// Overall, it seems that it's a mess :( http://www8.plala.or.jp/tkubota1/unicode-symbols-map2.html
|
||||
|
||||
'shiftjis': {
|
||||
type: '_dbcs',
|
||||
table: function() { return require('./tables/shiftjis.json') },
|
||||
encodeAdd: {'\u00a5': 0x5C, '\u203E': 0x7E},
|
||||
encodeSkipVals: [{from: 0xED40, to: 0xF940}],
|
||||
},
|
||||
'csshiftjis': 'shiftjis',
|
||||
'mskanji': 'shiftjis',
|
||||
'sjis': 'shiftjis',
|
||||
'windows31j': 'shiftjis',
|
||||
'ms31j': 'shiftjis',
|
||||
'xsjis': 'shiftjis',
|
||||
'windows932': 'shiftjis',
|
||||
'ms932': 'shiftjis',
|
||||
'932': 'shiftjis',
|
||||
'cp932': 'shiftjis',
|
||||
|
||||
'eucjp': {
|
||||
type: '_dbcs',
|
||||
table: function() { return require('./tables/eucjp.json') },
|
||||
encodeAdd: {'\u00a5': 0x5C, '\u203E': 0x7E},
|
||||
},
|
||||
|
||||
// TODO: KDDI extension to Shift_JIS
|
||||
// TODO: IBM CCSID 942 = CP932, but F0-F9 custom chars and other char changes.
|
||||
// TODO: IBM CCSID 943 = Shift_JIS = CP932 with original Shift_JIS lower 128 chars.
|
||||
|
||||
|
||||
// == Chinese/GBK ==========================================================
|
||||
// http://en.wikipedia.org/wiki/GBK
|
||||
// We mostly implement W3C recommendation: https://www.w3.org/TR/encoding/#gbk-encoder
|
||||
|
||||
// Oldest GB2312 (1981, ~7600 chars) is a subset of CP936
|
||||
'gb2312': 'cp936',
|
||||
'gb231280': 'cp936',
|
||||
'gb23121980': 'cp936',
|
||||
'csgb2312': 'cp936',
|
||||
'csiso58gb231280': 'cp936',
|
||||
'euccn': 'cp936',
|
||||
|
||||
// Microsoft's CP936 is a subset and approximation of GBK.
|
||||
'windows936': 'cp936',
|
||||
'ms936': 'cp936',
|
||||
'936': 'cp936',
|
||||
'cp936': {
|
||||
type: '_dbcs',
|
||||
table: function() { return require('./tables/cp936.json') },
|
||||
},
|
||||
|
||||
// GBK (~22000 chars) is an extension of CP936 that added user-mapped chars and some other.
|
||||
'gbk': {
|
||||
type: '_dbcs',
|
||||
table: function() { return require('./tables/cp936.json').concat(require('./tables/gbk-added.json')) },
|
||||
},
|
||||
'xgbk': 'gbk',
|
||||
'isoir58': 'gbk',
|
||||
|
||||
// GB18030 is an algorithmic extension of GBK.
|
||||
// Main source: https://www.w3.org/TR/encoding/#gbk-encoder
|
||||
// http://icu-project.org/docs/papers/gb18030.html
|
||||
// http://source.icu-project.org/repos/icu/data/trunk/charset/data/xml/gb-18030-2000.xml
|
||||
// http://www.khngai.com/chinese/charmap/tblgbk.php?page=0
|
||||
'gb18030': {
|
||||
type: '_dbcs',
|
||||
table: function() { return require('./tables/cp936.json').concat(require('./tables/gbk-added.json')) },
|
||||
gb18030: function() { return require('./tables/gb18030-ranges.json') },
|
||||
encodeSkipVals: [0x80],
|
||||
encodeAdd: {'€': 0xA2E3},
|
||||
},
|
||||
|
||||
'chinese': 'gb18030',
|
||||
|
||||
|
||||
// == Korean ===============================================================
|
||||
// EUC-KR, KS_C_5601 and KS X 1001 are exactly the same.
|
||||
'windows949': 'cp949',
|
||||
'ms949': 'cp949',
|
||||
'949': 'cp949',
|
||||
'cp949': {
|
||||
type: '_dbcs',
|
||||
table: function() { return require('./tables/cp949.json') },
|
||||
},
|
||||
|
||||
'cseuckr': 'cp949',
|
||||
'csksc56011987': 'cp949',
|
||||
'euckr': 'cp949',
|
||||
'isoir149': 'cp949',
|
||||
'korean': 'cp949',
|
||||
'ksc56011987': 'cp949',
|
||||
'ksc56011989': 'cp949',
|
||||
'ksc5601': 'cp949',
|
||||
|
||||
|
||||
// == Big5/Taiwan/Hong Kong ================================================
|
||||
// There are lots of tables for Big5 and cp950. Please see the following links for history:
|
||||
// http://moztw.org/docs/big5/ http://www.haible.de/bruno/charsets/conversion-tables/Big5.html
|
||||
// Variations, in roughly number of defined chars:
|
||||
// * Windows CP 950: Microsoft variant of Big5. Canonical: http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP950.TXT
|
||||
// * Windows CP 951: Microsoft variant of Big5-HKSCS-2001. Seems to be never public. http://me.abelcheung.org/articles/research/what-is-cp951/
|
||||
// * Big5-2003 (Taiwan standard) almost superset of cp950.
|
||||
// * Unicode-at-on (UAO) / Mozilla 1.8. Falling out of use on the Web. Not supported by other browsers.
|
||||
// * Big5-HKSCS (-2001, -2004, -2008). Hong Kong standard.
|
||||
// many unicode code points moved from PUA to Supplementary plane (U+2XXXX) over the years.
|
||||
// Plus, it has 4 combining sequences.
|
||||
// Seems that Mozilla refused to support it for 10 yrs. https://bugzilla.mozilla.org/show_bug.cgi?id=162431 https://bugzilla.mozilla.org/show_bug.cgi?id=310299
|
||||
// because big5-hkscs is the only encoding to include astral characters in non-algorithmic way.
|
||||
// Implementations are not consistent within browsers; sometimes labeled as just big5.
|
||||
// MS Internet Explorer switches from big5 to big5-hkscs when a patch applied.
|
||||
// Great discussion & recap of what's going on https://bugzilla.mozilla.org/show_bug.cgi?id=912470#c31
|
||||
// In the encoder, it might make sense to support encoding old PUA mappings to Big5 bytes seq-s.
|
||||
// Official spec: http://www.ogcio.gov.hk/en/business/tech_promotion/ccli/terms/doc/2003cmp_2008.txt
|
||||
// http://www.ogcio.gov.hk/tc/business/tech_promotion/ccli/terms/doc/hkscs-2008-big5-iso.txt
|
||||
//
|
||||
// Current understanding of how to deal with Big5(-HKSCS) is in the Encoding Standard, http://encoding.spec.whatwg.org/#big5-encoder
|
||||
// Unicode mapping (http://www.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/OTHER/BIG5.TXT) is said to be wrong.
|
||||
|
||||
'windows950': 'cp950',
|
||||
'ms950': 'cp950',
|
||||
'950': 'cp950',
|
||||
'cp950': {
|
||||
type: '_dbcs',
|
||||
table: function() { return require('./tables/cp950.json') },
|
||||
},
|
||||
|
||||
// Big5 has many variations and is an extension of cp950. We use Encoding Standard's as a consensus.
|
||||
'big5': 'big5hkscs',
|
||||
'big5hkscs': {
|
||||
type: '_dbcs',
|
||||
table: function() { return require('./tables/cp950.json').concat(require('./tables/big5-added.json')) },
|
||||
encodeSkipVals: [0xa2cc],
|
||||
},
|
||||
|
||||
'cnbig5': 'big5hkscs',
|
||||
'csbig5': 'big5hkscs',
|
||||
'xxbig5': 'big5hkscs',
|
||||
};
|
||||
22
node_modules/express/node_modules/iconv-lite/encodings/index.js
generated
vendored
Normal file
22
node_modules/express/node_modules/iconv-lite/encodings/index.js
generated
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
"use strict";
|
||||
|
||||
// Update this array if you add/rename/remove files in this directory.
|
||||
// We support Browserify by skipping automatic module discovery and requiring modules directly.
|
||||
var modules = [
|
||||
require("./internal"),
|
||||
require("./utf16"),
|
||||
require("./utf7"),
|
||||
require("./sbcs-codec"),
|
||||
require("./sbcs-data"),
|
||||
require("./sbcs-data-generated"),
|
||||
require("./dbcs-codec"),
|
||||
require("./dbcs-data"),
|
||||
];
|
||||
|
||||
// Put all encoding/alias/codec definitions to single object and export it.
|
||||
for (var i = 0; i < modules.length; i++) {
|
||||
var module = modules[i];
|
||||
for (var enc in module)
|
||||
if (Object.prototype.hasOwnProperty.call(module, enc))
|
||||
exports[enc] = module[enc];
|
||||
}
|
||||
188
node_modules/express/node_modules/iconv-lite/encodings/internal.js
generated
vendored
Normal file
188
node_modules/express/node_modules/iconv-lite/encodings/internal.js
generated
vendored
Normal file
@ -0,0 +1,188 @@
|
||||
"use strict";
|
||||
var Buffer = require("buffer").Buffer;
|
||||
|
||||
// Export Node.js internal encodings.
|
||||
|
||||
module.exports = {
|
||||
// Encodings
|
||||
utf8: { type: "_internal", bomAware: true},
|
||||
cesu8: { type: "_internal", bomAware: true},
|
||||
unicode11utf8: "utf8",
|
||||
|
||||
ucs2: { type: "_internal", bomAware: true},
|
||||
utf16le: "ucs2",
|
||||
|
||||
binary: { type: "_internal" },
|
||||
base64: { type: "_internal" },
|
||||
hex: { type: "_internal" },
|
||||
|
||||
// Codec.
|
||||
_internal: InternalCodec,
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
function InternalCodec(codecOptions, iconv) {
|
||||
this.enc = codecOptions.encodingName;
|
||||
this.bomAware = codecOptions.bomAware;
|
||||
|
||||
if (this.enc === "base64")
|
||||
this.encoder = InternalEncoderBase64;
|
||||
else if (this.enc === "cesu8") {
|
||||
this.enc = "utf8"; // Use utf8 for decoding.
|
||||
this.encoder = InternalEncoderCesu8;
|
||||
|
||||
// Add decoder for versions of Node not supporting CESU-8
|
||||
if (new Buffer('eda0bdedb2a9', 'hex').toString() !== '💩') {
|
||||
this.decoder = InternalDecoderCesu8;
|
||||
this.defaultCharUnicode = iconv.defaultCharUnicode;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
InternalCodec.prototype.encoder = InternalEncoder;
|
||||
InternalCodec.prototype.decoder = InternalDecoder;
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
// We use node.js internal decoder. Its signature is the same as ours.
|
||||
var StringDecoder = require('string_decoder').StringDecoder;
|
||||
|
||||
if (!StringDecoder.prototype.end) // Node v0.8 doesn't have this method.
|
||||
StringDecoder.prototype.end = function() {};
|
||||
|
||||
|
||||
function InternalDecoder(options, codec) {
|
||||
StringDecoder.call(this, codec.enc);
|
||||
}
|
||||
|
||||
InternalDecoder.prototype = StringDecoder.prototype;
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Encoder is mostly trivial
|
||||
|
||||
function InternalEncoder(options, codec) {
|
||||
this.enc = codec.enc;
|
||||
}
|
||||
|
||||
InternalEncoder.prototype.write = function(str) {
|
||||
return new Buffer(str, this.enc);
|
||||
}
|
||||
|
||||
InternalEncoder.prototype.end = function() {
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Except base64 encoder, which must keep its state.
|
||||
|
||||
function InternalEncoderBase64(options, codec) {
|
||||
this.prevStr = '';
|
||||
}
|
||||
|
||||
InternalEncoderBase64.prototype.write = function(str) {
|
||||
str = this.prevStr + str;
|
||||
var completeQuads = str.length - (str.length % 4);
|
||||
this.prevStr = str.slice(completeQuads);
|
||||
str = str.slice(0, completeQuads);
|
||||
|
||||
return new Buffer(str, "base64");
|
||||
}
|
||||
|
||||
InternalEncoderBase64.prototype.end = function() {
|
||||
return new Buffer(this.prevStr, "base64");
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// CESU-8 encoder is also special.
|
||||
|
||||
function InternalEncoderCesu8(options, codec) {
|
||||
}
|
||||
|
||||
InternalEncoderCesu8.prototype.write = function(str) {
|
||||
var buf = new Buffer(str.length * 3), bufIdx = 0;
|
||||
for (var i = 0; i < str.length; i++) {
|
||||
var charCode = str.charCodeAt(i);
|
||||
// Naive implementation, but it works because CESU-8 is especially easy
|
||||
// to convert from UTF-16 (which all JS strings are encoded in).
|
||||
if (charCode < 0x80)
|
||||
buf[bufIdx++] = charCode;
|
||||
else if (charCode < 0x800) {
|
||||
buf[bufIdx++] = 0xC0 + (charCode >>> 6);
|
||||
buf[bufIdx++] = 0x80 + (charCode & 0x3f);
|
||||
}
|
||||
else { // charCode will always be < 0x10000 in javascript.
|
||||
buf[bufIdx++] = 0xE0 + (charCode >>> 12);
|
||||
buf[bufIdx++] = 0x80 + ((charCode >>> 6) & 0x3f);
|
||||
buf[bufIdx++] = 0x80 + (charCode & 0x3f);
|
||||
}
|
||||
}
|
||||
return buf.slice(0, bufIdx);
|
||||
}
|
||||
|
||||
InternalEncoderCesu8.prototype.end = function() {
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// CESU-8 decoder is not implemented in Node v4.0+
|
||||
|
||||
function InternalDecoderCesu8(options, codec) {
|
||||
this.acc = 0;
|
||||
this.contBytes = 0;
|
||||
this.accBytes = 0;
|
||||
this.defaultCharUnicode = codec.defaultCharUnicode;
|
||||
}
|
||||
|
||||
InternalDecoderCesu8.prototype.write = function(buf) {
|
||||
var acc = this.acc, contBytes = this.contBytes, accBytes = this.accBytes,
|
||||
res = '';
|
||||
for (var i = 0; i < buf.length; i++) {
|
||||
var curByte = buf[i];
|
||||
if ((curByte & 0xC0) !== 0x80) { // Leading byte
|
||||
if (contBytes > 0) { // Previous code is invalid
|
||||
res += this.defaultCharUnicode;
|
||||
contBytes = 0;
|
||||
}
|
||||
|
||||
if (curByte < 0x80) { // Single-byte code
|
||||
res += String.fromCharCode(curByte);
|
||||
} else if (curByte < 0xE0) { // Two-byte code
|
||||
acc = curByte & 0x1F;
|
||||
contBytes = 1; accBytes = 1;
|
||||
} else if (curByte < 0xF0) { // Three-byte code
|
||||
acc = curByte & 0x0F;
|
||||
contBytes = 2; accBytes = 1;
|
||||
} else { // Four or more are not supported for CESU-8.
|
||||
res += this.defaultCharUnicode;
|
||||
}
|
||||
} else { // Continuation byte
|
||||
if (contBytes > 0) { // We're waiting for it.
|
||||
acc = (acc << 6) | (curByte & 0x3f);
|
||||
contBytes--; accBytes++;
|
||||
if (contBytes === 0) {
|
||||
// Check for overlong encoding, but support Modified UTF-8 (encoding NULL as C0 80)
|
||||
if (accBytes === 2 && acc < 0x80 && acc > 0)
|
||||
res += this.defaultCharUnicode;
|
||||
else if (accBytes === 3 && acc < 0x800)
|
||||
res += this.defaultCharUnicode;
|
||||
else
|
||||
// Actually add character.
|
||||
res += String.fromCharCode(acc);
|
||||
}
|
||||
} else { // Unexpected continuation byte
|
||||
res += this.defaultCharUnicode;
|
||||
}
|
||||
}
|
||||
}
|
||||
this.acc = acc; this.contBytes = contBytes; this.accBytes = accBytes;
|
||||
return res;
|
||||
}
|
||||
|
||||
InternalDecoderCesu8.prototype.end = function() {
|
||||
var res = 0;
|
||||
if (this.contBytes > 0)
|
||||
res += this.defaultCharUnicode;
|
||||
return res;
|
||||
}
|
||||
73
node_modules/express/node_modules/iconv-lite/encodings/sbcs-codec.js
generated
vendored
Normal file
73
node_modules/express/node_modules/iconv-lite/encodings/sbcs-codec.js
generated
vendored
Normal file
@ -0,0 +1,73 @@
|
||||
"use strict";
|
||||
var Buffer = require("buffer").Buffer;
|
||||
|
||||
// Single-byte codec. Needs a 'chars' string parameter that contains 256 or 128 chars that
|
||||
// correspond to encoded bytes (if 128 - then lower half is ASCII).
|
||||
|
||||
exports._sbcs = SBCSCodec;
|
||||
function SBCSCodec(codecOptions, iconv) {
|
||||
if (!codecOptions)
|
||||
throw new Error("SBCS codec is called without the data.")
|
||||
|
||||
// Prepare char buffer for decoding.
|
||||
if (!codecOptions.chars || (codecOptions.chars.length !== 128 && codecOptions.chars.length !== 256))
|
||||
throw new Error("Encoding '"+codecOptions.type+"' has incorrect 'chars' (must be of len 128 or 256)");
|
||||
|
||||
if (codecOptions.chars.length === 128) {
|
||||
var asciiString = "";
|
||||
for (var i = 0; i < 128; i++)
|
||||
asciiString += String.fromCharCode(i);
|
||||
codecOptions.chars = asciiString + codecOptions.chars;
|
||||
}
|
||||
|
||||
this.decodeBuf = new Buffer(codecOptions.chars, 'ucs2');
|
||||
|
||||
// Encoding buffer.
|
||||
var encodeBuf = new Buffer(65536);
|
||||
encodeBuf.fill(iconv.defaultCharSingleByte.charCodeAt(0));
|
||||
|
||||
for (var i = 0; i < codecOptions.chars.length; i++)
|
||||
encodeBuf[codecOptions.chars.charCodeAt(i)] = i;
|
||||
|
||||
this.encodeBuf = encodeBuf;
|
||||
}
|
||||
|
||||
SBCSCodec.prototype.encoder = SBCSEncoder;
|
||||
SBCSCodec.prototype.decoder = SBCSDecoder;
|
||||
|
||||
|
||||
function SBCSEncoder(options, codec) {
|
||||
this.encodeBuf = codec.encodeBuf;
|
||||
}
|
||||
|
||||
SBCSEncoder.prototype.write = function(str) {
|
||||
var buf = new Buffer(str.length);
|
||||
for (var i = 0; i < str.length; i++)
|
||||
buf[i] = this.encodeBuf[str.charCodeAt(i)];
|
||||
|
||||
return buf;
|
||||
}
|
||||
|
||||
SBCSEncoder.prototype.end = function() {
|
||||
}
|
||||
|
||||
|
||||
function SBCSDecoder(options, codec) {
|
||||
this.decodeBuf = codec.decodeBuf;
|
||||
}
|
||||
|
||||
SBCSDecoder.prototype.write = function(buf) {
|
||||
// Strings are immutable in JS -> we use ucs2 buffer to speed up computations.
|
||||
var decodeBuf = this.decodeBuf;
|
||||
var newBuf = new Buffer(buf.length*2);
|
||||
var idx1 = 0, idx2 = 0;
|
||||
for (var i = 0; i < buf.length; i++) {
|
||||
idx1 = buf[i]*2; idx2 = i*2;
|
||||
newBuf[idx2] = decodeBuf[idx1];
|
||||
newBuf[idx2+1] = decodeBuf[idx1+1];
|
||||
}
|
||||
return newBuf.toString('ucs2');
|
||||
}
|
||||
|
||||
SBCSDecoder.prototype.end = function() {
|
||||
}
|
||||
451
node_modules/express/node_modules/iconv-lite/encodings/sbcs-data-generated.js
generated
vendored
Normal file
451
node_modules/express/node_modules/iconv-lite/encodings/sbcs-data-generated.js
generated
vendored
Normal file
@ -0,0 +1,451 @@
|
||||
"use strict";
|
||||
|
||||
// Generated data for sbcs codec. Don't edit manually. Regenerate using generation/gen-sbcs.js script.
|
||||
module.exports = {
|
||||
"437": "cp437",
|
||||
"737": "cp737",
|
||||
"775": "cp775",
|
||||
"850": "cp850",
|
||||
"852": "cp852",
|
||||
"855": "cp855",
|
||||
"856": "cp856",
|
||||
"857": "cp857",
|
||||
"858": "cp858",
|
||||
"860": "cp860",
|
||||
"861": "cp861",
|
||||
"862": "cp862",
|
||||
"863": "cp863",
|
||||
"864": "cp864",
|
||||
"865": "cp865",
|
||||
"866": "cp866",
|
||||
"869": "cp869",
|
||||
"874": "windows874",
|
||||
"922": "cp922",
|
||||
"1046": "cp1046",
|
||||
"1124": "cp1124",
|
||||
"1125": "cp1125",
|
||||
"1129": "cp1129",
|
||||
"1133": "cp1133",
|
||||
"1161": "cp1161",
|
||||
"1162": "cp1162",
|
||||
"1163": "cp1163",
|
||||
"1250": "windows1250",
|
||||
"1251": "windows1251",
|
||||
"1252": "windows1252",
|
||||
"1253": "windows1253",
|
||||
"1254": "windows1254",
|
||||
"1255": "windows1255",
|
||||
"1256": "windows1256",
|
||||
"1257": "windows1257",
|
||||
"1258": "windows1258",
|
||||
"28591": "iso88591",
|
||||
"28592": "iso88592",
|
||||
"28593": "iso88593",
|
||||
"28594": "iso88594",
|
||||
"28595": "iso88595",
|
||||
"28596": "iso88596",
|
||||
"28597": "iso88597",
|
||||
"28598": "iso88598",
|
||||
"28599": "iso88599",
|
||||
"28600": "iso885910",
|
||||
"28601": "iso885911",
|
||||
"28603": "iso885913",
|
||||
"28604": "iso885914",
|
||||
"28605": "iso885915",
|
||||
"28606": "iso885916",
|
||||
"windows874": {
|
||||
"type": "_sbcs",
|
||||
"chars": "€<><E282AC><EFBFBD><EFBFBD>…<EFBFBD><E280A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>‘’“”•–—<E28093><E28094><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู<E0B8B9><E0B8BA><EFBFBD><EFBFBD>฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛<E0B99A><E0B99B><EFBFBD><EFBFBD>"
|
||||
},
|
||||
"win874": "windows874",
|
||||
"cp874": "windows874",
|
||||
"windows1250": {
|
||||
"type": "_sbcs",
|
||||
"chars": "€<>‚<EFBFBD>„…†‡<E280A0>‰Š‹ŚŤŽŹ<C5BD>‘’“”•–—<E28093>™š›śťžź ˇ˘Ł¤Ą¦§¨©Ş«¬®Ż°±˛ł´µ¶·¸ąş»Ľ˝ľżŔÁÂĂÄĹĆÇČÉĘËĚÍÎĎĐŃŇÓÔŐÖ×ŘŮÚŰÜÝŢßŕáâăäĺćçčéęëěíîďđńňóôőö÷řůúűüýţ˙"
|
||||
},
|
||||
"win1250": "windows1250",
|
||||
"cp1250": "windows1250",
|
||||
"windows1251": {
|
||||
"type": "_sbcs",
|
||||
"chars": "ЂЃ‚ѓ„…†‡€‰Љ‹ЊЌЋЏђ‘’“”•–—<E28093>™љ›њќћџ ЎўЈ¤Ґ¦§Ё©Є«¬®Ї°±Ііґµ¶·ё№є»јЅѕїАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя"
|
||||
},
|
||||
"win1251": "windows1251",
|
||||
"cp1251": "windows1251",
|
||||
"windows1252": {
|
||||
"type": "_sbcs",
|
||||
"chars": "€<>‚ƒ„…†‡ˆ‰Š‹Œ<E280B9>Ž<EFBFBD><C5BD>‘’“”•–—˜™š›œ<E280BA>žŸ ¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ"
|
||||
},
|
||||
"win1252": "windows1252",
|
||||
"cp1252": "windows1252",
|
||||
"windows1253": {
|
||||
"type": "_sbcs",
|
||||
"chars": "€<>‚ƒ„…†‡<E280A0>‰<EFBFBD>‹<EFBFBD><E280B9><EFBFBD><EFBFBD><EFBFBD>‘’“”•–—<E28093>™<EFBFBD>›<EFBFBD><E280BA><EFBFBD><EFBFBD> ΅Ά£¤¥¦§¨©<C2A8>«¬®―°±²³΄µ¶·ΈΉΊ»Ό½ΎΏΐΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡ<CEA0>ΣΤΥΦΧΨΩΪΫάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώ<CF8D>"
|
||||
},
|
||||
"win1253": "windows1253",
|
||||
"cp1253": "windows1253",
|
||||
"windows1254": {
|
||||
"type": "_sbcs",
|
||||
"chars": "€<>‚ƒ„…†‡ˆ‰Š‹Œ<E280B9><C592><EFBFBD><EFBFBD>‘’“”•–—˜™š›œ<E280BA><C593>Ÿ ¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏĞÑÒÓÔÕÖרÙÚÛÜİŞßàáâãäåæçèéêëìíîïğñòóôõö÷øùúûüışÿ"
|
||||
},
|
||||
"win1254": "windows1254",
|
||||
"cp1254": "windows1254",
|
||||
"windows1255": {
|
||||
"type": "_sbcs",
|
||||
"chars": "€<>‚ƒ„…†‡ˆ‰<CB86>‹<EFBFBD><E280B9><EFBFBD><EFBFBD><EFBFBD>‘’“”•–—˜™<CB9C>›<EFBFBD><E280BA><EFBFBD><EFBFBD> ¡¢£₪¥¦§¨©×«¬®¯°±²³´µ¶·¸¹÷»¼½¾¿ְֱֲֳִֵֶַָֹֺֻּֽ־ֿ׀ׁׂ׃װױײ׳״<D7B3><D7B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>אבגדהוזחטיךכלםמןנסעףפץצקרשת<D7A9><D7AA><E2808E>"
|
||||
},
|
||||
"win1255": "windows1255",
|
||||
"cp1255": "windows1255",
|
||||
"windows1256": {
|
||||
"type": "_sbcs",
|
||||
"chars": "€پ‚ƒ„…†‡ˆ‰ٹ‹Œچژڈگ‘’“”•–—ک™ڑ›œں ،¢£¤¥¦§¨©ھ«¬®¯°±²³´µ¶·¸¹؛»¼½¾؟ہءآأؤإئابةتثجحخدذرزسشصض×طظعغـفقكàلâمنهوçèéêëىيîïًٌٍَôُِ÷ّùْûüے"
|
||||
},
|
||||
"win1256": "windows1256",
|
||||
"cp1256": "windows1256",
|
||||
"windows1257": {
|
||||
"type": "_sbcs",
|
||||
"chars": "€<>‚<EFBFBD>„…†‡<E280A0>‰<EFBFBD>‹<EFBFBD>¨ˇ¸<CB87>‘’“”•–—<E28093>™<EFBFBD>›<EFBFBD>¯˛<C2AF> <EFBFBD>¢£¤<C2A3>¦§Ø©Ŗ«¬®Æ°±²³´µ¶·ø¹ŗ»¼½¾æĄĮĀĆÄÅĘĒČÉŹĖĢĶĪĻŠŃŅÓŌÕÖ×ŲŁŚŪÜŻŽßąįāćäåęēčéźėģķīļšńņóōõö÷ųłśūüżž˙"
|
||||
},
|
||||
"win1257": "windows1257",
|
||||
"cp1257": "windows1257",
|
||||
"windows1258": {
|
||||
"type": "_sbcs",
|
||||
"chars": "€<>‚ƒ„…†‡ˆ‰<CB86>‹Œ<E280B9><C592><EFBFBD><EFBFBD>‘’“”•–—˜™<CB9C>›œ<E280BA><C593>Ÿ ¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖרÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ"
|
||||
},
|
||||
"win1258": "windows1258",
|
||||
"cp1258": "windows1258",
|
||||
"iso88591": {
|
||||
"type": "_sbcs",
|
||||
"chars": "
¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ"
|
||||
},
|
||||
"cp28591": "iso88591",
|
||||
"iso88592": {
|
||||
"type": "_sbcs",
|
||||
"chars": "
Ą˘Ł¤ĽŚ§¨ŠŞŤŹŽŻ°ą˛ł´ľśˇ¸šşťź˝žżŔÁÂĂÄĹĆÇČÉĘËĚÍÎĎĐŃŇÓÔŐÖ×ŘŮÚŰÜÝŢßŕáâăäĺćçčéęëěíîďđńňóôőö÷řůúűüýţ˙"
|
||||
},
|
||||
"cp28592": "iso88592",
|
||||
"iso88593": {
|
||||
"type": "_sbcs",
|
||||
"chars": "
Ħ˘£¤<C2A3>Ĥ§¨İŞĞĴ<C4B4>ݰħ²³´µĥ·¸ışğĵ½<C4B5>żÀÁÂ<C381>ÄĊĈÇÈÉÊËÌÍÎÏ<C38E>ÑÒÓÔĠÖ×ĜÙÚÛÜŬŜßàáâ<C3A1>äċĉçèéêëìíîï<C3AE>ñòóôġö÷ĝùúûüŭŝ˙"
|
||||
},
|
||||
"cp28593": "iso88593",
|
||||
"iso88594": {
|
||||
"type": "_sbcs",
|
||||
"chars": "
ĄĸŖ¤Ĩϧ¨ŠĒĢŦޝ°ą˛ŗ´ĩšēģŧŊžŋĀÁÂÃÄÅÆĮČÉĘËĖÍÎĪĐŅŌĶÔÕÖרŲÚÛÜŨŪßāáâãäåæįčéęëėíîīđņōķôõö÷øųúûüũū˙"
|
||||
},
|
||||
"cp28594": "iso88594",
|
||||
"iso88595": {
|
||||
"type": "_sbcs",
|
||||
"chars": "
ЁЂЃЄЅІЇЈЉЊЋЌЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя№ёђѓєѕіїјљњћќ§ўџ"
|
||||
},
|
||||
"cp28595": "iso88595",
|
||||
"iso88596": {
|
||||
"type": "_sbcs",
|
||||
"chars": "
<C29F><C2A0><EFBFBD>¤<EFBFBD><C2A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>،<D88C><C2AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>؛<EFBFBD><D89B><EFBFBD>؟<EFBFBD>ءآأؤإئابةتثجحخدذرزسشصضطظعغ<D8B9><D8BA><EFBFBD><EFBFBD><EFBFBD>ـفقكلمنهوىيًٌٍَُِّْ<D991><D992><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
||||
},
|
||||
"cp28596": "iso88596",
|
||||
"iso88597": {
|
||||
"type": "_sbcs",
|
||||
"chars": "
‘’£€₯¦§¨©ͺ«¬<C2AC>―°±²³΄΅Ά·ΈΉΊ»Ό½ΎΏΐΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡ<CEA0>ΣΤΥΦΧΨΩΪΫάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώ<CF8D>"
|
||||
},
|
||||
"cp28597": "iso88597",
|
||||
"iso88598": {
|
||||
"type": "_sbcs",
|
||||
"chars": "
<C29F>¢£¤¥¦§¨©×«¬®¯°±²³´µ¶·¸¹÷»¼½¾<C2BD><C2BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>‗אבגדהוזחטיךכלםמןנסעףפץצקרשת<D7A9><D7AA><E2808E>"
|
||||
},
|
||||
"cp28598": "iso88598",
|
||||
"iso88599": {
|
||||
"type": "_sbcs",
|
||||
"chars": "
¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏĞÑÒÓÔÕÖרÙÚÛÜİŞßàáâãäåæçèéêëìíîïğñòóôõö÷øùúûüışÿ"
|
||||
},
|
||||
"cp28599": "iso88599",
|
||||
"iso885910": {
|
||||
"type": "_sbcs",
|
||||
"chars": "
ĄĒĢĪĨͧĻĐŠŦŽŪŊ°ąēģīĩķ·ļđšŧž―ūŋĀÁÂÃÄÅÆĮČÉĘËĖÍÎÏÐŅŌÓÔÕÖŨØŲÚÛÜÝÞßāáâãäåæįčéęëėíîïðņōóôõöũøųúûüýþĸ"
|
||||
},
|
||||
"cp28600": "iso885910",
|
||||
"iso885911": {
|
||||
"type": "_sbcs",
|
||||
"chars": "
กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู<E0B8B9><E0B8BA><EFBFBD><EFBFBD>฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛<E0B99A><E0B99B><EFBFBD><EFBFBD>"
|
||||
},
|
||||
"cp28601": "iso885911",
|
||||
"iso885913": {
|
||||
"type": "_sbcs",
|
||||
"chars": "
”¢£¤„¦§Ø©Ŗ«¬®Æ°±²³“µ¶·ø¹ŗ»¼½¾æĄĮĀĆÄÅĘĒČÉŹĖĢĶĪĻŠŃŅÓŌÕÖ×ŲŁŚŪÜŻŽßąįāćäåęēčéźėģķīļšńņóōõö÷ųłśūüżž’"
|
||||
},
|
||||
"cp28603": "iso885913",
|
||||
"iso885914": {
|
||||
"type": "_sbcs",
|
||||
"chars": "
Ḃḃ£ĊċḊ§Ẁ©ẂḋỲ®ŸḞḟĠġṀṁ¶ṖẁṗẃṠỳẄẅṡÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏŴÑÒÓÔÕÖṪØÙÚÛÜÝŶßàáâãäåæçèéêëìíîïŵñòóôõöṫøùúûüýŷÿ"
|
||||
},
|
||||
"cp28604": "iso885914",
|
||||
"iso885915": {
|
||||
"type": "_sbcs",
|
||||
"chars": "
¡¢£€¥Š§š©ª«¬®¯°±²³Žµ¶·ž¹º»ŒœŸ¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ"
|
||||
},
|
||||
"cp28605": "iso885915",
|
||||
"iso885916": {
|
||||
"type": "_sbcs",
|
||||
"chars": "
ĄąŁ€„Чš©Ș«ŹźŻ°±ČłŽ”¶·žčș»ŒœŸżÀÁÂĂÄĆÆÇÈÉÊËÌÍÎÏĐŃÒÓÔŐÖŚŰÙÚÛÜĘȚßàáâăäćæçèéêëìíîïđńòóôőöśűùúûüęțÿ"
|
||||
},
|
||||
"cp28606": "iso885916",
|
||||
"cp437": {
|
||||
"type": "_sbcs",
|
||||
"chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ "
|
||||
},
|
||||
"ibm437": "cp437",
|
||||
"csibm437": "cp437",
|
||||
"cp737": {
|
||||
"type": "_sbcs",
|
||||
"chars": "ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩαβγδεζηθικλμνξοπρσςτυφχψ░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀ωάέήϊίόύϋώΆΈΉΊΌΎΏ±≥≤ΪΫ÷≈°∙·√ⁿ²■ "
|
||||
},
|
||||
"ibm737": "cp737",
|
||||
"csibm737": "cp737",
|
||||
"cp775": {
|
||||
"type": "_sbcs",
|
||||
"chars": "ĆüéāäģåćłēŖŗīŹÄÅÉæÆōöĢ¢ŚśÖÜø£Ø×¤ĀĪóŻżź”¦©®¬½¼Ł«»░▒▓│┤ĄČĘĖ╣║╗╝ĮŠ┐└┴┬├─┼ŲŪ╚╔╩╦╠═╬Žąčęėįšųūž┘┌█▄▌▐▀ÓßŌŃõÕµńĶķĻļņĒŅ’±“¾¶§÷„°∙·¹³²■ "
|
||||
},
|
||||
"ibm775": "cp775",
|
||||
"csibm775": "cp775",
|
||||
"cp850": {
|
||||
"type": "_sbcs",
|
||||
"chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø×ƒáíóúñѪº¿®¬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ðÐÊËÈıÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµþÞÚÛÙýݯ´±‗¾¶§÷¸°¨·¹³²■ "
|
||||
},
|
||||
"ibm850": "cp850",
|
||||
"csibm850": "cp850",
|
||||
"cp852": {
|
||||
"type": "_sbcs",
|
||||
"chars": "ÇüéâäůćçłëŐőîŹÄĆÉĹĺôöĽľŚśÖÜŤťŁ×čáíóúĄąŽžĘ꬟Ⱥ«»░▒▓│┤ÁÂĚŞ╣║╗╝Żż┐└┴┬├─┼Ăă╚╔╩╦╠═╬¤đĐĎËďŇÍÎě┘┌█▄ŢŮ▀ÓßÔŃńňŠšŔÚŕŰýÝţ´˝˛ˇ˘§÷¸°¨˙űŘř■ "
|
||||
},
|
||||
"ibm852": "cp852",
|
||||
"csibm852": "cp852",
|
||||
"cp855": {
|
||||
"type": "_sbcs",
|
||||
"chars": "ђЂѓЃёЁєЄѕЅіІїЇјЈљЉњЊћЋќЌўЎџЏюЮъЪаАбБцЦдДеЕфФгГ«»░▒▓│┤хХиИ╣║╗╝йЙ┐└┴┬├─┼кК╚╔╩╦╠═╬¤лЛмМнНоОп┘┌█▄Пя▀ЯрРсСтТуУжЖвВьЬ№ыЫзЗшШэЭщЩчЧ§■ "
|
||||
},
|
||||
"ibm855": "cp855",
|
||||
"csibm855": "cp855",
|
||||
"cp856": {
|
||||
"type": "_sbcs",
|
||||
"chars": "אבגדהוזחטיךכלםמןנסעףפץצקרשת<D7A9>£<EFBFBD>×<EFBFBD><C397><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>®¬½¼<C2BD>«»░▒▓│┤<E29482><E294A4><EFBFBD>©╣║╗╝¢¥┐└┴┬├─┼<E29480><E294BC>╚╔╩╦╠═╬¤<E295AC><C2A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>┘┌█▄¦<E29684>▀<EFBFBD><E29680><EFBFBD><EFBFBD><EFBFBD><EFBFBD>µ<EFBFBD><C2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¯´±‗¾¶§÷¸°¨·¹³²■ "
|
||||
},
|
||||
"ibm856": "cp856",
|
||||
"csibm856": "cp856",
|
||||
"cp857": {
|
||||
"type": "_sbcs",
|
||||
"chars": "ÇüéâäàåçêëèïîıÄÅÉæÆôöòûùİÖÜø£ØŞşáíóúñÑĞ𿮬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ºªÊËÈ<C38B>ÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµ<C395>×ÚÛÙìÿ¯´±<C2AD>¾¶§÷¸°¨·¹³²■ "
|
||||
},
|
||||
"ibm857": "cp857",
|
||||
"csibm857": "cp857",
|
||||
"cp858": {
|
||||
"type": "_sbcs",
|
||||
"chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø×ƒáíóúñѪº¿®¬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ðÐÊËÈ€ÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµþÞÚÛÙýݯ´±‗¾¶§÷¸°¨·¹³²■ "
|
||||
},
|
||||
"ibm858": "cp858",
|
||||
"csibm858": "cp858",
|
||||
"cp860": {
|
||||
"type": "_sbcs",
|
||||
"chars": "ÇüéâãàÁçêÊèÍÔìÃÂÉÀÈôõòÚùÌÕÜ¢£Ù₧ÓáíóúñѪº¿Ò¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ "
|
||||
},
|
||||
"ibm860": "cp860",
|
||||
"csibm860": "cp860",
|
||||
"cp861": {
|
||||
"type": "_sbcs",
|
||||
"chars": "ÇüéâäàåçêëèÐðÞÄÅÉæÆôöþûÝýÖÜø£Ø₧ƒáíóúÁÍÓÚ¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ "
|
||||
},
|
||||
"ibm861": "cp861",
|
||||
"csibm861": "cp861",
|
||||
"cp862": {
|
||||
"type": "_sbcs",
|
||||
"chars": "אבגדהוזחטיךכלםמןנסעףפץצקרשת¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ "
|
||||
},
|
||||
"ibm862": "cp862",
|
||||
"csibm862": "cp862",
|
||||
"cp863": {
|
||||
"type": "_sbcs",
|
||||
"chars": "ÇüéâÂà¶çêëèïî‗À§ÉÈÊôËÏûù¤ÔÜ¢£ÙÛƒ¦´óú¨¸³¯Î⌐¬½¼¾«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ "
|
||||
},
|
||||
"ibm863": "cp863",
|
||||
"csibm863": "cp863",
|
||||
"cp864": {
|
||||
"type": "_sbcs",
|
||||
"chars": "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$٪&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~°·∙√▒─│┼┤┬├┴┐┌└┘β∞φ±½¼≈«»ﻷﻸ<EFBBB7><EFBBB8>ﻻﻼ<EFBBBB> ﺂ£¤ﺄ<C2A4><EFBA84>ﺎﺏﺕﺙ،ﺝﺡﺥ٠١٢٣٤٥٦٧٨٩ﻑ؛ﺱﺵﺹ؟¢ﺀﺁﺃﺅﻊﺋﺍﺑﺓﺗﺛﺟﺣﺧﺩﺫﺭﺯﺳﺷﺻﺿﻁﻅﻋﻏ¦¬÷×ﻉـﻓﻗﻛﻟﻣﻧﻫﻭﻯﻳﺽﻌﻎﻍﻡﹽّﻥﻩﻬﻰﻲﻐﻕﻵﻶﻝﻙﻱ■<EFBBB1>"
|
||||
},
|
||||
"ibm864": "cp864",
|
||||
"csibm864": "cp864",
|
||||
"cp865": {
|
||||
"type": "_sbcs",
|
||||
"chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø₧ƒáíóúñѪº¿⌐¬½¼¡«¤░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ "
|
||||
},
|
||||
"ibm865": "cp865",
|
||||
"csibm865": "cp865",
|
||||
"cp866": {
|
||||
"type": "_sbcs",
|
||||
"chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёЄєЇїЎў°∙·√№¤■ "
|
||||
},
|
||||
"ibm866": "cp866",
|
||||
"csibm866": "cp866",
|
||||
"cp869": {
|
||||
"type": "_sbcs",
|
||||
"chars": "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ά<EFBFBD>·¬¦‘’Έ―ΉΊΪΌ<CEAA><CE8C>ΎΫ©Ώ²³ά£έήίϊΐόύΑΒΓΔΕΖΗ½ΘΙ«»░▒▓│┤ΚΛΜΝ╣║╗╝ΞΟ┐└┴┬├─┼ΠΡ╚╔╩╦╠═╬ΣΤΥΦΧΨΩαβγ┘┌█▄δε▀ζηθικλμνξοπρσςτ΄±υφχ§ψ΅°¨ωϋΰώ■ "
|
||||
},
|
||||
"ibm869": "cp869",
|
||||
"csibm869": "cp869",
|
||||
"cp922": {
|
||||
"type": "_sbcs",
|
||||
"chars": "
¡¢£¤¥¦§¨©ª«¬®‾°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏŠÑÒÓÔÕÖרÙÚÛÜÝŽßàáâãäåæçèéêëìíîïšñòóôõö÷øùúûüýžÿ"
|
||||
},
|
||||
"ibm922": "cp922",
|
||||
"csibm922": "cp922",
|
||||
"cp1046": {
|
||||
"type": "_sbcs",
|
||||
"chars": "ﺈ×÷ﹱ■│─┐┌└┘ﹹﹻﹽﹿﹷﺊﻰﻳﻲﻎﻏﻐﻶﻸﻺﻼ ¤ﺋﺑﺗﺛﺟﺣ،ﺧﺳ٠١٢٣٤٥٦٧٨٩ﺷ؛ﺻﺿﻊ؟ﻋءآأؤإئابةتثجحخدذرزسشصضطﻇعغﻌﺂﺄﺎﻓـفقكلمنهوىيًٌٍَُِّْﻗﻛﻟﻵﻷﻹﻻﻣﻧﻬﻩ<EFBBAC>"
|
||||
},
|
||||
"ibm1046": "cp1046",
|
||||
"csibm1046": "cp1046",
|
||||
"cp1124": {
|
||||
"type": "_sbcs",
|
||||
"chars": "
ЁЂҐЄЅІЇЈЉЊЋЌЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя№ёђґєѕіїјљњћќ§ўџ"
|
||||
},
|
||||
"ibm1124": "cp1124",
|
||||
"csibm1124": "cp1124",
|
||||
"cp1125": {
|
||||
"type": "_sbcs",
|
||||
"chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёҐґЄєІіЇї·√№¤■ "
|
||||
},
|
||||
"ibm1125": "cp1125",
|
||||
"csibm1125": "cp1125",
|
||||
"cp1129": {
|
||||
"type": "_sbcs",
|
||||
"chars": "
¡¢£¤¥¦§œ©ª«¬®¯°±²³Ÿµ¶·Œ¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖרÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ"
|
||||
},
|
||||
"ibm1129": "cp1129",
|
||||
"csibm1129": "cp1129",
|
||||
"cp1133": {
|
||||
"type": "_sbcs",
|
||||
"chars": "
ກຂຄງຈສຊຍດຕຖທນບປຜຝພຟມຢຣລວຫອຮ<E0BAAD><E0BAAE><EFBFBD>ຯະາຳິີຶືຸູຼັົຽ<E0BABB><E0BABD><EFBFBD>ເແໂໃໄ່້໊໋໌ໍໆ<E0BB8D>ໜໝ₭<E0BB9D><E282AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>໐໑໒໓໔໕໖໗໘໙<E0BB98><E0BB99>¢¬¦<C2AC>"
|
||||
},
|
||||
"ibm1133": "cp1133",
|
||||
"csibm1133": "cp1133",
|
||||
"cp1161": {
|
||||
"type": "_sbcs",
|
||||
"chars": "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>่กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู้๊๋€฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛¢¬¦ "
|
||||
},
|
||||
"ibm1161": "cp1161",
|
||||
"csibm1161": "cp1161",
|
||||
"cp1162": {
|
||||
"type": "_sbcs",
|
||||
"chars": "€…‘’“”•–— กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู<E0B8B9><E0B8BA><EFBFBD><EFBFBD>฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛<E0B99A><E0B99B><EFBFBD><EFBFBD>"
|
||||
},
|
||||
"ibm1162": "cp1162",
|
||||
"csibm1162": "cp1162",
|
||||
"cp1163": {
|
||||
"type": "_sbcs",
|
||||
"chars": "
¡¢£€¥¦§œ©ª«¬®¯°±²³Ÿµ¶·Œ¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖרÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ"
|
||||
},
|
||||
"ibm1163": "cp1163",
|
||||
"csibm1163": "cp1163",
|
||||
"maccroatian": {
|
||||
"type": "_sbcs",
|
||||
"chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈ƫȅ ÀÃÕŒœĐ—“”‘’÷◊<C3B7>©⁄¤‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ"
|
||||
},
|
||||
"maccyrillic": {
|
||||
"type": "_sbcs",
|
||||
"chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°¢£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµ∂ЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю¤"
|
||||
},
|
||||
"macgreek": {
|
||||
"type": "_sbcs",
|
||||
"chars": "Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ<CE90>"
|
||||
},
|
||||
"maciceland": {
|
||||
"type": "_sbcs",
|
||||
"chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüݰ¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔ<C393>ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ"
|
||||
},
|
||||
"macroman": {
|
||||
"type": "_sbcs",
|
||||
"chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ<C393>ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ"
|
||||
},
|
||||
"macromania": {
|
||||
"type": "_sbcs",
|
||||
"chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂŞ∞±≤≥¥µ∂∑∏π∫ªºΩăş¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›Ţţ‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ<C393>ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ"
|
||||
},
|
||||
"macthai": {
|
||||
"type": "_sbcs",
|
||||
"chars": "«»…“”<E2809D>•‘’<E28098> กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู–—฿เแโใไๅๆ็่้๊๋์ํ™๏๐๑๒๓๔๕๖๗๘๙®©<C2AE><C2A9><EFBFBD><EFBFBD>"
|
||||
},
|
||||
"macturkish": {
|
||||
"type": "_sbcs",
|
||||
"chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ<C393>ÒÚÛÙ<C39B>ˆ˜¯˘˙˚¸˝˛ˇ"
|
||||
},
|
||||
"macukraine": {
|
||||
"type": "_sbcs",
|
||||
"chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю¤"
|
||||
},
|
||||
"koi8r": {
|
||||
"type": "_sbcs",
|
||||
"chars": "─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ё╓╔╕╖╗╘╙╚╛╜╝╞╟╠╡Ё╢╣╤╥╦╧╨╩╪╫╬©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ"
|
||||
},
|
||||
"koi8u": {
|
||||
"type": "_sbcs",
|
||||
"chars": "─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ёє╔ії╗╘╙╚╛ґ╝╞╟╠╡ЁЄ╣ІЇ╦╧╨╩╪Ґ╬©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ"
|
||||
},
|
||||
"koi8ru": {
|
||||
"type": "_sbcs",
|
||||
"chars": "─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ёє╔ії╗╘╙╚╛ґў╞╟╠╡ЁЄ╣ІЇ╦╧╨╩╪ҐЎ©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ"
|
||||
},
|
||||
"koi8t": {
|
||||
"type": "_sbcs",
|
||||
"chars": "қғ‚Ғ„…†‡<E280A0>‰ҳ‹ҲҷҶ<D2B7>Қ‘’“”•–—<E28093>™<EFBFBD>›<EFBFBD><E280BA><EFBFBD><EFBFBD><EFBFBD>ӯӮё¤ӣ¦§<C2A6><C2A7><EFBFBD>«¬®<C2AD>°±²Ё<C2B2>Ӣ¶·<C2B6>№<EFBFBD>»<EFBFBD><C2BB><EFBFBD>©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ"
|
||||
},
|
||||
"armscii8": {
|
||||
"type": "_sbcs",
|
||||
"chars": "
<C29F>և։)(»«—.՝,-֊…՜՛՞ԱաԲբԳգԴդԵեԶզԷէԸըԹթԺժԻիԼլԽխԾծԿկՀհՁձՂղՃճՄմՅյՆնՇշՈոՉչՊպՋջՌռՍսՎվՏտՐրՑցՒւՓփՔքՕօՖֆ՚<D686>"
|
||||
},
|
||||
"rk1048": {
|
||||
"type": "_sbcs",
|
||||
"chars": "ЂЃ‚ѓ„…†‡€‰Љ‹ЊҚҺЏђ‘’“”•–—<E28093>™љ›њқһџ ҰұӘ¤Ө¦§Ё©Ғ«¬®Ү°±Ііөµ¶·ё№ғ»әҢңүАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя"
|
||||
},
|
||||
"tcvn": {
|
||||
"type": "_sbcs",
|
||||
"chars": "\u0000ÚỤ\u0003ỪỬỮ\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010ỨỰỲỶỸÝỴ\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÀẢÃÁẠẶẬÈẺẼÉẸỆÌỈĨÍỊÒỎÕÓỌỘỜỞỠỚỢÙỦŨ ĂÂÊÔƠƯĐăâêôơưđẶ̀̀̉̃́àảãáạẲằẳẵắẴẮẦẨẪẤỀặầẩẫấậèỂẻẽéẹềểễếệìỉỄẾỒĩíịòỔỏõóọồổỗốộờởỡớợùỖủũúụừửữứựỳỷỹýỵỐ"
|
||||
},
|
||||
"georgianacademy": {
|
||||
"type": "_sbcs",
|
||||
"chars": "‚ƒ„…†‡ˆ‰Š‹Œ‘’“”•–—˜™š›œŸ ¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿აბგდევზთიკლმნოპჟრსტუფქღყშჩცძწჭხჯჰჱჲჳჴჵჶçèéêëìíîïðñòóôõö÷øùúûüýþÿ"
|
||||
},
|
||||
"georgianps": {
|
||||
"type": "_sbcs",
|
||||
"chars": "‚ƒ„…†‡ˆ‰Š‹Œ‘’“”•–—˜™š›œŸ ¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿აბგდევზჱთიკლმნჲოპჟრსტჳუფქღყშჩცძწჭხჴჯჰჵæçèéêëìíîïðñòóôõö÷øùúûüýþÿ"
|
||||
},
|
||||
"pt154": {
|
||||
"type": "_sbcs",
|
||||
"chars": "ҖҒӮғ„…ҶҮҲүҠӢҢҚҺҸҗ‘’“”•–—ҳҷҡӣңқһҹ ЎўЈӨҘҰ§Ё©Ә«¬ӯ®Ҝ°ұІіҙө¶·ё№ә»јҪҫҝАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя"
|
||||
},
|
||||
"viscii": {
|
||||
"type": "_sbcs",
|
||||
"chars": "\u0000\u0001Ẳ\u0003\u0004ẴẪ\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013Ỷ\u0015\u0016\u0017\u0018Ỹ\u001a\u001b\u001c\u001dỴ\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ẠẮẰẶẤẦẨẬẼẸẾỀỂỄỆỐỒỔỖỘỢỚỜỞỊỎỌỈỦŨỤỲÕắằặấầẩậẽẹếềểễệốồổỗỠƠộờởịỰỨỪỬơớƯÀÁÂÃẢĂẳẵÈÉÊẺÌÍĨỳĐứÒÓÔạỷừửÙÚỹỵÝỡưàáâãảăữẫèéêẻìíĩỉđựòóôõỏọụùúũủýợỮ"
|
||||
},
|
||||
"iso646cn": {
|
||||
"type": "_sbcs",
|
||||
"chars": "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#¥%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}‾<E280BE><7F><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
||||
},
|
||||
"iso646jp": {
|
||||
"type": "_sbcs",
|
||||
"chars": "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[¥]^_`abcdefghijklmnopqrstuvwxyz{|}‾<E280BE><7F><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
||||
},
|
||||
"hproman8": {
|
||||
"type": "_sbcs",
|
||||
"chars": "
ÀÂÈÊËÎÏ´ˋˆ¨˜ÙÛ₤¯Ýý°ÇçÑñ¡¿¤£¥§ƒ¢âêôûáéóúàèòùäëöüÅîØÆåíøæÄìÖÜÉïßÔÁÃãÐðÍÌÓÒÕõŠšÚŸÿÞþ·µ¶¾—¼½ªº«■»±<C2BB>"
|
||||
},
|
||||
"macintosh": {
|
||||
"type": "_sbcs",
|
||||
"chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ<C393>ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ"
|
||||
},
|
||||
"ascii": {
|
||||
"type": "_sbcs",
|
||||
"chars": "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
||||
},
|
||||
"tis620": {
|
||||
"type": "_sbcs",
|
||||
"chars": "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู<E0B8B9><E0B8BA><EFBFBD><EFBFBD>฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛<E0B99A><E0B99B><EFBFBD><EFBFBD>"
|
||||
}
|
||||
}
|
||||
169
node_modules/express/node_modules/iconv-lite/encodings/sbcs-data.js
generated
vendored
Normal file
169
node_modules/express/node_modules/iconv-lite/encodings/sbcs-data.js
generated
vendored
Normal file
@ -0,0 +1,169 @@
|
||||
"use strict";
|
||||
|
||||
// Manually added data to be used by sbcs codec in addition to generated one.
|
||||
|
||||
module.exports = {
|
||||
// Not supported by iconv, not sure why.
|
||||
"10029": "maccenteuro",
|
||||
"maccenteuro": {
|
||||
"type": "_sbcs",
|
||||
"chars": "ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ"
|
||||
},
|
||||
|
||||
"808": "cp808",
|
||||
"ibm808": "cp808",
|
||||
"cp808": {
|
||||
"type": "_sbcs",
|
||||
"chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёЄєЇїЎў°∙·√№€■ "
|
||||
},
|
||||
|
||||
// Aliases of generated encodings.
|
||||
"ascii8bit": "ascii",
|
||||
"usascii": "ascii",
|
||||
"ansix34": "ascii",
|
||||
"ansix341968": "ascii",
|
||||
"ansix341986": "ascii",
|
||||
"csascii": "ascii",
|
||||
"cp367": "ascii",
|
||||
"ibm367": "ascii",
|
||||
"isoir6": "ascii",
|
||||
"iso646us": "ascii",
|
||||
"iso646irv": "ascii",
|
||||
"us": "ascii",
|
||||
|
||||
"latin1": "iso88591",
|
||||
"latin2": "iso88592",
|
||||
"latin3": "iso88593",
|
||||
"latin4": "iso88594",
|
||||
"latin5": "iso88599",
|
||||
"latin6": "iso885910",
|
||||
"latin7": "iso885913",
|
||||
"latin8": "iso885914",
|
||||
"latin9": "iso885915",
|
||||
"latin10": "iso885916",
|
||||
|
||||
"csisolatin1": "iso88591",
|
||||
"csisolatin2": "iso88592",
|
||||
"csisolatin3": "iso88593",
|
||||
"csisolatin4": "iso88594",
|
||||
"csisolatincyrillic": "iso88595",
|
||||
"csisolatinarabic": "iso88596",
|
||||
"csisolatingreek" : "iso88597",
|
||||
"csisolatinhebrew": "iso88598",
|
||||
"csisolatin5": "iso88599",
|
||||
"csisolatin6": "iso885910",
|
||||
|
||||
"l1": "iso88591",
|
||||
"l2": "iso88592",
|
||||
"l3": "iso88593",
|
||||
"l4": "iso88594",
|
||||
"l5": "iso88599",
|
||||
"l6": "iso885910",
|
||||
"l7": "iso885913",
|
||||
"l8": "iso885914",
|
||||
"l9": "iso885915",
|
||||
"l10": "iso885916",
|
||||
|
||||
"isoir14": "iso646jp",
|
||||
"isoir57": "iso646cn",
|
||||
"isoir100": "iso88591",
|
||||
"isoir101": "iso88592",
|
||||
"isoir109": "iso88593",
|
||||
"isoir110": "iso88594",
|
||||
"isoir144": "iso88595",
|
||||
"isoir127": "iso88596",
|
||||
"isoir126": "iso88597",
|
||||
"isoir138": "iso88598",
|
||||
"isoir148": "iso88599",
|
||||
"isoir157": "iso885910",
|
||||
"isoir166": "tis620",
|
||||
"isoir179": "iso885913",
|
||||
"isoir199": "iso885914",
|
||||
"isoir203": "iso885915",
|
||||
"isoir226": "iso885916",
|
||||
|
||||
"cp819": "iso88591",
|
||||
"ibm819": "iso88591",
|
||||
|
||||
"cyrillic": "iso88595",
|
||||
|
||||
"arabic": "iso88596",
|
||||
"arabic8": "iso88596",
|
||||
"ecma114": "iso88596",
|
||||
"asmo708": "iso88596",
|
||||
|
||||
"greek" : "iso88597",
|
||||
"greek8" : "iso88597",
|
||||
"ecma118" : "iso88597",
|
||||
"elot928" : "iso88597",
|
||||
|
||||
"hebrew": "iso88598",
|
||||
"hebrew8": "iso88598",
|
||||
|
||||
"turkish": "iso88599",
|
||||
"turkish8": "iso88599",
|
||||
|
||||
"thai": "iso885911",
|
||||
"thai8": "iso885911",
|
||||
|
||||
"celtic": "iso885914",
|
||||
"celtic8": "iso885914",
|
||||
"isoceltic": "iso885914",
|
||||
|
||||
"tis6200": "tis620",
|
||||
"tis62025291": "tis620",
|
||||
"tis62025330": "tis620",
|
||||
|
||||
"10000": "macroman",
|
||||
"10006": "macgreek",
|
||||
"10007": "maccyrillic",
|
||||
"10079": "maciceland",
|
||||
"10081": "macturkish",
|
||||
|
||||
"cspc8codepage437": "cp437",
|
||||
"cspc775baltic": "cp775",
|
||||
"cspc850multilingual": "cp850",
|
||||
"cspcp852": "cp852",
|
||||
"cspc862latinhebrew": "cp862",
|
||||
"cpgr": "cp869",
|
||||
|
||||
"msee": "cp1250",
|
||||
"mscyrl": "cp1251",
|
||||
"msansi": "cp1252",
|
||||
"msgreek": "cp1253",
|
||||
"msturk": "cp1254",
|
||||
"mshebr": "cp1255",
|
||||
"msarab": "cp1256",
|
||||
"winbaltrim": "cp1257",
|
||||
|
||||
"cp20866": "koi8r",
|
||||
"20866": "koi8r",
|
||||
"ibm878": "koi8r",
|
||||
"cskoi8r": "koi8r",
|
||||
|
||||
"cp21866": "koi8u",
|
||||
"21866": "koi8u",
|
||||
"ibm1168": "koi8u",
|
||||
|
||||
"strk10482002": "rk1048",
|
||||
|
||||
"tcvn5712": "tcvn",
|
||||
"tcvn57121": "tcvn",
|
||||
|
||||
"gb198880": "iso646cn",
|
||||
"cn": "iso646cn",
|
||||
|
||||
"csiso14jisc6220ro": "iso646jp",
|
||||
"jisc62201969ro": "iso646jp",
|
||||
"jp": "iso646jp",
|
||||
|
||||
"cshproman8": "hproman8",
|
||||
"r8": "hproman8",
|
||||
"roman8": "hproman8",
|
||||
"xroman8": "hproman8",
|
||||
"ibm1051": "hproman8",
|
||||
|
||||
"mac": "macintosh",
|
||||
"csmacintosh": "macintosh",
|
||||
};
|
||||
|
||||
122
node_modules/express/node_modules/iconv-lite/encodings/tables/big5-added.json
generated
vendored
Normal file
122
node_modules/express/node_modules/iconv-lite/encodings/tables/big5-added.json
generated
vendored
Normal file
@ -0,0 +1,122 @@
|
||||
[
|
||||
["8740","䏰䰲䘃䖦䕸𧉧䵷䖳𧲱䳢𧳅㮕䜶䝄䱇䱀𤊿𣘗𧍒𦺋𧃒䱗𪍑䝏䗚䲅𧱬䴇䪤䚡𦬣爥𥩔𡩣𣸆𣽡晍囻"],
|
||||
["8767","綕夝𨮹㷴霴𧯯寛𡵞媤㘥𩺰嫑宷峼杮薓𩥅瑡璝㡵𡵓𣚞𦀡㻬"],
|
||||
["87a1","𥣞㫵竼龗𤅡𨤍𣇪𠪊𣉞䌊蒄龖鐯䤰蘓墖靊鈘秐稲晠権袝瑌篅枂稬剏遆㓦珄𥶹瓆鿇垳䤯呌䄱𣚎堘穲𧭥讏䚮𦺈䆁𥶙箮𢒼鿈𢓁𢓉𢓌鿉蔄𣖻䂴鿊䓡𪷿拁灮鿋"],
|
||||
["8840","㇀",4,"𠄌㇅𠃑𠃍㇆㇇𠃋𡿨㇈𠃊㇉㇊㇋㇌𠄎㇍㇎ĀÁǍÀĒÉĚÈŌÓǑÒÊ̄ẾÊ̌ỀÊāáǎàɑēéěèīíǐìōóǒòūúǔùǖǘǚ"],
|
||||
["88a1","ǜüê̄ếê̌ềêɡ⏚⏛"],
|
||||
["8940","𪎩𡅅"],
|
||||
["8943","攊"],
|
||||
["8946","丽滝鵎釟"],
|
||||
["894c","𧜵撑会伨侨兖兴农凤务动医华发变团声处备夲头学实実岚庆总斉柾栄桥济炼电纤纬纺织经统缆缷艺苏药视设询车轧轮"],
|
||||
["89a1","琑糼緍楆竉刧"],
|
||||
["89ab","醌碸酞肼"],
|
||||
["89b0","贋胶𠧧"],
|
||||
["89b5","肟黇䳍鷉鸌䰾𩷶𧀎鸊𪄳㗁"],
|
||||
["89c1","溚舾甙"],
|
||||
["89c5","䤑马骏龙禇𨑬𡷊𠗐𢫦两亁亀亇亿仫伷㑌侽㹈倃傈㑽㒓㒥円夅凛凼刅争剹劐匧㗇厩㕑厰㕓参吣㕭㕲㚁咓咣咴咹哐哯唘唣唨㖘唿㖥㖿嗗㗅"],
|
||||
["8a40","𧶄唥"],
|
||||
["8a43","𠱂𠴕𥄫喐𢳆㧬𠍁蹆𤶸𩓥䁓𨂾睺𢰸㨴䟕𨅝𦧲𤷪擝𠵼𠾴𠳕𡃴撍蹾𠺖𠰋𠽤𢲩𨉖𤓓"],
|
||||
["8a64","𠵆𩩍𨃩䟴𤺧𢳂骲㩧𩗴㿭㔆𥋇𩟔𧣈𢵄鵮頕"],
|
||||
["8a76","䏙𦂥撴哣𢵌𢯊𡁷㧻𡁯"],
|
||||
["8aa1","𦛚𦜖𧦠擪𥁒𠱃蹨𢆡𨭌𠜱"],
|
||||
["8aac","䠋𠆩㿺塳𢶍"],
|
||||
["8ab2","𤗈𠓼𦂗𠽌𠶖啹䂻䎺"],
|
||||
["8abb","䪴𢩦𡂝膪飵𠶜捹㧾𢝵跀嚡摼㹃"],
|
||||
["8ac9","𪘁𠸉𢫏𢳉"],
|
||||
["8ace","𡃈𣧂㦒㨆𨊛㕸𥹉𢃇噒𠼱𢲲𩜠㒼氽𤸻"],
|
||||
["8adf","𧕴𢺋𢈈𪙛𨳍𠹺𠰴𦠜羓𡃏𢠃𢤹㗻𥇣𠺌𠾍𠺪㾓𠼰𠵇𡅏𠹌"],
|
||||
["8af6","𠺫𠮩𠵈𡃀𡄽㿹𢚖搲𠾭"],
|
||||
["8b40","𣏴𧘹𢯎𠵾𠵿𢱑𢱕㨘𠺘𡃇𠼮𪘲𦭐𨳒𨶙𨳊閪哌苄喹"],
|
||||
["8b55","𩻃鰦骶𧝞𢷮煀腭胬尜𦕲脴㞗卟𨂽醶𠻺𠸏𠹷𠻻㗝𤷫㘉𠳖嚯𢞵𡃉𠸐𠹸𡁸𡅈𨈇𡑕𠹹𤹐𢶤婔𡀝𡀞𡃵𡃶垜𠸑"],
|
||||
["8ba1","𧚔𨋍𠾵𠹻𥅾㜃𠾶𡆀𥋘𪊽𤧚𡠺𤅷𨉼墙剨㘚𥜽箲孨䠀䬬鼧䧧鰟鮍𥭴𣄽嗻㗲嚉丨夂𡯁屮靑𠂆乛亻㔾尣彑忄㣺扌攵歺氵氺灬爫丬犭𤣩罒礻糹罓𦉪㓁"],
|
||||
["8bde","𦍋耂肀𦘒𦥑卝衤见𧢲讠贝钅镸长门𨸏韦页风飞饣𩠐鱼鸟黄歯龜丷𠂇阝户钢"],
|
||||
["8c40","倻淾𩱳龦㷉袏𤅎灷峵䬠𥇍㕙𥴰愢𨨲辧釶熑朙玺𣊁𪄇㲋𡦀䬐磤琂冮𨜏䀉橣𪊺䈣蘏𠩯稪𩥇𨫪靕灍匤𢁾鏴盙𨧣龧矝亣俰傼丯众龨吴綋墒壐𡶶庒庙忂𢜒斋"],
|
||||
["8ca1","𣏹椙橃𣱣泿"],
|
||||
["8ca7","爀𤔅玌㻛𤨓嬕璹讃𥲤𥚕窓篬糃繬苸薗龩袐龪躹龫迏蕟駠鈡龬𨶹𡐿䁱䊢娚"],
|
||||
["8cc9","顨杫䉶圽"],
|
||||
["8cce","藖𤥻芿𧄍䲁𦵴嵻𦬕𦾾龭龮宖龯曧繛湗秊㶈䓃𣉖𢞖䎚䔶"],
|
||||
["8ce6","峕𣬚諹屸㴒𣕑嵸龲煗䕘𤃬𡸣䱷㥸㑊𠆤𦱁諌侴𠈹妿腬顖𩣺弻"],
|
||||
["8d40","𠮟"],
|
||||
["8d42","𢇁𨥭䄂䚻𩁹㼇龳𪆵䃸㟖䛷𦱆䅼𨚲𧏿䕭㣔𥒚䕡䔛䶉䱻䵶䗪㿈𤬏㙡䓞䒽䇭崾嵈嵖㷼㠏嶤嶹㠠㠸幂庽弥徃㤈㤔㤿㥍惗愽峥㦉憷憹懏㦸戬抐拥挘㧸嚱"],
|
||||
["8da1","㨃揢揻搇摚㩋擀崕嘡龟㪗斆㪽旿晓㫲暒㬢朖㭂枤栀㭘桊梄㭲㭱㭻椉楃牜楤榟榅㮼槖㯝橥橴橱檂㯬檙㯲檫檵櫔櫶殁毁毪汵沪㳋洂洆洦涁㳯涤涱渕渘温溆𨧀溻滢滚齿滨滩漤漴㵆𣽁澁澾㵪㵵熷岙㶊瀬㶑灐灔灯灿炉𠌥䏁㗱𠻘"],
|
||||
["8e40","𣻗垾𦻓焾𥟠㙎榢𨯩孴穉𥣡𩓙穥穽𥦬窻窰竂竃燑𦒍䇊竚竝竪䇯咲𥰁笋筕笩𥌎𥳾箢筯莜𥮴𦱿篐萡箒箸𥴠㶭𥱥蒒篺簆簵𥳁籄粃𤢂粦晽𤕸糉糇糦籴糳糵糎"],
|
||||
["8ea1","繧䔝𦹄絝𦻖璍綉綫焵綳緒𤁗𦀩緤㴓緵𡟹緥𨍭縝𦄡𦅚繮纒䌫鑬縧罀罁罇礶𦋐駡羗𦍑羣𡙡𠁨䕜𣝦䔃𨌺翺𦒉者耈耝耨耯𪂇𦳃耻耼聡𢜔䦉𦘦𣷣𦛨朥肧𨩈脇脚墰𢛶汿𦒘𤾸擧𡒊舘𡡞橓𤩥𤪕䑺舩𠬍𦩒𣵾俹𡓽蓢荢𦬊𤦧𣔰𡝳𣷸芪椛芳䇛"],
|
||||
["8f40","蕋苐茚𠸖𡞴㛁𣅽𣕚艻苢茘𣺋𦶣𦬅𦮗𣗎㶿茝嗬莅䔋𦶥莬菁菓㑾𦻔橗蕚㒖𦹂𢻯葘𥯤葱㷓䓤檧葊𣲵祘蒨𦮖𦹷𦹃蓞萏莑䒠蒓蓤𥲑䉀𥳀䕃蔴嫲𦺙䔧蕳䔖枿蘖"],
|
||||
["8fa1","𨘥𨘻藁𧂈蘂𡖂𧃍䕫䕪蘨㙈𡢢号𧎚虾蝱𪃸蟮𢰧螱蟚蠏噡虬桖䘏衅衆𧗠𣶹𧗤衞袜䙛袴袵揁装睷𧜏覇覊覦覩覧覼𨨥觧𧤤𧪽誜瞓釾誐𧩙竩𧬺𣾏䜓𧬸煼謌謟𥐰𥕥謿譌譍誩𤩺讐讛誯𡛟䘕衏貛𧵔𧶏貫㜥𧵓賖𧶘𧶽贒贃𡤐賛灜贑𤳉㻐起"],
|
||||
["9040","趩𨀂𡀔𤦊㭼𨆼𧄌竧躭躶軃鋔輙輭𨍥𨐒辥錃𪊟𠩐辳䤪𨧞𨔽𣶻廸𣉢迹𪀔𨚼𨔁𢌥㦀𦻗逷𨔼𧪾遡𨕬𨘋邨𨜓郄𨛦邮都酧㫰醩釄粬𨤳𡺉鈎沟鉁鉢𥖹銹𨫆𣲛𨬌𥗛"],
|
||||
["90a1","𠴱錬鍫𨫡𨯫炏嫃𨫢𨫥䥥鉄𨯬𨰹𨯿鍳鑛躼閅閦鐦閠濶䊹𢙺𨛘𡉼𣸮䧟氜陻隖䅬隣𦻕懚隶磵𨫠隽双䦡𦲸𠉴𦐐𩂯𩃥𤫑𡤕𣌊霱虂霶䨏䔽䖅𤫩灵孁霛靜𩇕靗孊𩇫靟鐥僐𣂷𣂼鞉鞟鞱鞾韀韒韠𥑬韮琜𩐳響韵𩐝𧥺䫑頴頳顋顦㬎𧅵㵑𠘰𤅜"],
|
||||
["9140","𥜆飊颷飈飇䫿𦴧𡛓喰飡飦飬鍸餹𤨩䭲𩡗𩤅駵騌騻騐驘𥜥㛄𩂱𩯕髠髢𩬅髴䰎鬔鬭𨘀倴鬴𦦨㣃𣁽魐魀𩴾婅𡡣鮎𤉋鰂鯿鰌𩹨鷔𩾷𪆒𪆫𪃡𪄣𪇟鵾鶃𪄴鸎梈"],
|
||||
["91a1","鷄𢅛𪆓𪈠𡤻𪈳鴹𪂹𪊴麐麕麞麢䴴麪麯𤍤黁㭠㧥㴝伲㞾𨰫鼂鼈䮖鐤𦶢鼗鼖鼹嚟嚊齅馸𩂋韲葿齢齩竜龎爖䮾𤥵𤦻煷𤧸𤍈𤩑玞𨯚𡣺禟𨥾𨸶鍩鏳𨩄鋬鎁鏋𨥬𤒹爗㻫睲穃烐𤑳𤏸煾𡟯炣𡢾𣖙㻇𡢅𥐯𡟸㜢𡛻𡠹㛡𡝴𡣑𥽋㜣𡛀坛𤨥𡏾𡊨"],
|
||||
["9240","𡏆𡒶蔃𣚦蔃葕𤦔𧅥𣸱𥕜𣻻𧁒䓴𣛮𩦝𦼦柹㜳㰕㷧塬𡤢栐䁗𣜿𤃡𤂋𤄏𦰡哋嚞𦚱嚒𠿟𠮨𠸍鏆𨬓鎜仸儫㠙𤐶亼𠑥𠍿佋侊𥙑婨𠆫𠏋㦙𠌊𠐔㐵伩𠋀𨺳𠉵諚𠈌亘"],
|
||||
["92a1","働儍侢伃𤨎𣺊佂倮偬傁俌俥偘僼兙兛兝兞湶𣖕𣸹𣺿浲𡢄𣺉冨凃𠗠䓝𠒣𠒒𠒑赺𨪜𠜎剙劤𠡳勡鍮䙺熌𤎌𠰠𤦬𡃤槑𠸝瑹㻞璙琔瑖玘䮎𤪼𤂍叐㖄爏𤃉喴𠍅响𠯆圝鉝雴鍦埝垍坿㘾壋媙𨩆𡛺𡝯𡜐娬妸銏婾嫏娒𥥆𡧳𡡡𤊕㛵洅瑃娡𥺃"],
|
||||
["9340","媁𨯗𠐓鏠璌𡌃焅䥲鐈𨧻鎽㞠尞岞幞幈𡦖𡥼𣫮廍孏𡤃𡤄㜁𡢠㛝𡛾㛓脪𨩇𡶺𣑲𨦨弌弎𡤧𡞫婫𡜻孄蘔𧗽衠恾𢡠𢘫忛㺸𢖯𢖾𩂈𦽳懀𠀾𠁆𢘛憙憘恵𢲛𢴇𤛔𩅍"],
|
||||
["93a1","摱𤙥𢭪㨩𢬢𣑐𩣪𢹸挷𪑛撶挱揑𤧣𢵧护𢲡搻敫楲㯴𣂎𣊭𤦉𣊫唍𣋠𡣙𩐿曎𣊉𣆳㫠䆐𥖄𨬢𥖏𡛼𥕛𥐥磮𣄃𡠪𣈴㑤𣈏𣆂𤋉暎𦴤晫䮓昰𧡰𡷫晣𣋒𣋡昞𥡲㣑𣠺𣞼㮙𣞢𣏾瓐㮖枏𤘪梶栞㯄檾㡣𣟕𤒇樳橒櫉欅𡤒攑梘橌㯗橺歗𣿀𣲚鎠鋲𨯪𨫋"],
|
||||
["9440","銉𨀞𨧜鑧涥漋𤧬浧𣽿㶏渄𤀼娽渊塇洤硂焻𤌚𤉶烱牐犇犔𤞏𤜥兹𤪤𠗫瑺𣻸𣙟𤩊𤤗𥿡㼆㺱𤫟𨰣𣼵悧㻳瓌琼鎇琷䒟𦷪䕑疃㽣𤳙𤴆㽘畕癳𪗆㬙瑨𨫌𤦫𤦎㫻"],
|
||||
["94a1","㷍𤩎㻿𤧅𤣳釺圲鍂𨫣𡡤僟𥈡𥇧睸𣈲眎眏睻𤚗𣞁㩞𤣰琸璛㺿𤪺𤫇䃈𤪖𦆮錇𥖁砞碍碈磒珐祙𧝁𥛣䄎禛蒖禥樭𣻺稺秴䅮𡛦䄲鈵秱𠵌𤦌𠊙𣶺𡝮㖗啫㕰㚪𠇔𠰍竢婙𢛵𥪯𥪜娍𠉛磰娪𥯆竾䇹籝籭䈑𥮳𥺼𥺦糍𤧹𡞰粎籼粮檲緜縇緓罎𦉡"],
|
||||
["9540","𦅜𧭈綗𥺂䉪𦭵𠤖柖𠁎𣗏埄𦐒𦏸𤥢翝笧𠠬𥫩𥵃笌𥸎駦虅驣樜𣐿㧢𤧷𦖭騟𦖠蒀𧄧𦳑䓪脷䐂胆脉腂𦞴飃𦩂艢艥𦩑葓𦶧蘐𧈛媆䅿𡡀嬫𡢡嫤𡣘蚠蜨𣶏蠭𧐢娂"],
|
||||
["95a1","衮佅袇袿裦襥襍𥚃襔𧞅𧞄𨯵𨯙𨮜𨧹㺭蒣䛵䛏㟲訽訜𩑈彍鈫𤊄旔焩烄𡡅鵭貟賩𧷜妚矃姰䍮㛔踪躧𤰉輰轊䋴汘澻𢌡䢛潹溋𡟚鯩㚵𤤯邻邗啱䤆醻鐄𨩋䁢𨫼鐧𨰝𨰻蓥訫閙閧閗閖𨴴瑅㻂𤣿𤩂𤏪㻧𣈥随𨻧𨹦𨹥㻌𤧭𤩸𣿮琒瑫㻼靁𩂰"],
|
||||
["9640","桇䨝𩂓𥟟靝鍨𨦉𨰦𨬯𦎾銺嬑譩䤼珹𤈛鞛靱餸𠼦巁𨯅𤪲頟𩓚鋶𩗗釥䓀𨭐𤩧𨭤飜𨩅㼀鈪䤥萔餻饍𧬆㷽馛䭯馪驜𨭥𥣈檏騡嫾騯𩣱䮐𩥈馼䮽䮗鍽塲𡌂堢𤦸"],
|
||||
["96a1","𡓨硄𢜟𣶸棅㵽鑘㤧慐𢞁𢥫愇鱏鱓鱻鰵鰐魿鯏𩸭鮟𪇵𪃾鴡䲮𤄄鸘䲰鴌𪆴𪃭𪃳𩤯鶥蒽𦸒𦿟𦮂藼䔳𦶤𦺄𦷰萠藮𦸀𣟗𦁤秢𣖜𣙀䤭𤧞㵢鏛銾鍈𠊿碹鉷鑍俤㑀遤𥕝砽硔碶硋𡝗𣇉𤥁㚚佲濚濙瀞瀞吔𤆵垻壳垊鴖埗焴㒯𤆬燫𦱀𤾗嬨𡞵𨩉"],
|
||||
["9740","愌嫎娋䊼𤒈㜬䭻𨧼鎻鎸𡣖𠼝葲𦳀𡐓𤋺𢰦𤏁妔𣶷𦝁綨𦅛𦂤𤦹𤦋𨧺鋥珢㻩璴𨭣𡢟㻡𤪳櫘珳珻㻖𤨾𤪔𡟙𤩦𠎧𡐤𤧥瑈𤤖炥𤥶銄珦鍟𠓾錱𨫎𨨖鎆𨯧𥗕䤵𨪂煫"],
|
||||
["97a1","𤥃𠳿嚤𠘚𠯫𠲸唂秄𡟺緾𡛂𤩐𡡒䔮鐁㜊𨫀𤦭妰𡢿𡢃𧒄媡㛢𣵛㚰鉟婹𨪁𡡢鍴㳍𠪴䪖㦊僴㵩㵌𡎜煵䋻𨈘渏𩃤䓫浗𧹏灧沯㳖𣿭𣸭渂漌㵯𠏵畑㚼㓈䚀㻚䡱姄鉮䤾轁𨰜𦯀堒埈㛖𡑒烾𤍢𤩱𢿣𡊰𢎽梹楧𡎘𣓥𧯴𣛟𨪃𣟖𣏺𤲟樚𣚭𦲷萾䓟䓎"],
|
||||
["9840","𦴦𦵑𦲂𦿞漗𧄉茽𡜺菭𦲀𧁓𡟛妉媂𡞳婡婱𡤅𤇼㜭姯𡜼㛇熎鎐暚𤊥婮娫𤊓樫𣻹𧜶𤑛𤋊焝𤉙𨧡侰𦴨峂𤓎𧹍𤎽樌𤉖𡌄炦焳𤏩㶥泟勇𤩏繥姫崯㷳彜𤩝𡟟綤萦"],
|
||||
["98a1","咅𣫺𣌀𠈔坾𠣕𠘙㿥𡾞𪊶瀃𩅛嵰玏糓𨩙𩐠俈翧狍猐𧫴猸猹𥛶獁獈㺩𧬘遬燵𤣲珡臶㻊県㻑沢国琙琞琟㻢㻰㻴㻺瓓㼎㽓畂畭畲疍㽼痈痜㿀癍㿗癴㿜発𤽜熈嘣覀塩䀝睃䀹条䁅㗛瞘䁪䁯属瞾矋売砘点砜䂨砹硇硑硦葈𥔵礳栃礲䄃"],
|
||||
["9940","䄉禑禙辻稆込䅧窑䆲窼艹䇄竏竛䇏両筢筬筻簒簛䉠䉺类粜䊌粸䊔糭输烀𠳏総緔緐緽羮羴犟䎗耠耥笹耮耱联㷌垴炠肷胩䏭脌猪脎脒畠脔䐁㬹腖腙腚"],
|
||||
["99a1","䐓堺腼膄䐥膓䐭膥埯臁臤艔䒏芦艶苊苘苿䒰荗险榊萅烵葤惣蒈䔄蒾蓡蓸蔐蔸蕒䔻蕯蕰藠䕷虲蚒蚲蛯际螋䘆䘗袮裿褤襇覑𧥧訩訸誔誴豑賔賲贜䞘塟跃䟭仮踺嗘坔蹱嗵躰䠷軎転軤軭軲辷迁迊迌逳駄䢭飠鈓䤞鈨鉘鉫銱銮銿"],
|
||||
["9a40","鋣鋫鋳鋴鋽鍃鎄鎭䥅䥑麿鐗匁鐝鐭鐾䥪鑔鑹锭関䦧间阳䧥枠䨤靀䨵鞲韂噔䫤惨颹䬙飱塄餎餙冴餜餷饂饝饢䭰駅䮝騼鬏窃魩鮁鯝鯱鯴䱭鰠㝯𡯂鵉鰺"],
|
||||
["9aa1","黾噐鶓鶽鷀鷼银辶鹻麬麱麽黆铜黢黱黸竈齄𠂔𠊷𠎠椚铃妬𠓗塀铁㞹𠗕𠘕𠙶𡚺块煳𠫂𠫍𠮿呪吆𠯋咞𠯻𠰻𠱓𠱥𠱼惧𠲍噺𠲵𠳝𠳭𠵯𠶲𠷈楕鰯螥𠸄𠸎𠻗𠾐𠼭𠹳尠𠾼帋𡁜𡁏𡁶朞𡁻𡂈𡂖㙇𡂿𡃓𡄯𡄻卤蒭𡋣𡍵𡌶讁𡕷𡘙𡟃𡟇乸炻𡠭𡥪"],
|
||||
["9b40","𡨭𡩅𡰪𡱰𡲬𡻈拃𡻕𡼕熘桕𢁅槩㛈𢉼𢏗𢏺𢜪𢡱𢥏苽𢥧𢦓𢫕覥𢫨辠𢬎鞸𢬿顇骽𢱌"],
|
||||
["9b62","𢲈𢲷𥯨𢴈𢴒𢶷𢶕𢹂𢽴𢿌𣀳𣁦𣌟𣏞徱晈暿𧩹𣕧𣗳爁𤦺矗𣘚𣜖纇𠍆墵朎"],
|
||||
["9ba1","椘𣪧𧙗𥿢𣸑𣺹𧗾𢂚䣐䪸𤄙𨪚𤋮𤌍𤀻𤌴𤎖𤩅𠗊凒𠘑妟𡺨㮾𣳿𤐄𤓖垈𤙴㦛𤜯𨗨𩧉㝢𢇃譞𨭎駖𤠒𤣻𤨕爉𤫀𠱸奥𤺥𤾆𠝹軚𥀬劏圿煱𥊙𥐙𣽊𤪧喼𥑆𥑮𦭒釔㑳𥔿𧘲𥕞䜘𥕢𥕦𥟇𤤿𥡝偦㓻𣏌惞𥤃䝼𨥈𥪮𥮉𥰆𡶐垡煑澶𦄂𧰒遖𦆲𤾚譢𦐂𦑊"],
|
||||
["9c40","嵛𦯷輶𦒄𡤜諪𤧶𦒈𣿯𦔒䯀𦖿𦚵𢜛鑥𥟡憕娧晉侻嚹𤔡𦛼乪𤤴陖涏𦲽㘘襷𦞙𦡮𦐑𦡞營𦣇筂𩃀𠨑𦤦鄄𦤹穅鷰𦧺騦𦨭㙟𦑩𠀡禃𦨴𦭛崬𣔙菏𦮝䛐𦲤画补𦶮墶"],
|
||||
["9ca1","㜜𢖍𧁋𧇍㱔𧊀𧊅銁𢅺𧊋錰𧋦𤧐氹钟𧑐𠻸蠧裵𢤦𨑳𡞱溸𤨪𡠠㦤㚹尐秣䔿暶𩲭𩢤襃𧟌𧡘囖䃟𡘊㦡𣜯𨃨𡏅熭荦𧧝𩆨婧䲷𧂯𨦫𧧽𧨊𧬋𧵦𤅺筃祾𨀉澵𪋟樃𨌘厢𦸇鎿栶靝𨅯𨀣𦦵𡏭𣈯𨁈嶅𨰰𨂃圕頣𨥉嶫𤦈斾槕叒𤪥𣾁㰑朶𨂐𨃴𨄮𡾡𨅏"],
|
||||
["9d40","𨆉𨆯𨈚𨌆𨌯𨎊㗊𨑨𨚪䣺揦𨥖砈鉕𨦸䏲𨧧䏟𨧨𨭆𨯔姸𨰉輋𨿅𩃬筑𩄐𩄼㷷𩅞𤫊运犏嚋𩓧𩗩𩖰𩖸𩜲𩣑𩥉𩥪𩧃𩨨𩬎𩵚𩶛纟𩻸𩼣䲤镇𪊓熢𪋿䶑递𪗋䶜𠲜达嗁"],
|
||||
["9da1","辺𢒰边𤪓䔉繿潖檱仪㓤𨬬𧢝㜺躀𡟵𨀤𨭬𨮙𧨾𦚯㷫𧙕𣲷𥘵𥥖亚𥺁𦉘嚿𠹭踎孭𣺈𤲞揞拐𡟶𡡻攰嘭𥱊吚𥌑㷆𩶘䱽嘢嘞罉𥻘奵𣵀蝰东𠿪𠵉𣚺脗鵞贘瘻鱅癎瞹鍅吲腈苷嘥脲萘肽嗪祢噃吖𠺝㗎嘅嗱曱𨋢㘭甴嗰喺咗啲𠱁𠲖廐𥅈𠹶𢱢"],
|
||||
["9e40","𠺢麫絚嗞𡁵抝靭咔賍燶酶揼掹揾啩𢭃鱲𢺳冚㓟𠶧冧呍唞唓癦踭𦢊疱肶蠄螆裇膶萜𡃁䓬猄𤜆宐茋𦢓噻𢛴𧴯𤆣𧵳𦻐𧊶酰𡇙鈈𣳼𪚩𠺬𠻹牦𡲢䝎𤿂𧿹𠿫䃺"],
|
||||
["9ea1","鱝攟𢶠䣳𤟠𩵼𠿬𠸊恢𧖣𠿭"],
|
||||
["9ead","𦁈𡆇熣纎鵐业丄㕷嬍沲卧㚬㧜卽㚥𤘘墚𤭮舭呋垪𥪕𠥹"],
|
||||
["9ec5","㩒𢑥獴𩺬䴉鯭𣳾𩼰䱛𤾩𩖞𩿞葜𣶶𧊲𦞳𣜠挮紥𣻷𣸬㨪逈勌㹴㙺䗩𠒎癀嫰𠺶硺𧼮墧䂿噼鮋嵴癔𪐴麅䳡痹㟻愙𣃚𤏲"],
|
||||
["9ef5","噝𡊩垧𤥣𩸆刴𧂮㖭汊鵼"],
|
||||
["9f40","籖鬹埞𡝬屓擓𩓐𦌵𧅤蚭𠴨𦴢𤫢𠵱"],
|
||||
["9f4f","凾𡼏嶎霃𡷑麁遌笟鬂峑箣扨挵髿篏鬪籾鬮籂粆鰕篼鬉鼗鰛𤤾齚啳寃俽麘俲剠㸆勑坧偖妷帒韈鶫轜呩鞴饀鞺匬愰"],
|
||||
["9fa1","椬叚鰊鴂䰻陁榀傦畆𡝭駚剳"],
|
||||
["9fae","酙隁酜"],
|
||||
["9fb2","酑𨺗捿𦴣櫊嘑醎畺抅𠏼獏籰𥰡𣳽"],
|
||||
["9fc1","𤤙盖鮝个𠳔莾衂"],
|
||||
["9fc9","届槀僭坺刟巵从氱𠇲伹咜哚劚趂㗾弌㗳"],
|
||||
["9fdb","歒酼龥鮗頮颴骺麨麄煺笔"],
|
||||
["9fe7","毺蠘罸"],
|
||||
["9feb","嘠𪙊蹷齓"],
|
||||
["9ff0","跔蹏鸜踁抂𨍽踨蹵竓𤩷稾磘泪詧瘇"],
|
||||
["a040","𨩚鼦泎蟖痃𪊲硓咢贌狢獱謭猂瓱賫𤪻蘯徺袠䒷"],
|
||||
["a055","𡠻𦸅"],
|
||||
["a058","詾𢔛"],
|
||||
["a05b","惽癧髗鵄鍮鮏蟵"],
|
||||
["a063","蠏賷猬霡鮰㗖犲䰇籑饊𦅙慙䰄麖慽"],
|
||||
["a073","坟慯抦戹拎㩜懢厪𣏵捤栂㗒"],
|
||||
["a0a1","嵗𨯂迚𨸹"],
|
||||
["a0a6","僙𡵆礆匲阸𠼻䁥"],
|
||||
["a0ae","矾"],
|
||||
["a0b0","糂𥼚糚稭聦聣絍甅瓲覔舚朌聢𧒆聛瓰脃眤覉𦟌畓𦻑螩蟎臈螌詉貭譃眫瓸蓚㘵榲趦"],
|
||||
["a0d4","覩瑨涹蟁𤀑瓧㷛煶悤憜㳑煢恷"],
|
||||
["a0e2","罱𨬭牐惩䭾删㰘𣳇𥻗𧙖𥔱𡥄𡋾𩤃𦷜𧂭峁𦆭𨨏𣙷𠃮𦡆𤼎䕢嬟𦍌齐麦𦉫"],
|
||||
["a3c0","␀",31,"␡"],
|
||||
["c6a1","①",9,"⑴",9,"ⅰ",9,"丶丿亅亠冂冖冫勹匸卩厶夊宀巛⼳广廴彐彡攴无疒癶辵隶¨ˆヽヾゝゞ〃仝々〆〇ー[]✽ぁ",23],
|
||||
["c740","す",58,"ァアィイ"],
|
||||
["c7a1","ゥ",81,"А",5,"ЁЖ",4],
|
||||
["c840","Л",26,"ёж",25,"⇧↸↹㇏𠃌乚𠂊刂䒑"],
|
||||
["c8a1","龰冈龱𧘇"],
|
||||
["c8cd","¬¦'"㈱№℡゛゜⺀⺄⺆⺇⺈⺊⺌⺍⺕⺜⺝⺥⺧⺪⺬⺮⺶⺼⺾⻆⻊⻌⻍⻏⻖⻗⻞⻣"],
|
||||
["c8f5","ʃɐɛɔɵœøŋʊɪ"],
|
||||
["f9fe","■"],
|
||||
["fa40","𠕇鋛𠗟𣿅蕌䊵珯况㙉𤥂𨧤鍄𡧛苮𣳈砼杄拟𤤳𨦪𠊠𦮳𡌅侫𢓭倈𦴩𧪄𣘀𤪱𢔓倩𠍾徤𠎀𠍇滛𠐟偽儁㑺儎顬㝃萖𤦤𠒇兠𣎴兪𠯿𢃼𠋥𢔰𠖎𣈳𡦃宂蝽𠖳𣲙冲冸"],
|
||||
["faa1","鴴凉减凑㳜凓𤪦决凢卂凭菍椾𣜭彻刋刦刼劵剗劔効勅簕蕂勠蘍𦬓包𨫞啉滙𣾀𠥔𣿬匳卄𠯢泋𡜦栛珕恊㺪㣌𡛨燝䒢卭却𨚫卾卿𡖖𡘓矦厓𨪛厠厫厮玧𥝲㽙玜叁叅汉义埾叙㪫𠮏叠𣿫𢶣叶𠱷吓灹唫晗浛呭𦭓𠵴啝咏咤䞦𡜍𠻝㶴𠵍"],
|
||||
["fb40","𨦼𢚘啇䳭启琗喆喩嘅𡣗𤀺䕒𤐵暳𡂴嘷曍𣊊暤暭噍噏磱囱鞇叾圀囯园𨭦㘣𡉏坆𤆥汮炋坂㚱𦱾埦𡐖堃𡑔𤍣堦𤯵塜墪㕡壠壜𡈼壻寿坃𪅐𤉸鏓㖡够梦㛃湙"],
|
||||
["fba1","𡘾娤啓𡚒蔅姉𠵎𦲁𦴪𡟜姙𡟻𡞲𦶦浱𡠨𡛕姹𦹅媫婣㛦𤦩婷㜈媖瑥嫓𦾡𢕔㶅𡤑㜲𡚸広勐孶斈孼𧨎䀄䡝𠈄寕慠𡨴𥧌𠖥寳宝䴐尅𡭄尓珎尔𡲥𦬨屉䣝岅峩峯嶋𡷹𡸷崐崘嵆𡺤岺巗苼㠭𤤁𢁉𢅳芇㠶㯂帮檊幵幺𤒼𠳓厦亷廐厨𡝱帉廴𨒂"],
|
||||
["fc40","廹廻㢠廼栾鐛弍𠇁弢㫞䢮𡌺强𦢈𢏐彘𢑱彣鞽𦹮彲鍀𨨶徧嶶㵟𥉐𡽪𧃸𢙨釖𠊞𨨩怱暅𡡷㥣㷇㘹垐𢞴祱㹀悞悤悳𤦂𤦏𧩓璤僡媠慤萤慂慈𦻒憁凴𠙖憇宪𣾷"],
|
||||
["fca1","𢡟懓𨮝𩥝懐㤲𢦀𢣁怣慜攞掋𠄘担𡝰拕𢸍捬𤧟㨗搸揸𡎎𡟼撐澊𢸶頔𤂌𥜝擡擥鑻㩦携㩗敍漖𤨨𤨣斅敭敟𣁾斵𤥀䬷旑䃘𡠩无旣忟𣐀昘𣇷𣇸晄𣆤𣆥晋𠹵晧𥇦晳晴𡸽𣈱𨗴𣇈𥌓矅𢣷馤朂𤎜𤨡㬫槺𣟂杞杧杢𤇍𩃭柗䓩栢湐鈼栁𣏦𦶠桝"],
|
||||
["fd40","𣑯槡樋𨫟楳棃𣗍椁椀㴲㨁𣘼㮀枬楡𨩊䋼椶榘㮡𠏉荣傐槹𣙙𢄪橅𣜃檝㯳枱櫈𩆜㰍欝𠤣惞欵歴𢟍溵𣫛𠎵𡥘㝀吡𣭚毡𣻼毜氷𢒋𤣱𦭑汚舦汹𣶼䓅𣶽𤆤𤤌𤤀"],
|
||||
["fda1","𣳉㛥㳫𠴲鮃𣇹𢒑羏样𦴥𦶡𦷫涖浜湼漄𤥿𤂅𦹲蔳𦽴凇沜渝萮𨬡港𣸯瑓𣾂秌湏媑𣁋濸㜍澝𣸰滺𡒗𤀽䕕鏰潄潜㵎潴𩅰㴻澟𤅄濓𤂑𤅕𤀹𣿰𣾴𤄿凟𤅖𤅗𤅀𦇝灋灾炧炁烌烕烖烟䄄㷨熴熖𤉷焫煅媈煊煮岜𤍥煏鍢𤋁焬𤑚𤨧𤨢熺𨯨炽爎"],
|
||||
["fe40","鑂爕夑鑃爤鍁𥘅爮牀𤥴梽牕牗㹕𣁄栍漽犂猪猫𤠣𨠫䣭𨠄猨献珏玪𠰺𦨮珉瑉𤇢𡛧𤨤昣㛅𤦷𤦍𤧻珷琕椃𤨦琹𠗃㻗瑜𢢭瑠𨺲瑇珤瑶莹瑬㜰瑴鏱樬璂䥓𤪌"],
|
||||
["fea1","𤅟𤩹𨮏孆𨰃𡢞瓈𡦈甎瓩甞𨻙𡩋寗𨺬鎅畍畊畧畮𤾂㼄𤴓疎瑝疞疴瘂瘬癑癏癯癶𦏵皐臯㟸𦤑𦤎皡皥皷盌𦾟葢𥂝𥅽𡸜眞眦着撯𥈠睘𣊬瞯𨥤𨥨𡛁矴砉𡍶𤨒棊碯磇磓隥礮𥗠磗礴碱𧘌辸袄𨬫𦂃𢘜禆褀椂禀𥡗禝𧬹礼禩渪𧄦㺨秆𩄍秔"]
|
||||
]
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user