feat: ✨ Created a mini nodeJS server with NewMan for testing without PostMan GUI.
This will mimic a run in a CD/CI environment or docker container.
This commit is contained in:
3
node_modules/charset/.eslintrc
generated
vendored
Normal file
3
node_modules/charset/.eslintrc
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": "eslint-config-egg"
|
||||
}
|
6
node_modules/charset/.npmignore
generated
vendored
Normal file
6
node_modules/charset/.npmignore
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
test/
|
||||
coverage.html
|
||||
lib-cov/
|
||||
Makefile
|
||||
.travis.yml
|
||||
logo.png
|
4
node_modules/charset/AUTHORS
generated
vendored
Normal file
4
node_modules/charset/AUTHORS
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
# Ordered by date of first contribution.
|
||||
|
||||
fengmk2 <fengmk2@gmail.com> (https://github.com/fengmk2)
|
||||
Oleg Slobodskoi <oleg008@gmail.com> (https://github.com/kof)
|
34
node_modules/charset/History.md
generated
vendored
Normal file
34
node_modules/charset/History.md
generated
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
|
||||
1.0.1 / 2017-09-07
|
||||
==================
|
||||
|
||||
**fixes**
|
||||
* [[`effda0c`](http://github.com/node-modules/charset/commit/effda0c48c51b47a47f4cad7db0c51ee7407cc1b)] - fix: limit match string (#11) (fengmk2 <<fengmk2@gmail.com>>)
|
||||
|
||||
**others**
|
||||
* [[`5ba8a49`](http://github.com/node-modules/charset/commit/5ba8a4942f069d40584cf5a1a7938ff8dc92bcc9)] - test: use npm scripts instead of Makefile (#9) (fengmk2 <<m@fengmk2.com>>)
|
||||
* [[`4787184`](http://github.com/node-modules/charset/commit/47871846e3e738c8cca18c5021e6784c0777ef8f)] - fix example with jschardet (Xu Jingxin <<sailxjx@gmail.com>>)
|
||||
* [[`c2f94ef`](http://github.com/node-modules/charset/commit/c2f94ef9cfbaef2e0ff546b4bffcccc1e0beac52)] - add combine example with jschardet. (fengmk2 <<fengmk2@gmail.com>>)
|
||||
|
||||
1.0.0 / 2014-09-17
|
||||
==================
|
||||
|
||||
* add peek size, default is 512. fixed #4
|
||||
|
||||
0.1.0 / 2014-07-05
|
||||
==================
|
||||
|
||||
* support `charset(content-type-string)`
|
||||
* update AUTHORS with new version of contributors
|
||||
|
||||
0.0.2 / 2014-01-19
|
||||
==================
|
||||
|
||||
* add contributors
|
||||
* #1 #2 read charset from encoding="utf8" for xml, handle spaces between = and inside of utf8 (@kof)
|
||||
|
||||
0.0.1 / 2012-10-08
|
||||
==================
|
||||
|
||||
* first commit for charset.
|
||||
* Initial commit
|
22
node_modules/charset/LICENSE.txt
generated
vendored
Normal file
22
node_modules/charset/LICENSE.txt
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
This software is licensed under the MIT License.
|
||||
|
||||
Copyright (C) 2012 - 2015 fengmk2 <fengmk2@gmail.com>
|
||||
Copyright (c) node-modules and other contributors
|
||||
|
||||
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.
|
85
node_modules/charset/README.md
generated
vendored
Normal file
85
node_modules/charset/README.md
generated
vendored
Normal file
@@ -0,0 +1,85 @@
|
||||
charset
|
||||
=======
|
||||
|
||||
[![NPM version][npm-image]][npm-url]
|
||||
[![build status][travis-image]][travis-url]
|
||||
[![Test coverage][codecov-image]][codecov-url]
|
||||
[![David deps][david-image]][david-url]
|
||||
[![npm download][download-image]][download-url]
|
||||
|
||||
[npm-image]: https://img.shields.io/npm/v/charset.svg?style=flat-square
|
||||
[npm-url]: https://npmjs.org/package/charset
|
||||
[travis-image]: https://img.shields.io/travis/node-modules/charset.svg?style=flat-square
|
||||
[travis-url]: https://travis-ci.org/node-modules/charset
|
||||
[codecov-image]: https://codecov.io/gh/node-modules/charset/branch/master/graph/badge.svg
|
||||
[codecov-url]: https://codecov.io/gh/node-modules/charset
|
||||
[david-image]: https://img.shields.io/david/node-modules/charset.svg?style=flat-square
|
||||
[david-url]: https://david-dm.org/node-modules/charset
|
||||
[download-image]: https://img.shields.io/npm/dm/charset.svg?style=flat-square
|
||||
[download-url]: https://npmjs.org/package/charset
|
||||
|
||||

|
||||
|
||||
Get the content charset from header and html content-type.
|
||||
|
||||
## Install
|
||||
|
||||
```bash
|
||||
$ npm install charset --save
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
### Detect charset from http client response and content
|
||||
|
||||
```js
|
||||
var charset = require('charset');
|
||||
var http = require('http');
|
||||
|
||||
http.get('http://nodejs.org', function (res) {
|
||||
res.on('data', function (chunk) {
|
||||
console.log(charset(res.headers, chunk));
|
||||
// or `console.log(charset(res, chunk));`
|
||||
res.destroy();
|
||||
});
|
||||
});
|
||||
```
|
||||
|
||||
Stdout will should log: `utf8` .
|
||||
|
||||
### Detect from String
|
||||
|
||||
```js
|
||||
charset(res.headers['content-type']);
|
||||
```
|
||||
|
||||
### Detect combine with [jschardet]
|
||||
|
||||
As you know, `charset` only detect from http response headers and html content-type meta tag.
|
||||
You can combine with [jschardet] to help you detect the finally charset.
|
||||
|
||||
This example codes come from [stackoverflow#12326688](http://stackoverflow.com/a/18712021/2496088):
|
||||
|
||||
```js
|
||||
var request = require('request');
|
||||
var charset = require('charset');
|
||||
var jschardet = require('jschardet');
|
||||
|
||||
request({
|
||||
url: 'http://www.example.com',
|
||||
encoding: null
|
||||
}, function (err, res, body) {
|
||||
if (err) {
|
||||
throw err;
|
||||
}
|
||||
enc = charset(res.headers, body);
|
||||
enc = enc || jschardet.detect(body).encoding.toLowerCase();
|
||||
console.log(enc);
|
||||
});
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
[MIT](LICENSE.txt)
|
||||
|
||||
[jschardet]: https://github.com/aadsm/jschardet
|
16
node_modules/charset/appveyor.yml
generated
vendored
Normal file
16
node_modules/charset/appveyor.yml
generated
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
environment:
|
||||
matrix:
|
||||
- nodejs_version: '4'
|
||||
- nodejs_version: '6'
|
||||
- nodejs_version: '8'
|
||||
|
||||
install:
|
||||
- ps: Install-Product node $env:nodejs_version
|
||||
- npm i npminstall && node_modules\.bin\npminstall
|
||||
|
||||
test_script:
|
||||
- node --version
|
||||
- npm --version
|
||||
- npm run test
|
||||
|
||||
build: off
|
1
node_modules/charset/coverage/coverage-49255.json
generated
vendored
Normal file
1
node_modules/charset/coverage/coverage-49255.json
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"/Users/mk2/git/github.com/node-modules/charset/index.js":{"path":"/Users/mk2/git/github.com/node-modules/charset/index.js","s":{"1":1,"2":1,"3":1,"4":18,"5":18,"6":18,"7":15,"8":15,"9":18,"10":18,"11":16,"12":16,"13":1,"14":16,"15":18,"16":9,"17":18,"18":9,"19":9,"20":18,"21":18,"22":15,"23":15,"24":8,"25":18},"b":{"1":[15,3],"2":[15,15],"3":[3,12],"4":[16,2],"5":[18,17],"6":[1,15],"7":[16,9],"8":[9,9],"9":[9,9],"10":[18,11],"11":[15,3],"12":[8,7]},"f":{"1":18},"fnMap":{"1":{"name":"charset","line":23,"loc":{"start":{"line":23,"column":0},"end":{"line":23,"column":38}}}},"statementMap":{"1":{"start":{"line":3,"column":0},"end":{"line":3,"column":67}},"2":{"start":{"line":5,"column":0},"end":{"line":5,"column":25}},"3":{"start":{"line":23,"column":0},"end":{"line":59,"column":1}},"4":{"start":{"line":24,"column":2},"end":{"line":24,"column":20}},"5":{"start":{"line":25,"column":2},"end":{"line":25,"column":14}},"6":{"start":{"line":26,"column":2},"end":{"line":30,"column":3}},"7":{"start":{"line":27,"column":4},"end":{"line":27,"column":31}},"8":{"start":{"line":29,"column":4},"end":{"line":29,"column":58}},"9":{"start":{"line":32,"column":2},"end":{"line":32,"column":24}},"10":{"start":{"line":33,"column":2},"end":{"line":41,"column":3}},"11":{"start":{"line":35,"column":4},"end":{"line":35,"column":22}},"12":{"start":{"line":36,"column":4},"end":{"line":39,"column":5}},"13":{"start":{"line":38,"column":6},"end":{"line":38,"column":28}},"14":{"start":{"line":40,"column":4},"end":{"line":40,"column":69}},"15":{"start":{"line":42,"column":2},"end":{"line":45,"column":3}},"16":{"start":{"line":44,"column":4},"end":{"line":44,"column":43}},"17":{"start":{"line":46,"column":2},"end":{"line":50,"column":3}},"18":{"start":{"line":48,"column":4},"end":{"line":48,"column":48}},"19":{"start":{"line":49,"column":4},"end":{"line":49,"column":43}},"20":{"start":{"line":51,"column":2},"end":{"line":51,"column":16}},"21":{"start":{"line":52,"column":2},"end":{"line":57,"column":3}},"22":{"start":{"line":53,"column":4},"end":{"line":53,"column":33}},"23":{"start":{"line":54,"column":4},"end":{"line":56,"column":5}},"24":{"start":{"line":55,"column":6},"end":{"line":55,"column":18}},"25":{"start":{"line":58,"column":2},"end":{"line":58,"column":12}}},"branchMap":{"1":{"line":26,"type":"if","locations":[{"start":{"line":26,"column":2},"end":{"line":26,"column":2}},{"start":{"line":26,"column":2},"end":{"line":26,"column":2}}]},"2":{"line":27,"type":"binary-expr","locations":[{"start":{"line":27,"column":15},"end":{"line":27,"column":23}},{"start":{"line":27,"column":27},"end":{"line":27,"column":30}}]},"3":{"line":29,"type":"cond-expr","locations":[{"start":{"line":29,"column":35},"end":{"line":29,"column":43}},{"start":{"line":29,"column":46},"end":{"line":29,"column":57}}]},"4":{"line":33,"type":"if","locations":[{"start":{"line":33,"column":2},"end":{"line":33,"column":2}},{"start":{"line":33,"column":2},"end":{"line":33,"column":2}}]},"5":{"line":33,"type":"binary-expr","locations":[{"start":{"line":33,"column":6},"end":{"line":33,"column":17}},{"start":{"line":33,"column":21},"end":{"line":33,"column":52}}]},"6":{"line":36,"type":"if","locations":[{"start":{"line":36,"column":4},"end":{"line":36,"column":4}},{"start":{"line":36,"column":4},"end":{"line":36,"column":4}}]},"7":{"line":40,"type":"binary-expr","locations":[{"start":{"line":40,"column":18},"end":{"line":40,"column":41}},{"start":{"line":40,"column":45},"end":{"line":40,"column":68}}]},"8":{"line":42,"type":"if","locations":[{"start":{"line":42,"column":2},"end":{"line":42,"column":2}},{"start":{"line":42,"column":2},"end":{"line":42,"column":2}}]},"9":{"line":46,"type":"if","locations":[{"start":{"line":46,"column":2},"end":{"line":46,"column":2}},{"start":{"line":46,"column":2},"end":{"line":46,"column":2}}]},"10":{"line":46,"type":"binary-expr","locations":[{"start":{"line":46,"column":6},"end":{"line":46,"column":13}},{"start":{"line":46,"column":17},"end":{"line":46,"column":24}}]},"11":{"line":52,"type":"if","locations":[{"start":{"line":52,"column":2},"end":{"line":52,"column":2}},{"start":{"line":52,"column":2},"end":{"line":52,"column":2}}]},"12":{"line":54,"type":"if","locations":[{"start":{"line":54,"column":4},"end":{"line":54,"column":4}},{"start":{"line":54,"column":4},"end":{"line":54,"column":4}}]}}}}
|
2
node_modules/charset/coverage/coverage-final.json
generated
vendored
Normal file
2
node_modules/charset/coverage/coverage-final.json
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
{
|
||||
"/Users/mk2/git/github.com/node-modules/charset/index.js":{"path":"/Users/mk2/git/github.com/node-modules/charset/index.js","s":{"1":1,"2":1,"3":1,"4":18,"5":18,"6":18,"7":15,"8":15,"9":18,"10":18,"11":16,"12":16,"13":1,"14":16,"15":18,"16":9,"17":18,"18":9,"19":9,"20":18,"21":18,"22":15,"23":15,"24":8,"25":18},"b":{"1":[15,3],"2":[15,15],"3":[3,12],"4":[16,2],"5":[18,17],"6":[1,15],"7":[16,9],"8":[9,9],"9":[9,9],"10":[18,11],"11":[15,3],"12":[8,7]},"f":{"1":18},"fnMap":{"1":{"name":"charset","line":23,"loc":{"start":{"line":23,"column":0},"end":{"line":23,"column":38}}}},"statementMap":{"1":{"start":{"line":3,"column":0},"end":{"line":3,"column":67}},"2":{"start":{"line":5,"column":0},"end":{"line":5,"column":25}},"3":{"start":{"line":23,"column":0},"end":{"line":59,"column":1}},"4":{"start":{"line":24,"column":2},"end":{"line":24,"column":20}},"5":{"start":{"line":25,"column":2},"end":{"line":25,"column":14}},"6":{"start":{"line":26,"column":2},"end":{"line":30,"column":3}},"7":{"start":{"line":27,"column":4},"end":{"line":27,"column":31}},"8":{"start":{"line":29,"column":4},"end":{"line":29,"column":58}},"9":{"start":{"line":32,"column":2},"end":{"line":32,"column":24}},"10":{"start":{"line":33,"column":2},"end":{"line":41,"column":3}},"11":{"start":{"line":35,"column":4},"end":{"line":35,"column":22}},"12":{"start":{"line":36,"column":4},"end":{"line":39,"column":5}},"13":{"start":{"line":38,"column":6},"end":{"line":38,"column":28}},"14":{"start":{"line":40,"column":4},"end":{"line":40,"column":69}},"15":{"start":{"line":42,"column":2},"end":{"line":45,"column":3}},"16":{"start":{"line":44,"column":4},"end":{"line":44,"column":43}},"17":{"start":{"line":46,"column":2},"end":{"line":50,"column":3}},"18":{"start":{"line":48,"column":4},"end":{"line":48,"column":48}},"19":{"start":{"line":49,"column":4},"end":{"line":49,"column":43}},"20":{"start":{"line":51,"column":2},"end":{"line":51,"column":16}},"21":{"start":{"line":52,"column":2},"end":{"line":57,"column":3}},"22":{"start":{"line":53,"column":4},"end":{"line":53,"column":33}},"23":{"start":{"line":54,"column":4},"end":{"line":56,"column":5}},"24":{"start":{"line":55,"column":6},"end":{"line":55,"column":18}},"25":{"start":{"line":58,"column":2},"end":{"line":58,"column":12}}},"branchMap":{"1":{"line":26,"type":"if","locations":[{"start":{"line":26,"column":2},"end":{"line":26,"column":2}},{"start":{"line":26,"column":2},"end":{"line":26,"column":2}}]},"2":{"line":27,"type":"binary-expr","locations":[{"start":{"line":27,"column":15},"end":{"line":27,"column":23}},{"start":{"line":27,"column":27},"end":{"line":27,"column":30}}]},"3":{"line":29,"type":"cond-expr","locations":[{"start":{"line":29,"column":35},"end":{"line":29,"column":43}},{"start":{"line":29,"column":46},"end":{"line":29,"column":57}}]},"4":{"line":33,"type":"if","locations":[{"start":{"line":33,"column":2},"end":{"line":33,"column":2}},{"start":{"line":33,"column":2},"end":{"line":33,"column":2}}]},"5":{"line":33,"type":"binary-expr","locations":[{"start":{"line":33,"column":6},"end":{"line":33,"column":17}},{"start":{"line":33,"column":21},"end":{"line":33,"column":52}}]},"6":{"line":36,"type":"if","locations":[{"start":{"line":36,"column":4},"end":{"line":36,"column":4}},{"start":{"line":36,"column":4},"end":{"line":36,"column":4}}]},"7":{"line":40,"type":"binary-expr","locations":[{"start":{"line":40,"column":18},"end":{"line":40,"column":41}},{"start":{"line":40,"column":45},"end":{"line":40,"column":68}}]},"8":{"line":42,"type":"if","locations":[{"start":{"line":42,"column":2},"end":{"line":42,"column":2}},{"start":{"line":42,"column":2},"end":{"line":42,"column":2}}]},"9":{"line":46,"type":"if","locations":[{"start":{"line":46,"column":2},"end":{"line":46,"column":2}},{"start":{"line":46,"column":2},"end":{"line":46,"column":2}}]},"10":{"line":46,"type":"binary-expr","locations":[{"start":{"line":46,"column":6},"end":{"line":46,"column":13}},{"start":{"line":46,"column":17},"end":{"line":46,"column":24}}]},"11":{"line":52,"type":"if","locations":[{"start":{"line":52,"column":2},"end":{"line":52,"column":2}},{"start":{"line":52,"column":2},"end":{"line":52,"column":2}}]},"12":{"line":54,"type":"if","locations":[{"start":{"line":54,"column":4},"end":{"line":54,"column":4}},{"start":{"line":54,"column":4},"end":{"line":54,"column":4}}]}},"l":{"3":1,"5":1,"23":1,"24":18,"25":18,"26":18,"27":15,"29":15,"32":18,"33":18,"35":16,"36":16,"38":1,"40":16,"42":18,"44":9,"46":18,"48":9,"49":9,"51":18,"52":18,"53":15,"54":15,"55":8,"58":18}}}
|
213
node_modules/charset/coverage/lcov-report/base.css
generated
vendored
Normal file
213
node_modules/charset/coverage/lcov-report/base.css
generated
vendored
Normal file
@@ -0,0 +1,213 @@
|
||||
body, html {
|
||||
margin:0; padding: 0;
|
||||
height: 100%;
|
||||
}
|
||||
body {
|
||||
font-family: Helvetica Neue, Helvetica, Arial;
|
||||
font-size: 14px;
|
||||
color:#333;
|
||||
}
|
||||
.small { font-size: 12px; }
|
||||
*, *:after, *:before {
|
||||
-webkit-box-sizing:border-box;
|
||||
-moz-box-sizing:border-box;
|
||||
box-sizing:border-box;
|
||||
}
|
||||
h1 { font-size: 20px; margin: 0;}
|
||||
h2 { font-size: 14px; }
|
||||
pre {
|
||||
font: 12px/1.4 Consolas, "Liberation Mono", Menlo, Courier, monospace;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
-moz-tab-size: 2;
|
||||
-o-tab-size: 2;
|
||||
tab-size: 2;
|
||||
}
|
||||
a { color:#0074D9; text-decoration:none; }
|
||||
a:hover { text-decoration:underline; }
|
||||
.strong { font-weight: bold; }
|
||||
.space-top1 { padding: 10px 0 0 0; }
|
||||
.pad2y { padding: 20px 0; }
|
||||
.pad1y { padding: 10px 0; }
|
||||
.pad2x { padding: 0 20px; }
|
||||
.pad2 { padding: 20px; }
|
||||
.pad1 { padding: 10px; }
|
||||
.space-left2 { padding-left:55px; }
|
||||
.space-right2 { padding-right:20px; }
|
||||
.center { text-align:center; }
|
||||
.clearfix { display:block; }
|
||||
.clearfix:after {
|
||||
content:'';
|
||||
display:block;
|
||||
height:0;
|
||||
clear:both;
|
||||
visibility:hidden;
|
||||
}
|
||||
.fl { float: left; }
|
||||
@media only screen and (max-width:640px) {
|
||||
.col3 { width:100%; max-width:100%; }
|
||||
.hide-mobile { display:none!important; }
|
||||
}
|
||||
|
||||
.quiet {
|
||||
color: #7f7f7f;
|
||||
color: rgba(0,0,0,0.5);
|
||||
}
|
||||
.quiet a { opacity: 0.7; }
|
||||
|
||||
.fraction {
|
||||
font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;
|
||||
font-size: 10px;
|
||||
color: #555;
|
||||
background: #E8E8E8;
|
||||
padding: 4px 5px;
|
||||
border-radius: 3px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
div.path a:link, div.path a:visited { color: #333; }
|
||||
table.coverage {
|
||||
border-collapse: collapse;
|
||||
margin: 10px 0 0 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
table.coverage td {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
vertical-align: top;
|
||||
}
|
||||
table.coverage td.line-count {
|
||||
text-align: right;
|
||||
padding: 0 5px 0 20px;
|
||||
}
|
||||
table.coverage td.line-coverage {
|
||||
text-align: right;
|
||||
padding-right: 10px;
|
||||
min-width:20px;
|
||||
}
|
||||
|
||||
table.coverage td span.cline-any {
|
||||
display: inline-block;
|
||||
padding: 0 5px;
|
||||
width: 100%;
|
||||
}
|
||||
.missing-if-branch {
|
||||
display: inline-block;
|
||||
margin-right: 5px;
|
||||
border-radius: 3px;
|
||||
position: relative;
|
||||
padding: 0 4px;
|
||||
background: #333;
|
||||
color: yellow;
|
||||
}
|
||||
|
||||
.skip-if-branch {
|
||||
display: none;
|
||||
margin-right: 10px;
|
||||
position: relative;
|
||||
padding: 0 4px;
|
||||
background: #ccc;
|
||||
color: white;
|
||||
}
|
||||
.missing-if-branch .typ, .skip-if-branch .typ {
|
||||
color: inherit !important;
|
||||
}
|
||||
.coverage-summary {
|
||||
border-collapse: collapse;
|
||||
width: 100%;
|
||||
}
|
||||
.coverage-summary tr { border-bottom: 1px solid #bbb; }
|
||||
.keyline-all { border: 1px solid #ddd; }
|
||||
.coverage-summary td, .coverage-summary th { padding: 10px; }
|
||||
.coverage-summary tbody { border: 1px solid #bbb; }
|
||||
.coverage-summary td { border-right: 1px solid #bbb; }
|
||||
.coverage-summary td:last-child { border-right: none; }
|
||||
.coverage-summary th {
|
||||
text-align: left;
|
||||
font-weight: normal;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.coverage-summary th.file { border-right: none !important; }
|
||||
.coverage-summary th.pct { }
|
||||
.coverage-summary th.pic,
|
||||
.coverage-summary th.abs,
|
||||
.coverage-summary td.pct,
|
||||
.coverage-summary td.abs { text-align: right; }
|
||||
.coverage-summary td.file { white-space: nowrap; }
|
||||
.coverage-summary td.pic { min-width: 120px !important; }
|
||||
.coverage-summary tfoot td { }
|
||||
|
||||
.coverage-summary .sorter {
|
||||
height: 10px;
|
||||
width: 7px;
|
||||
display: inline-block;
|
||||
margin-left: 0.5em;
|
||||
background: url(sort-arrow-sprite.png) no-repeat scroll 0 0 transparent;
|
||||
}
|
||||
.coverage-summary .sorted .sorter {
|
||||
background-position: 0 -20px;
|
||||
}
|
||||
.coverage-summary .sorted-desc .sorter {
|
||||
background-position: 0 -10px;
|
||||
}
|
||||
.status-line { height: 10px; }
|
||||
/* dark red */
|
||||
.red.solid, .status-line.low, .low .cover-fill { background:#C21F39 }
|
||||
.low .chart { border:1px solid #C21F39 }
|
||||
/* medium red */
|
||||
.cstat-no, .fstat-no, .cbranch-no, .cbranch-no { background:#F6C6CE }
|
||||
/* light red */
|
||||
.low, .cline-no { background:#FCE1E5 }
|
||||
/* light green */
|
||||
.high, .cline-yes { background:rgb(230,245,208) }
|
||||
/* medium green */
|
||||
.cstat-yes { background:rgb(161,215,106) }
|
||||
/* dark green */
|
||||
.status-line.high, .high .cover-fill { background:rgb(77,146,33) }
|
||||
.high .chart { border:1px solid rgb(77,146,33) }
|
||||
/* dark yellow (gold) */
|
||||
.medium .chart { border:1px solid #f9cd0b; }
|
||||
.status-line.medium, .medium .cover-fill { background: #f9cd0b; }
|
||||
/* light yellow */
|
||||
.medium { background: #fff4c2; }
|
||||
/* light gray */
|
||||
span.cline-neutral { background: #eaeaea; }
|
||||
|
||||
.cbranch-no { background: yellow !important; color: #111; }
|
||||
|
||||
.cstat-skip { background: #ddd; color: #111; }
|
||||
.fstat-skip { background: #ddd; color: #111 !important; }
|
||||
.cbranch-skip { background: #ddd !important; color: #111; }
|
||||
|
||||
|
||||
.cover-fill, .cover-empty {
|
||||
display:inline-block;
|
||||
height: 12px;
|
||||
}
|
||||
.chart {
|
||||
line-height: 0;
|
||||
}
|
||||
.cover-empty {
|
||||
background: white;
|
||||
}
|
||||
.cover-full {
|
||||
border-right: none !important;
|
||||
}
|
||||
pre.prettyprint {
|
||||
border: none !important;
|
||||
padding: 0 !important;
|
||||
margin: 0 !important;
|
||||
}
|
||||
.com { color: #999 !important; }
|
||||
.ignore-none { color: #999; font-weight: normal; }
|
||||
|
||||
.wrapper {
|
||||
min-height: 100%;
|
||||
height: auto !important;
|
||||
height: 100%;
|
||||
margin: 0 auto -48px;
|
||||
}
|
||||
.footer, .push {
|
||||
height: 48px;
|
||||
}
|
93
node_modules/charset/coverage/lcov-report/charset/index.html
generated
vendored
Normal file
93
node_modules/charset/coverage/lcov-report/charset/index.html
generated
vendored
Normal file
@@ -0,0 +1,93 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Code coverage report for charset/</title>
|
||||
<meta charset="utf-8" />
|
||||
<link rel="stylesheet" href="../prettify.css" />
|
||||
<link rel="stylesheet" href="../base.css" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<style type='text/css'>
|
||||
.coverage-summary .sorter {
|
||||
background-image: url(../sort-arrow-sprite.png);
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class='wrapper'>
|
||||
<div class='pad1'>
|
||||
<h1>
|
||||
<a href="../index.html">all files</a> charset/
|
||||
</h1>
|
||||
<div class='clearfix'>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">100% </span>
|
||||
<span class="quiet">Statements</span>
|
||||
<span class='fraction'>25/25</span>
|
||||
</div>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">100% </span>
|
||||
<span class="quiet">Branches</span>
|
||||
<span class='fraction'>24/24</span>
|
||||
</div>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">100% </span>
|
||||
<span class="quiet">Functions</span>
|
||||
<span class='fraction'>1/1</span>
|
||||
</div>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">100% </span>
|
||||
<span class="quiet">Lines</span>
|
||||
<span class='fraction'>25/25</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class='status-line high'></div>
|
||||
<div class="pad1">
|
||||
<table class="coverage-summary">
|
||||
<thead>
|
||||
<tr>
|
||||
<th data-col="file" data-fmt="html" data-html="true" class="file">File</th>
|
||||
<th data-col="pic" data-type="number" data-fmt="html" data-html="true" class="pic"></th>
|
||||
<th data-col="statements" data-type="number" data-fmt="pct" class="pct">Statements</th>
|
||||
<th data-col="statements_raw" data-type="number" data-fmt="html" class="abs"></th>
|
||||
<th data-col="branches" data-type="number" data-fmt="pct" class="pct">Branches</th>
|
||||
<th data-col="branches_raw" data-type="number" data-fmt="html" class="abs"></th>
|
||||
<th data-col="functions" data-type="number" data-fmt="pct" class="pct">Functions</th>
|
||||
<th data-col="functions_raw" data-type="number" data-fmt="html" class="abs"></th>
|
||||
<th data-col="lines" data-type="number" data-fmt="pct" class="pct">Lines</th>
|
||||
<th data-col="lines_raw" data-type="number" data-fmt="html" class="abs"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody><tr>
|
||||
<td class="file high" data-value="index.js"><a href="index.js.html">index.js</a></td>
|
||||
<td data-value="100" class="pic high"><div class="chart"><div class="cover-fill cover-full" style="width: 100%;"></div><div class="cover-empty" style="width:0%;"></div></div></td>
|
||||
<td data-value="100" class="pct high">100%</td>
|
||||
<td data-value="25" class="abs high">25/25</td>
|
||||
<td data-value="100" class="pct high">100%</td>
|
||||
<td data-value="24" class="abs high">24/24</td>
|
||||
<td data-value="100" class="pct high">100%</td>
|
||||
<td data-value="1" class="abs high">1/1</td>
|
||||
<td data-value="100" class="pct high">100%</td>
|
||||
<td data-value="25" class="abs high">25/25</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div><div class='push'></div><!-- for sticky footer -->
|
||||
</div><!-- /wrapper -->
|
||||
<div class='footer quiet pad2 space-top1 center small'>
|
||||
Code coverage
|
||||
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Thu Jan 26 2017 10:50:05 GMT+0800 (CST)
|
||||
</div>
|
||||
</div>
|
||||
<script src="../prettify.js"></script>
|
||||
<script>
|
||||
window.onload = function () {
|
||||
if (typeof prettyPrint === 'function') {
|
||||
prettyPrint();
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<script src="../sorter.js"></script>
|
||||
</body>
|
||||
</html>
|
242
node_modules/charset/coverage/lcov-report/charset/index.js.html
generated
vendored
Normal file
242
node_modules/charset/coverage/lcov-report/charset/index.js.html
generated
vendored
Normal file
@@ -0,0 +1,242 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Code coverage report for charset/index.js</title>
|
||||
<meta charset="utf-8" />
|
||||
<link rel="stylesheet" href="../prettify.css" />
|
||||
<link rel="stylesheet" href="../base.css" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<style type='text/css'>
|
||||
.coverage-summary .sorter {
|
||||
background-image: url(../sort-arrow-sprite.png);
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class='wrapper'>
|
||||
<div class='pad1'>
|
||||
<h1>
|
||||
<a href="../index.html">all files</a> / <a href="index.html">charset/</a> index.js
|
||||
</h1>
|
||||
<div class='clearfix'>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">100% </span>
|
||||
<span class="quiet">Statements</span>
|
||||
<span class='fraction'>25/25</span>
|
||||
</div>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">100% </span>
|
||||
<span class="quiet">Branches</span>
|
||||
<span class='fraction'>24/24</span>
|
||||
</div>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">100% </span>
|
||||
<span class="quiet">Functions</span>
|
||||
<span class='fraction'>1/1</span>
|
||||
</div>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">100% </span>
|
||||
<span class="quiet">Lines</span>
|
||||
<span class='fraction'>25/25</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class='status-line high'></div>
|
||||
<pre><table class="coverage">
|
||||
<tr><td class="line-count quiet">1
|
||||
2
|
||||
3
|
||||
4
|
||||
5
|
||||
6
|
||||
7
|
||||
8
|
||||
9
|
||||
10
|
||||
11
|
||||
12
|
||||
13
|
||||
14
|
||||
15
|
||||
16
|
||||
17
|
||||
18
|
||||
19
|
||||
20
|
||||
21
|
||||
22
|
||||
23
|
||||
24
|
||||
25
|
||||
26
|
||||
27
|
||||
28
|
||||
29
|
||||
30
|
||||
31
|
||||
32
|
||||
33
|
||||
34
|
||||
35
|
||||
36
|
||||
37
|
||||
38
|
||||
39
|
||||
40
|
||||
41
|
||||
42
|
||||
43
|
||||
44
|
||||
45
|
||||
46
|
||||
47
|
||||
48
|
||||
49
|
||||
50
|
||||
51
|
||||
52
|
||||
53
|
||||
54
|
||||
55
|
||||
56
|
||||
57
|
||||
58
|
||||
59
|
||||
60</td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">1×</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">1×</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">1×</span>
|
||||
<span class="cline-any cline-yes">18×</span>
|
||||
<span class="cline-any cline-yes">18×</span>
|
||||
<span class="cline-any cline-yes">18×</span>
|
||||
<span class="cline-any cline-yes">15×</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">15×</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">18×</span>
|
||||
<span class="cline-any cline-yes">18×</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">16×</span>
|
||||
<span class="cline-any cline-yes">16×</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">1×</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">16×</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">18×</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">9×</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">18×</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">9×</span>
|
||||
<span class="cline-any cline-yes">9×</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">18×</span>
|
||||
<span class="cline-any cline-yes">18×</span>
|
||||
<span class="cline-any cline-yes">15×</span>
|
||||
<span class="cline-any cline-yes">15×</span>
|
||||
<span class="cline-any cline-yes">8×</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">18×</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">'use strict';
|
||||
|
||||
const CHARTSET_RE = /(?:charset|encoding)\s*=\s*['"]? *([\w\-]+)/i;
|
||||
|
||||
module.exports = charset;
|
||||
|
||||
/**
|
||||
* guest data charset from req.headers, xml, html content-type meta tag
|
||||
* headers:
|
||||
* 'content-type': 'text/html;charset=gbk'
|
||||
* meta tag:
|
||||
* <meta http-equiv="Content-Type" content="text/html; charset=xxxx"/>
|
||||
* xml file:
|
||||
* <?xml version="1.0" encoding="UTF-8"?>
|
||||
*
|
||||
* @param {Object} obj `Content-Type` String, or `res.headers`, or `res` Object
|
||||
* @param {Buffer} [data] content buffer
|
||||
* @param {Number} [peekSize] max content peek size, default is 512
|
||||
* @return {String} charset, lower case, e.g.: utf8, gbk, gb2312, ....
|
||||
* If can\'t guest, return null
|
||||
* @api public
|
||||
*/
|
||||
function charset(obj, data, peekSize) {
|
||||
let matchs = null;
|
||||
let end = 0;
|
||||
if (data) {
|
||||
peekSize = peekSize || 512;
|
||||
// https://github.com/node-modules/charset/issues/4
|
||||
end = data.length > peekSize ? peekSize : data.length;
|
||||
}
|
||||
// charset('text/html;charset=gbk')
|
||||
let contentType = obj;
|
||||
if (contentType && typeof contentType !== 'string') {
|
||||
// charset(res.headers)
|
||||
let headers = obj;
|
||||
if (obj.headers) {
|
||||
// charset(res)
|
||||
headers = obj.headers;
|
||||
}
|
||||
contentType = headers['content-type'] || headers['Content-Type'];
|
||||
}
|
||||
if (contentType) {
|
||||
// guest from obj first
|
||||
matchs = CHARTSET_RE.exec(contentType);
|
||||
}
|
||||
if (!matchs && end > 0) {
|
||||
// guest from content body (html/xml) header
|
||||
contentType = data.slice(0, end).toString();
|
||||
matchs = CHARTSET_RE.exec(contentType);
|
||||
}
|
||||
let cs = null;
|
||||
if (matchs) {
|
||||
cs = matchs[1].toLowerCase();
|
||||
if (cs === 'utf-8') {
|
||||
cs = 'utf8';
|
||||
}
|
||||
}
|
||||
return cs;
|
||||
}
|
||||
</pre></td></tr>
|
||||
</table></pre>
|
||||
<div class='push'></div><!-- for sticky footer -->
|
||||
</div><!-- /wrapper -->
|
||||
<div class='footer quiet pad2 space-top1 center small'>
|
||||
Code coverage
|
||||
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Thu Jan 26 2017 10:50:05 GMT+0800 (CST)
|
||||
</div>
|
||||
</div>
|
||||
<script src="../prettify.js"></script>
|
||||
<script>
|
||||
window.onload = function () {
|
||||
if (typeof prettyPrint === 'function') {
|
||||
prettyPrint();
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<script src="../sorter.js"></script>
|
||||
</body>
|
||||
</html>
|
93
node_modules/charset/coverage/lcov-report/index.html
generated
vendored
Normal file
93
node_modules/charset/coverage/lcov-report/index.html
generated
vendored
Normal file
@@ -0,0 +1,93 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Code coverage report for All files</title>
|
||||
<meta charset="utf-8" />
|
||||
<link rel="stylesheet" href="prettify.css" />
|
||||
<link rel="stylesheet" href="base.css" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<style type='text/css'>
|
||||
.coverage-summary .sorter {
|
||||
background-image: url(sort-arrow-sprite.png);
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class='wrapper'>
|
||||
<div class='pad1'>
|
||||
<h1>
|
||||
/
|
||||
</h1>
|
||||
<div class='clearfix'>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">100% </span>
|
||||
<span class="quiet">Statements</span>
|
||||
<span class='fraction'>25/25</span>
|
||||
</div>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">100% </span>
|
||||
<span class="quiet">Branches</span>
|
||||
<span class='fraction'>24/24</span>
|
||||
</div>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">100% </span>
|
||||
<span class="quiet">Functions</span>
|
||||
<span class='fraction'>1/1</span>
|
||||
</div>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">100% </span>
|
||||
<span class="quiet">Lines</span>
|
||||
<span class='fraction'>25/25</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class='status-line high'></div>
|
||||
<div class="pad1">
|
||||
<table class="coverage-summary">
|
||||
<thead>
|
||||
<tr>
|
||||
<th data-col="file" data-fmt="html" data-html="true" class="file">File</th>
|
||||
<th data-col="pic" data-type="number" data-fmt="html" data-html="true" class="pic"></th>
|
||||
<th data-col="statements" data-type="number" data-fmt="pct" class="pct">Statements</th>
|
||||
<th data-col="statements_raw" data-type="number" data-fmt="html" class="abs"></th>
|
||||
<th data-col="branches" data-type="number" data-fmt="pct" class="pct">Branches</th>
|
||||
<th data-col="branches_raw" data-type="number" data-fmt="html" class="abs"></th>
|
||||
<th data-col="functions" data-type="number" data-fmt="pct" class="pct">Functions</th>
|
||||
<th data-col="functions_raw" data-type="number" data-fmt="html" class="abs"></th>
|
||||
<th data-col="lines" data-type="number" data-fmt="pct" class="pct">Lines</th>
|
||||
<th data-col="lines_raw" data-type="number" data-fmt="html" class="abs"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody><tr>
|
||||
<td class="file high" data-value="charset/"><a href="charset/index.html">charset/</a></td>
|
||||
<td data-value="100" class="pic high"><div class="chart"><div class="cover-fill cover-full" style="width: 100%;"></div><div class="cover-empty" style="width:0%;"></div></div></td>
|
||||
<td data-value="100" class="pct high">100%</td>
|
||||
<td data-value="25" class="abs high">25/25</td>
|
||||
<td data-value="100" class="pct high">100%</td>
|
||||
<td data-value="24" class="abs high">24/24</td>
|
||||
<td data-value="100" class="pct high">100%</td>
|
||||
<td data-value="1" class="abs high">1/1</td>
|
||||
<td data-value="100" class="pct high">100%</td>
|
||||
<td data-value="25" class="abs high">25/25</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div><div class='push'></div><!-- for sticky footer -->
|
||||
</div><!-- /wrapper -->
|
||||
<div class='footer quiet pad2 space-top1 center small'>
|
||||
Code coverage
|
||||
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Thu Jan 26 2017 10:50:05 GMT+0800 (CST)
|
||||
</div>
|
||||
</div>
|
||||
<script src="prettify.js"></script>
|
||||
<script>
|
||||
window.onload = function () {
|
||||
if (typeof prettyPrint === 'function') {
|
||||
prettyPrint();
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<script src="sorter.js"></script>
|
||||
</body>
|
||||
</html>
|
1
node_modules/charset/coverage/lcov-report/prettify.css
generated
vendored
Normal file
1
node_modules/charset/coverage/lcov-report/prettify.css
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee}
|
1
node_modules/charset/coverage/lcov-report/prettify.js
generated
vendored
Normal file
1
node_modules/charset/coverage/lcov-report/prettify.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
BIN
node_modules/charset/coverage/lcov-report/sort-arrow-sprite.png
generated
vendored
Normal file
BIN
node_modules/charset/coverage/lcov-report/sort-arrow-sprite.png
generated
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 209 B |
158
node_modules/charset/coverage/lcov-report/sorter.js
generated
vendored
Normal file
158
node_modules/charset/coverage/lcov-report/sorter.js
generated
vendored
Normal file
@@ -0,0 +1,158 @@
|
||||
var addSorting = (function () {
|
||||
"use strict";
|
||||
var cols,
|
||||
currentSort = {
|
||||
index: 0,
|
||||
desc: false
|
||||
};
|
||||
|
||||
// returns the summary table element
|
||||
function getTable() { return document.querySelector('.coverage-summary'); }
|
||||
// returns the thead element of the summary table
|
||||
function getTableHeader() { return getTable().querySelector('thead tr'); }
|
||||
// returns the tbody element of the summary table
|
||||
function getTableBody() { return getTable().querySelector('tbody'); }
|
||||
// returns the th element for nth column
|
||||
function getNthColumn(n) { return getTableHeader().querySelectorAll('th')[n]; }
|
||||
|
||||
// loads all columns
|
||||
function loadColumns() {
|
||||
var colNodes = getTableHeader().querySelectorAll('th'),
|
||||
colNode,
|
||||
cols = [],
|
||||
col,
|
||||
i;
|
||||
|
||||
for (i = 0; i < colNodes.length; i += 1) {
|
||||
colNode = colNodes[i];
|
||||
col = {
|
||||
key: colNode.getAttribute('data-col'),
|
||||
sortable: !colNode.getAttribute('data-nosort'),
|
||||
type: colNode.getAttribute('data-type') || 'string'
|
||||
};
|
||||
cols.push(col);
|
||||
if (col.sortable) {
|
||||
col.defaultDescSort = col.type === 'number';
|
||||
colNode.innerHTML = colNode.innerHTML + '<span class="sorter"></span>';
|
||||
}
|
||||
}
|
||||
return cols;
|
||||
}
|
||||
// attaches a data attribute to every tr element with an object
|
||||
// of data values keyed by column name
|
||||
function loadRowData(tableRow) {
|
||||
var tableCols = tableRow.querySelectorAll('td'),
|
||||
colNode,
|
||||
col,
|
||||
data = {},
|
||||
i,
|
||||
val;
|
||||
for (i = 0; i < tableCols.length; i += 1) {
|
||||
colNode = tableCols[i];
|
||||
col = cols[i];
|
||||
val = colNode.getAttribute('data-value');
|
||||
if (col.type === 'number') {
|
||||
val = Number(val);
|
||||
}
|
||||
data[col.key] = val;
|
||||
}
|
||||
return data;
|
||||
}
|
||||
// loads all row data
|
||||
function loadData() {
|
||||
var rows = getTableBody().querySelectorAll('tr'),
|
||||
i;
|
||||
|
||||
for (i = 0; i < rows.length; i += 1) {
|
||||
rows[i].data = loadRowData(rows[i]);
|
||||
}
|
||||
}
|
||||
// sorts the table using the data for the ith column
|
||||
function sortByIndex(index, desc) {
|
||||
var key = cols[index].key,
|
||||
sorter = function (a, b) {
|
||||
a = a.data[key];
|
||||
b = b.data[key];
|
||||
return a < b ? -1 : a > b ? 1 : 0;
|
||||
},
|
||||
finalSorter = sorter,
|
||||
tableBody = document.querySelector('.coverage-summary tbody'),
|
||||
rowNodes = tableBody.querySelectorAll('tr'),
|
||||
rows = [],
|
||||
i;
|
||||
|
||||
if (desc) {
|
||||
finalSorter = function (a, b) {
|
||||
return -1 * sorter(a, b);
|
||||
};
|
||||
}
|
||||
|
||||
for (i = 0; i < rowNodes.length; i += 1) {
|
||||
rows.push(rowNodes[i]);
|
||||
tableBody.removeChild(rowNodes[i]);
|
||||
}
|
||||
|
||||
rows.sort(finalSorter);
|
||||
|
||||
for (i = 0; i < rows.length; i += 1) {
|
||||
tableBody.appendChild(rows[i]);
|
||||
}
|
||||
}
|
||||
// removes sort indicators for current column being sorted
|
||||
function removeSortIndicators() {
|
||||
var col = getNthColumn(currentSort.index),
|
||||
cls = col.className;
|
||||
|
||||
cls = cls.replace(/ sorted$/, '').replace(/ sorted-desc$/, '');
|
||||
col.className = cls;
|
||||
}
|
||||
// adds sort indicators for current column being sorted
|
||||
function addSortIndicators() {
|
||||
getNthColumn(currentSort.index).className += currentSort.desc ? ' sorted-desc' : ' sorted';
|
||||
}
|
||||
// adds event listeners for all sorter widgets
|
||||
function enableUI() {
|
||||
var i,
|
||||
el,
|
||||
ithSorter = function ithSorter(i) {
|
||||
var col = cols[i];
|
||||
|
||||
return function () {
|
||||
var desc = col.defaultDescSort;
|
||||
|
||||
if (currentSort.index === i) {
|
||||
desc = !currentSort.desc;
|
||||
}
|
||||
sortByIndex(i, desc);
|
||||
removeSortIndicators();
|
||||
currentSort.index = i;
|
||||
currentSort.desc = desc;
|
||||
addSortIndicators();
|
||||
};
|
||||
};
|
||||
for (i =0 ; i < cols.length; i += 1) {
|
||||
if (cols[i].sortable) {
|
||||
// add the click event handler on the th so users
|
||||
// dont have to click on those tiny arrows
|
||||
el = getNthColumn(i).querySelector('.sorter').parentElement;
|
||||
if (el.addEventListener) {
|
||||
el.addEventListener('click', ithSorter(i));
|
||||
} else {
|
||||
el.attachEvent('onclick', ithSorter(i));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// adds sorting functionality to the UI
|
||||
return function () {
|
||||
if (!getTable()) {
|
||||
return;
|
||||
}
|
||||
cols = loadColumns();
|
||||
loadData(cols);
|
||||
addSortIndicators();
|
||||
enableUI();
|
||||
};
|
||||
})();
|
||||
|
||||
window.addEventListener('load', addSorting);
|
60
node_modules/charset/coverage/lcov.info
generated
vendored
Normal file
60
node_modules/charset/coverage/lcov.info
generated
vendored
Normal file
@@ -0,0 +1,60 @@
|
||||
TN:
|
||||
SF:/Users/mk2/git/github.com/node-modules/charset/index.js
|
||||
FN:23,charset
|
||||
FNF:1
|
||||
FNH:1
|
||||
FNDA:18,charset
|
||||
DA:3,1
|
||||
DA:5,1
|
||||
DA:23,1
|
||||
DA:24,18
|
||||
DA:25,18
|
||||
DA:26,18
|
||||
DA:27,15
|
||||
DA:29,15
|
||||
DA:32,18
|
||||
DA:33,18
|
||||
DA:35,16
|
||||
DA:36,16
|
||||
DA:38,1
|
||||
DA:40,16
|
||||
DA:42,18
|
||||
DA:44,9
|
||||
DA:46,18
|
||||
DA:48,9
|
||||
DA:49,9
|
||||
DA:51,18
|
||||
DA:52,18
|
||||
DA:53,15
|
||||
DA:54,15
|
||||
DA:55,8
|
||||
DA:58,18
|
||||
LF:25
|
||||
LH:25
|
||||
BRDA:26,1,0,15
|
||||
BRDA:26,1,1,3
|
||||
BRDA:27,2,0,15
|
||||
BRDA:27,2,1,15
|
||||
BRDA:29,3,0,3
|
||||
BRDA:29,3,1,12
|
||||
BRDA:33,4,0,16
|
||||
BRDA:33,4,1,2
|
||||
BRDA:33,5,0,18
|
||||
BRDA:33,5,1,17
|
||||
BRDA:36,6,0,1
|
||||
BRDA:36,6,1,15
|
||||
BRDA:40,7,0,16
|
||||
BRDA:40,7,1,9
|
||||
BRDA:42,8,0,9
|
||||
BRDA:42,8,1,9
|
||||
BRDA:46,9,0,9
|
||||
BRDA:46,9,1,9
|
||||
BRDA:46,10,0,18
|
||||
BRDA:46,10,1,11
|
||||
BRDA:52,11,0,15
|
||||
BRDA:52,11,1,3
|
||||
BRDA:54,12,0,8
|
||||
BRDA:54,12,1,7
|
||||
BRF:24
|
||||
BRH:24
|
||||
end_of_record
|
59
node_modules/charset/index.js
generated
vendored
Normal file
59
node_modules/charset/index.js
generated
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
'use strict';
|
||||
|
||||
const CHARTSET_RE = /(?:charset|encoding)\s{0,10}=\s{0,10}['"]? {0,10}([\w\-]{1,100})/i;
|
||||
|
||||
module.exports = charset;
|
||||
|
||||
/**
|
||||
* guest data charset from req.headers, xml, html content-type meta tag
|
||||
* headers:
|
||||
* 'content-type': 'text/html;charset=gbk'
|
||||
* meta tag:
|
||||
* <meta http-equiv="Content-Type" content="text/html; charset=xxxx"/>
|
||||
* xml file:
|
||||
* <?xml version="1.0" encoding="UTF-8"?>
|
||||
*
|
||||
* @param {Object} obj `Content-Type` String, or `res.headers`, or `res` Object
|
||||
* @param {Buffer} [data] content buffer
|
||||
* @param {Number} [peekSize] max content peek size, default is 512
|
||||
* @return {String} charset, lower case, e.g.: utf8, gbk, gb2312, ....
|
||||
* If can\'t guest, return null
|
||||
* @api public
|
||||
*/
|
||||
function charset(obj, data, peekSize) {
|
||||
let matchs = null;
|
||||
let end = 0;
|
||||
if (data) {
|
||||
peekSize = peekSize || 512;
|
||||
// https://github.com/node-modules/charset/issues/4
|
||||
end = data.length > peekSize ? peekSize : data.length;
|
||||
}
|
||||
// charset('text/html;charset=gbk')
|
||||
let contentType = obj;
|
||||
if (contentType && typeof contentType !== 'string') {
|
||||
// charset(res.headers)
|
||||
let headers = obj;
|
||||
if (obj.headers) {
|
||||
// charset(res)
|
||||
headers = obj.headers;
|
||||
}
|
||||
contentType = headers['content-type'] || headers['Content-Type'];
|
||||
}
|
||||
if (contentType) {
|
||||
// guest from obj first
|
||||
matchs = CHARTSET_RE.exec(contentType);
|
||||
}
|
||||
if (!matchs && end > 0) {
|
||||
// guest from content body (html/xml) header
|
||||
contentType = data.slice(0, end).toString();
|
||||
matchs = CHARTSET_RE.exec(contentType);
|
||||
}
|
||||
let cs = null;
|
||||
if (matchs) {
|
||||
cs = matchs[1].toLowerCase();
|
||||
if (cs === 'utf-8') {
|
||||
cs = 'utf8';
|
||||
}
|
||||
}
|
||||
return cs;
|
||||
}
|
39
node_modules/charset/package.json
generated
vendored
Normal file
39
node_modules/charset/package.json
generated
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
{
|
||||
"name": "charset",
|
||||
"version": "1.0.1",
|
||||
"description": "Get the content charset from header and html content-type.",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "npm run lint && egg-bin test",
|
||||
"ci": "npm run lint && egg-bin cov",
|
||||
"lint": "eslint test *.js"
|
||||
},
|
||||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"egg-bin": "1",
|
||||
"egg-ci": "^1.1.0",
|
||||
"eslint": "4",
|
||||
"eslint-config-egg": "5"
|
||||
},
|
||||
"homepage": "https://github.com/node-modules/charset",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/node-modules/charset.git"
|
||||
},
|
||||
"keywords": [
|
||||
"charset",
|
||||
"content-type",
|
||||
"ContentType",
|
||||
"Content-Type",
|
||||
"xml",
|
||||
"encoding"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=4.0.0"
|
||||
},
|
||||
"ci": {
|
||||
"version": "4, 6, 8"
|
||||
},
|
||||
"author": "fengmk2 <fengmk2@gmail.com> (https://fengmk2.com)",
|
||||
"license": "MIT"
|
||||
}
|
Reference in New Issue
Block a user