Add capacitorjs runtime
This commit is contained in:
parent
d0ece489ee
commit
f90c0e6c40
8362 changed files with 1502407 additions and 1 deletions
2
node_modules/stream-buffers/.mailmap
generated
vendored
Normal file
2
node_modules/stream-buffers/.mailmap
generated
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
Sam Day <sam.c.day@gmail.com>
|
||||
Sam Day <me@samcday.com.au>
|
||||
28
node_modules/stream-buffers/.travis.yml
generated
vendored
Normal file
28
node_modules/stream-buffers/.travis.yml
generated
vendored
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
language: node_js
|
||||
|
||||
matrix:
|
||||
include:
|
||||
- node_js: '0.10'
|
||||
env: NO_COVERAGE=1
|
||||
- node_js: '0.11'
|
||||
env: NO_COVERAGE=1
|
||||
- node_js: '0.12'
|
||||
|
||||
deploy:
|
||||
provider: npm
|
||||
email: me@samcday.com.au
|
||||
api_key:
|
||||
secure: GIkpHAQZJH8xTq1oRG66f+J0j4PMxEBoDzIiOyREBypGslOy6NbWxP0Q8rgD6wfzBRMixSctqeiKyTkiC+92BGPLL7k1eyeN9ycXjYHuDVJrRyYAMjg1Xh72ekFPZnycgUngMTwWX/FtQShkvaDoG+1S0W+qdC+cRz+9Dh7+XEM=
|
||||
on:
|
||||
tags: true
|
||||
all_branches: true
|
||||
node_js: 0.12
|
||||
|
||||
addons:
|
||||
code_climate:
|
||||
repo_token:
|
||||
secure: "qoQoeJZrjiE7RmcGIZNmR2tO3/oP1NqlxhYkj1TYbMVOYmK4zsOdeVjhllkETZaGejKcw1uXEQx7caSmpZQ6lw5V5JXmyyTzo8xfAbanP9Wf4WXw5uSOaBDYR/DR2B9VfkHT7spPVwdoX09sgb+oTIy4IgBUivucm6IGmiw7PuY="
|
||||
|
||||
after_script:
|
||||
- npm install -g codeclimate-test-reporter
|
||||
- cat coverage/lcov.info | codeclimate
|
||||
157
node_modules/stream-buffers/README.md
generated
vendored
Normal file
157
node_modules/stream-buffers/README.md
generated
vendored
Normal file
|
|
@ -0,0 +1,157 @@
|
|||
# Node Stream Buffers
|
||||
|
||||
[![Build Status][badge-travis-img]][badge-travis-url]
|
||||
[![Code Climate][badge-climate-img]][badge-climate-url]
|
||||
[![Code Coverage][badge-coverage-img]][badge-coverage-url]
|
||||
|
||||
Simple Readable and Writable Streams that use a [Buffer][node-buffer-docs] to store received data, or for data to send out. Useful for test code, debugging, and a wide range of other utilities.
|
||||
|
||||
## Installation
|
||||
|
||||
[![NPM][badge-npm-img]][badge-npm-url]
|
||||
|
||||
## Usage
|
||||
|
||||
To use the stream buffers in your module, simply import it and away you go.
|
||||
|
||||
```js
|
||||
var streamBuffers = require("stream-buffers");
|
||||
```
|
||||
|
||||
### Writable StreamBuffer
|
||||
|
||||
Writable Stream Buffers implement the standardized writable stream interface. All write()'s to this object will accumulate in an internal Buffer. If the Buffer overflows it will be resized larger automatically. The initial size of the Buffer and the amount in which it grows can be configured in the constructor.
|
||||
|
||||
```js
|
||||
var myWritableStreamBuffer = new streamBuffers.WritableStreamBuffer({
|
||||
initialSize: (100 * 1024), // start as 100 kilobytes.
|
||||
incrementAmount: (10 * 1024) // grow by 10 kilobytes each time buffer overflows.
|
||||
});
|
||||
```
|
||||
|
||||
The default initial size and increment amount are stored in the following constants:
|
||||
|
||||
```js
|
||||
streamBuffers.DEFAULT_INITIAL_SIZE // (8 * 1024)
|
||||
streamBuffers.DEFAULT_INCREMENT_AMOUNT // (8 * 1024)
|
||||
```
|
||||
|
||||
Writing is standard Stream stuff:
|
||||
|
||||
```js
|
||||
myWritableStreamBuffer.write(myBuffer);
|
||||
// - or -
|
||||
myWritableStreamBuffer.write("\u00bd + \u00bc = \u00be", "utf8");
|
||||
```
|
||||
|
||||
You can query the size of the data being held in the Buffer, and also how big the Buffer's max capacity currently is:
|
||||
|
||||
```js
|
||||
myWritableStreamBuffer.write("ASDF");
|
||||
streamBuffers.size(); // 4.
|
||||
streamBuffers.maxSize(); // Whatever was configured as initial size. In our example: (100 * 1024).
|
||||
```
|
||||
|
||||
Retrieving the contents of the Buffer is simple:
|
||||
|
||||
```js
|
||||
myWritableStreamBuffer.getContents(); // Gets all held data as a Buffer.
|
||||
myWritableStreamBuffer.getContentsAsString("utf8"); // Gets all held data as a utf8 string.
|
||||
myWritableStreamBuffer.getContents(5); // Gets first 5 bytes as a Buffer.
|
||||
myWritableStreamBuffer.getContentsAsString("utf8", 5); // Gets first 5 bytes as a utf8 string.
|
||||
```
|
||||
|
||||
Care should be taken when getting encoded strings from WritableStream, as it doesn't really care about the contents (multi-byte characters will not be respected).
|
||||
|
||||
Destroying or ending the WritableStream will not delete the contents of Buffer, but will disallow any further writes:
|
||||
|
||||
```js
|
||||
myWritableStreamBuffer.write("ASDF");
|
||||
myWritableStreamBuffer.destroy();
|
||||
|
||||
myWritableStreamBuffer.getContents(); // Returns ASDF in Buffer.
|
||||
myWritableStreamBuffer.write("Yeah?"); // No effect.
|
||||
```
|
||||
|
||||
### Readable StreamBuffer
|
||||
|
||||
Readable Stream Buffers can have data inserted in them, which will then be pumped out via standard readable stream data events. The data to be sent out is held in a Buffer, which can grow in much the same way as a WritableStream Buffer does, if data is being put in Buffer faster than it's being pumped out.
|
||||
|
||||
The frequency in which chunks are pumped out, and the size of the chunks themselves can be configured in the constructor. The initial size and increment amount of internal Buffer can be configured too.
|
||||
|
||||
```js
|
||||
var myReadableStreamBuffer = new streamBuffers.ReadableStreamBuffer({
|
||||
frequency: 10, // in milliseconds.
|
||||
chunkSize: 2048 // in bytes.
|
||||
});
|
||||
```
|
||||
|
||||
Default frequency and chunk size:
|
||||
|
||||
```js
|
||||
streamBuffers.DEFAULT_CHUNK_SIZE // (1024)
|
||||
streamBuffers.DEFAULT_FREQUENCY // (1)
|
||||
```
|
||||
|
||||
Putting data in Buffer to be pumped out is easy:
|
||||
|
||||
```js
|
||||
myReadableStreamBuffer.put(aBuffer);
|
||||
myReadableStreamBuffer.put("A String", "utf8");
|
||||
```
|
||||
|
||||
Chunks are pumped out via standard readable stream spec:
|
||||
|
||||
```js
|
||||
myReadableStreamBuffer.on("data", function(data) {
|
||||
// Yup.
|
||||
assert.isTrue(data instanceof Buffer);
|
||||
});
|
||||
```
|
||||
|
||||
Chunks are pumped out by the interval that you specified in frequency. Setting the frequency to 0 will immediately stream the data (also in chunks), even if the stream has not been piped to a destination. This is useful for unit testing.
|
||||
|
||||
setEncoding() for streams is respected too:
|
||||
|
||||
```js
|
||||
myReadableStreamBuffer.setEncoding("utf8");
|
||||
myReadableStreamBuffer.on("data", function(data) {
|
||||
assert.isTrue(data instanceof String);
|
||||
});
|
||||
```
|
||||
|
||||
Pause and resume are also implemented. pause()'ing stream will allow buffer to continue accumulating, but will not pump any of that data out until it is resume()'d again.
|
||||
|
||||
Destroying the stream will immediately purge the buffer, unless destroySoon() is called, in which case the rest of the buffer will be written out. Either way, any further attempts to put data in the Buffer will be silently ignored.
|
||||
|
||||
```js
|
||||
myReadableStreamBuffer.destroySoon();
|
||||
myReadableStreamBuffer.put("A String!");
|
||||
myReadableStreamBuffer.size(); // will be 0.
|
||||
```
|
||||
|
||||
## Disclaimer
|
||||
|
||||
Not supposed to be a speed demon, it's more for tests/debugging or weird edge cases. It works with an internal buffer that it copies contents to/from/around.
|
||||
|
||||
## Contributors
|
||||
|
||||
Thanks to the following people for taking some time to contribute to this project.
|
||||
|
||||
* Igor Dralyuk <idralyuk@ebay.com>
|
||||
* Simon Koudijs <simon.koudijs@intellifi.nl>
|
||||
|
||||
## License
|
||||
|
||||
node-stream-buffer is free and unencumbered public domain software. For more information, see the accompanying UNLICENSE file.
|
||||
|
||||
[badge-travis-img]: http://img.shields.io/travis/samcday/node-stream-buffer.svg?style=flat-square
|
||||
[badge-travis-url]: https://travis-ci.org/samcday/node-stream-buffer
|
||||
[badge-climate-img]: http://img.shields.io/codeclimate/github/samcday/node-stream-buffer.svg?style=flat-square
|
||||
[badge-climate-url]: https://codeclimate.com/github/samcday/node-stream-buffer
|
||||
[badge-coverage-img]: http://img.shields.io/codeclimate/coverage/github/samcday/node-stream-buffer.svg?style=flat-square
|
||||
[badge-coverage-url]: https://codeclimate.com/github/samcday/node-stream-buffer
|
||||
[badge-npm-img]: https://nodei.co/npm/stream-buffers.png?downloads=true&downloadRank=true&stars=true
|
||||
[badge-npm-url]: https://npmjs.org/package/stream-buffers
|
||||
|
||||
[node-buffer-docs]: http://nodejs.org/api/buffer.html
|
||||
24
node_modules/stream-buffers/UNLICENSE
generated
vendored
Normal file
24
node_modules/stream-buffers/UNLICENSE
generated
vendored
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
This is free and unencumbered software released into the public domain.
|
||||
|
||||
Anyone is free to copy, modify, publish, use, compile, sell, or
|
||||
distribute this software, either in source code form or as a compiled
|
||||
binary, for any purpose, commercial or non-commercial, and by any
|
||||
means.
|
||||
|
||||
In jurisdictions that recognize copyright laws, the author or authors
|
||||
of this software dedicate any and all copyright interest in the
|
||||
software to the public domain. We make this dedication for the benefit
|
||||
of the public at large and to the detriment of our heirs and
|
||||
successors. We intend this dedication to be an overt act of
|
||||
relinquishment in perpetuity of all present and future rights to this
|
||||
software under copyright law.
|
||||
|
||||
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 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.
|
||||
|
||||
For more information, please refer to <http://unlicense.org/>
|
||||
1
node_modules/stream-buffers/coverage/coverage.json
generated
vendored
Normal file
1
node_modules/stream-buffers/coverage/coverage.json
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
182
node_modules/stream-buffers/coverage/lcov-report/base.css
generated
vendored
Normal file
182
node_modules/stream-buffers/coverage/lcov-report/base.css
generated
vendored
Normal file
|
|
@ -0,0 +1,182 @@
|
|||
body, html {
|
||||
margin:0; padding: 0;
|
||||
}
|
||||
body {
|
||||
font-family: Helvetica Neue, Helvetica,Arial;
|
||||
font-size: 10pt;
|
||||
}
|
||||
div.header, div.footer {
|
||||
background: #eee;
|
||||
padding: 1em;
|
||||
}
|
||||
div.header {
|
||||
z-index: 100;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
border-bottom: 1px solid #666;
|
||||
width: 100%;
|
||||
}
|
||||
div.footer {
|
||||
border-top: 1px solid #666;
|
||||
}
|
||||
div.body {
|
||||
margin-top: 10em;
|
||||
}
|
||||
div.meta {
|
||||
font-size: 90%;
|
||||
text-align: center;
|
||||
}
|
||||
h1, h2, h3 {
|
||||
font-weight: normal;
|
||||
}
|
||||
h1 {
|
||||
font-size: 12pt;
|
||||
}
|
||||
h2 {
|
||||
font-size: 10pt;
|
||||
}
|
||||
pre {
|
||||
font-family: Consolas, Menlo, Monaco, monospace;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
line-height: 14px;
|
||||
font-size: 14px;
|
||||
-moz-tab-size: 2;
|
||||
-o-tab-size: 2;
|
||||
tab-size: 2;
|
||||
}
|
||||
|
||||
div.path { font-size: 110%; }
|
||||
div.path a:link, div.path a:visited { color: #000; }
|
||||
table.coverage { border-collapse: collapse; margin:0; padding: 0 }
|
||||
|
||||
table.coverage td {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
color: #111;
|
||||
vertical-align: top;
|
||||
}
|
||||
table.coverage td.line-count {
|
||||
width: 50px;
|
||||
text-align: right;
|
||||
padding-right: 5px;
|
||||
}
|
||||
table.coverage td.line-coverage {
|
||||
color: #777 !important;
|
||||
text-align: right;
|
||||
border-left: 1px solid #666;
|
||||
border-right: 1px solid #666;
|
||||
}
|
||||
|
||||
table.coverage td.text {
|
||||
}
|
||||
|
||||
table.coverage td span.cline-any {
|
||||
display: inline-block;
|
||||
padding: 0 5px;
|
||||
width: 40px;
|
||||
}
|
||||
table.coverage td span.cline-neutral {
|
||||
background: #eee;
|
||||
}
|
||||
table.coverage td span.cline-yes {
|
||||
background: #b5d592;
|
||||
color: #999;
|
||||
}
|
||||
table.coverage td span.cline-no {
|
||||
background: #fc8c84;
|
||||
}
|
||||
|
||||
.cstat-yes { color: #111; }
|
||||
.cstat-no { background: #fc8c84; color: #111; }
|
||||
.fstat-no { background: #ffc520; color: #111 !important; }
|
||||
.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; }
|
||||
|
||||
.missing-if-branch {
|
||||
display: inline-block;
|
||||
margin-right: 10px;
|
||||
position: relative;
|
||||
padding: 0 4px;
|
||||
background: black;
|
||||
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;
|
||||
}
|
||||
|
||||
.entity, .metric { font-weight: bold; }
|
||||
.metric { display: inline-block; border: 1px solid #333; padding: 0.3em; background: white; }
|
||||
.metric small { font-size: 80%; font-weight: normal; color: #666; }
|
||||
|
||||
div.coverage-summary table { border-collapse: collapse; margin: 3em; font-size: 110%; }
|
||||
div.coverage-summary td, div.coverage-summary table th { margin: 0; padding: 0.25em 1em; border-top: 1px solid #666; border-bottom: 1px solid #666; }
|
||||
div.coverage-summary th { text-align: left; border: 1px solid #666; background: #eee; font-weight: normal; }
|
||||
div.coverage-summary th.file { border-right: none !important; }
|
||||
div.coverage-summary th.pic { border-left: none !important; text-align: right; }
|
||||
div.coverage-summary th.pct { border-right: none !important; }
|
||||
div.coverage-summary th.abs { border-left: none !important; text-align: right; }
|
||||
div.coverage-summary td.pct { text-align: right; border-left: 1px solid #666; }
|
||||
div.coverage-summary td.abs { text-align: right; font-size: 90%; color: #444; border-right: 1px solid #666; }
|
||||
div.coverage-summary td.file { border-left: 1px solid #666; white-space: nowrap; }
|
||||
div.coverage-summary td.pic { min-width: 120px !important; }
|
||||
div.coverage-summary a:link { text-decoration: none; color: #000; }
|
||||
div.coverage-summary a:visited { text-decoration: none; color: #777; }
|
||||
div.coverage-summary a:hover { text-decoration: underline; }
|
||||
div.coverage-summary tfoot td { border-top: 1px solid #666; }
|
||||
|
||||
div.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;
|
||||
}
|
||||
div.coverage-summary .sorted .sorter {
|
||||
background-position: 0 -20px;
|
||||
}
|
||||
div.coverage-summary .sorted-desc .sorter {
|
||||
background-position: 0 -10px;
|
||||
}
|
||||
|
||||
.high { background: #b5d592 !important; }
|
||||
.medium { background: #ffe87c !important; }
|
||||
.low { background: #fc8c84 !important; }
|
||||
|
||||
span.cover-fill, span.cover-empty {
|
||||
display:inline-block;
|
||||
border:1px solid #444;
|
||||
background: white;
|
||||
height: 12px;
|
||||
}
|
||||
span.cover-fill {
|
||||
background: #ccc;
|
||||
border-right: 1px solid #444;
|
||||
}
|
||||
span.cover-empty {
|
||||
background: white;
|
||||
border-left: none;
|
||||
}
|
||||
span.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; }
|
||||
73
node_modules/stream-buffers/coverage/lcov-report/index.html
generated
vendored
Normal file
73
node_modules/stream-buffers/coverage/lcov-report/index.html
generated
vendored
Normal file
|
|
@ -0,0 +1,73 @@
|
|||
<!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">
|
||||
<style type='text/css'>
|
||||
div.coverage-summary .sorter {
|
||||
background-image: url(sort-arrow-sprite.png);
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="header high">
|
||||
<h1>Code coverage report for <span class="entity">All files</span></h1>
|
||||
<h2>
|
||||
Statements: <span class="metric">98.01% <small>(148 / 151)</small></span>
|
||||
Branches: <span class="metric">92.94% <small>(79 / 85)</small></span>
|
||||
Functions: <span class="metric">100% <small>(20 / 20)</small></span>
|
||||
Lines: <span class="metric">99.31% <small>(143 / 144)</small></span>
|
||||
Ignored: <span class="metric"><span class="ignore-none">none</span></span>
|
||||
</h2>
|
||||
<div class="path"></div>
|
||||
</div>
|
||||
<div class="body">
|
||||
<div class="coverage-summary">
|
||||
<table>
|
||||
<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="lib/"><a href="lib/index.html">lib/</a></td>
|
||||
<td data-value="98.01" class="pic high"><span class="cover-fill" style="width: 98px;"></span><span class="cover-empty" style="width:2px;"></span></td>
|
||||
<td data-value="98.01" class="pct high">98.01%</td>
|
||||
<td data-value="151" class="abs high">(148 / 151)</td>
|
||||
<td data-value="92.94" class="pct high">92.94%</td>
|
||||
<td data-value="85" class="abs high">(79 / 85)</td>
|
||||
<td data-value="100" class="pct high">100%</td>
|
||||
<td data-value="20" class="abs high">(20 / 20)</td>
|
||||
<td data-value="99.31" class="pct high">99.31%</td>
|
||||
<td data-value="144" class="abs high">(143 / 144)</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="footer">
|
||||
<div class="meta">Generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Wed Jul 01 2015 04:16:19 GMT+0000 (UTC)</div>
|
||||
</div>
|
||||
<script src="prettify.js"></script>
|
||||
<script>
|
||||
window.onload = function () {
|
||||
if (typeof prettyPrint === 'function') {
|
||||
prettyPrint();
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<script src="sorter.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
63
node_modules/stream-buffers/coverage/lcov-report/lib/constants.js.html
generated
vendored
Normal file
63
node_modules/stream-buffers/coverage/lcov-report/lib/constants.js.html
generated
vendored
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Code coverage report for lib/constants.js</title>
|
||||
<meta charset="utf-8">
|
||||
<link rel="stylesheet" href="../prettify.css">
|
||||
<link rel="stylesheet" href="../base.css">
|
||||
<style type='text/css'>
|
||||
div.coverage-summary .sorter {
|
||||
background-image: url(../sort-arrow-sprite.png);
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="header high">
|
||||
<h1>Code coverage report for <span class="entity">lib/constants.js</span></h1>
|
||||
<h2>
|
||||
Statements: <span class="metric">100% <small>(1 / 1)</small></span>
|
||||
Branches: <span class="metric">100% <small>(0 / 0)</small></span>
|
||||
Functions: <span class="metric">100% <small>(0 / 0)</small></span>
|
||||
Lines: <span class="metric">100% <small>(1 / 1)</small></span>
|
||||
Ignored: <span class="metric"><span class="ignore-none">none</span></span>
|
||||
</h2>
|
||||
<div class="path"><a href="../index.html">All files</a> » <a href="index.html">lib/</a> » constants.js</div>
|
||||
</div>
|
||||
<div class="body">
|
||||
<pre><table class="coverage">
|
||||
<tr><td class="line-count">1
|
||||
2
|
||||
3
|
||||
4
|
||||
5
|
||||
6
|
||||
7</td><td class="line-coverage"><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></td><td class="text"><pre class="prettyprint lang-js">module.exports = {
|
||||
DEFAULT_INITIAL_SIZE: (8 * 1024),
|
||||
DEFAULT_INCREMENT_AMOUNT: (8 * 1024),
|
||||
DEFAULT_FREQUENCY: 1,
|
||||
DEFAULT_CHUNK_SIZE: 1024
|
||||
};
|
||||
</pre></td></tr>
|
||||
</table></pre>
|
||||
|
||||
</div>
|
||||
<div class="footer">
|
||||
<div class="meta">Generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Wed Jul 01 2015 04:16:19 GMT+0000 (UTC)</div>
|
||||
</div>
|
||||
<script src="../prettify.js"></script>
|
||||
<script>
|
||||
window.onload = function () {
|
||||
if (typeof prettyPrint === 'function') {
|
||||
prettyPrint();
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<script src="../sorter.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
112
node_modules/stream-buffers/coverage/lcov-report/lib/index.html
generated
vendored
Normal file
112
node_modules/stream-buffers/coverage/lcov-report/lib/index.html
generated
vendored
Normal file
|
|
@ -0,0 +1,112 @@
|
|||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Code coverage report for lib/</title>
|
||||
<meta charset="utf-8">
|
||||
<link rel="stylesheet" href="../prettify.css">
|
||||
<link rel="stylesheet" href="../base.css">
|
||||
<style type='text/css'>
|
||||
div.coverage-summary .sorter {
|
||||
background-image: url(../sort-arrow-sprite.png);
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="header high">
|
||||
<h1>Code coverage report for <span class="entity">lib/</span></h1>
|
||||
<h2>
|
||||
Statements: <span class="metric">98.01% <small>(148 / 151)</small></span>
|
||||
Branches: <span class="metric">92.94% <small>(79 / 85)</small></span>
|
||||
Functions: <span class="metric">100% <small>(20 / 20)</small></span>
|
||||
Lines: <span class="metric">99.31% <small>(143 / 144)</small></span>
|
||||
Ignored: <span class="metric"><span class="ignore-none">none</span></span>
|
||||
</h2>
|
||||
<div class="path"><a href="../index.html">All files</a> » lib/</div>
|
||||
</div>
|
||||
<div class="body">
|
||||
<div class="coverage-summary">
|
||||
<table>
|
||||
<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="constants.js"><a href="constants.js.html">constants.js</a></td>
|
||||
<td data-value="100" class="pic high"><span class="cover-fill cover-full" style="width: 100px;"></span><span class="cover-empty" style="width:0px;"></span></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="0" class="abs high">(0 / 0)</td>
|
||||
<td data-value="100" class="pct high">100%</td>
|
||||
<td data-value="0" class="abs high">(0 / 0)</td>
|
||||
<td data-value="100" class="pct high">100%</td>
|
||||
<td data-value="1" class="abs high">(1 / 1)</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="file high" data-value="readable_streambuffer.js"><a href="readable_streambuffer.js.html">readable_streambuffer.js</a></td>
|
||||
<td data-value="98.82" class="pic high"><span class="cover-fill" style="width: 98px;"></span><span class="cover-empty" style="width:2px;"></span></td>
|
||||
<td data-value="98.82" class="pct high">98.82%</td>
|
||||
<td data-value="85" class="abs high">(84 / 85)</td>
|
||||
<td data-value="94.34" class="pct high">94.34%</td>
|
||||
<td data-value="53" class="abs high">(50 / 53)</td>
|
||||
<td data-value="100" class="pct high">100%</td>
|
||||
<td data-value="11" class="abs high">(11 / 11)</td>
|
||||
<td data-value="100" class="pct high">100%</td>
|
||||
<td data-value="83" class="abs high">(83 / 83)</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="file high" data-value="streambuffer.js"><a href="streambuffer.js.html">streambuffer.js</a></td>
|
||||
<td data-value="100" class="pic high"><span class="cover-fill cover-full" style="width: 100px;"></span><span class="cover-empty" style="width:0px;"></span></td>
|
||||
<td data-value="100" class="pct high">100%</td>
|
||||
<td data-value="3" class="abs high">(3 / 3)</td>
|
||||
<td data-value="100" class="pct high">100%</td>
|
||||
<td data-value="0" class="abs high">(0 / 0)</td>
|
||||
<td data-value="100" class="pct high">100%</td>
|
||||
<td data-value="0" class="abs high">(0 / 0)</td>
|
||||
<td data-value="100" class="pct high">100%</td>
|
||||
<td data-value="3" class="abs high">(3 / 3)</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="file high" data-value="writable_streambuffer.js"><a href="writable_streambuffer.js.html">writable_streambuffer.js</a></td>
|
||||
<td data-value="96.77" class="pic high"><span class="cover-fill" style="width: 96px;"></span><span class="cover-empty" style="width:4px;"></span></td>
|
||||
<td data-value="96.77" class="pct high">96.77%</td>
|
||||
<td data-value="62" class="abs high">(60 / 62)</td>
|
||||
<td data-value="90.63" class="pct high">90.63%</td>
|
||||
<td data-value="32" class="abs high">(29 / 32)</td>
|
||||
<td data-value="100" class="pct high">100%</td>
|
||||
<td data-value="9" class="abs high">(9 / 9)</td>
|
||||
<td data-value="98.25" class="pct high">98.25%</td>
|
||||
<td data-value="57" class="abs high">(56 / 57)</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="footer">
|
||||
<div class="meta">Generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Wed Jul 01 2015 04:16:19 GMT+0000 (UTC)</div>
|
||||
</div>
|
||||
<script src="../prettify.js"></script>
|
||||
<script>
|
||||
window.onload = function () {
|
||||
if (typeof prettyPrint === 'function') {
|
||||
prettyPrint();
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<script src="../sorter.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
453
node_modules/stream-buffers/coverage/lcov-report/lib/readable_streambuffer.js.html
generated
vendored
Normal file
453
node_modules/stream-buffers/coverage/lcov-report/lib/readable_streambuffer.js.html
generated
vendored
Normal file
|
|
@ -0,0 +1,453 @@
|
|||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Code coverage report for lib/readable_streambuffer.js</title>
|
||||
<meta charset="utf-8">
|
||||
<link rel="stylesheet" href="../prettify.css">
|
||||
<link rel="stylesheet" href="../base.css">
|
||||
<style type='text/css'>
|
||||
div.coverage-summary .sorter {
|
||||
background-image: url(../sort-arrow-sprite.png);
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="header high">
|
||||
<h1>Code coverage report for <span class="entity">lib/readable_streambuffer.js</span></h1>
|
||||
<h2>
|
||||
Statements: <span class="metric">98.82% <small>(84 / 85)</small></span>
|
||||
Branches: <span class="metric">94.34% <small>(50 / 53)</small></span>
|
||||
Functions: <span class="metric">100% <small>(11 / 11)</small></span>
|
||||
Lines: <span class="metric">100% <small>(83 / 83)</small></span>
|
||||
Ignored: <span class="metric"><span class="ignore-none">none</span></span>
|
||||
</h2>
|
||||
<div class="path"><a href="../index.html">All files</a> » <a href="index.html">lib/</a> » readable_streambuffer.js</div>
|
||||
</div>
|
||||
<div class="body">
|
||||
<pre><table class="coverage">
|
||||
<tr><td class="line-count">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
|
||||
61
|
||||
62
|
||||
63
|
||||
64
|
||||
65
|
||||
66
|
||||
67
|
||||
68
|
||||
69
|
||||
70
|
||||
71
|
||||
72
|
||||
73
|
||||
74
|
||||
75
|
||||
76
|
||||
77
|
||||
78
|
||||
79
|
||||
80
|
||||
81
|
||||
82
|
||||
83
|
||||
84
|
||||
85
|
||||
86
|
||||
87
|
||||
88
|
||||
89
|
||||
90
|
||||
91
|
||||
92
|
||||
93
|
||||
94
|
||||
95
|
||||
96
|
||||
97
|
||||
98
|
||||
99
|
||||
100
|
||||
101
|
||||
102
|
||||
103
|
||||
104
|
||||
105
|
||||
106
|
||||
107
|
||||
108
|
||||
109
|
||||
110
|
||||
111
|
||||
112
|
||||
113
|
||||
114
|
||||
115
|
||||
116
|
||||
117
|
||||
118
|
||||
119
|
||||
120
|
||||
121
|
||||
122
|
||||
123
|
||||
124
|
||||
125
|
||||
126
|
||||
127
|
||||
128
|
||||
129
|
||||
130
|
||||
131
|
||||
132
|
||||
133
|
||||
134
|
||||
135
|
||||
136
|
||||
137</td><td class="line-coverage"><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-yes">1</span>
|
||||
<span class="cline-any cline-yes">12</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">12</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">12</span>
|
||||
<span class="cline-any cline-yes">12</span>
|
||||
<span class="cline-any cline-yes">12</span>
|
||||
<span class="cline-any cline-yes">12</span>
|
||||
<span class="cline-any cline-yes">12</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">12</span>
|
||||
<span class="cline-any cline-yes">12</span>
|
||||
<span class="cline-any cline-yes">12</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">12</span>
|
||||
<span class="cline-any cline-yes">12</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">12</span>
|
||||
<span class="cline-any cline-yes">268</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">268</span>
|
||||
<span class="cline-any cline-yes">44</span>
|
||||
<span class="cline-any cline-yes">44</span>
|
||||
<span class="cline-any cline-yes">9</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">35</span>
|
||||
<span class="cline-any cline-yes">35</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">44</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">44</span>
|
||||
<span class="cline-any cline-yes">44</span>
|
||||
<span class="cline-any cline-yes">44</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">268</span>
|
||||
<span class="cline-any cline-yes">7</span>
|
||||
<span class="cline-any cline-yes">7</span>
|
||||
<span class="cline-any cline-yes">7</span>
|
||||
<span class="cline-any cline-yes">6</span>
|
||||
<span class="cline-any cline-yes">6</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">12</span>
|
||||
<span class="cline-any cline-yes">3</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">12</span>
|
||||
<span class="cline-any cline-yes">5</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">12</span>
|
||||
<span class="cline-any cline-yes">13</span>
|
||||
<span class="cline-any cline-yes">2</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">2</span>
|
||||
<span class="cline-any cline-yes">2</span>
|
||||
<span class="cline-any cline-yes">2</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">12</span>
|
||||
<span class="cline-any cline-yes">13</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">13</span>
|
||||
<span class="cline-any cline-yes">13</span>
|
||||
<span class="cline-any cline-yes">4</span>
|
||||
<span class="cline-any cline-yes">4</span>
|
||||
<span class="cline-any cline-yes">4</span>
|
||||
<span class="cline-any cline-neutral"> </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-yes">9</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-neutral"> </span>
|
||||
<span class="cline-any cline-yes">13</span>
|
||||
<span class="cline-any cline-yes">12</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">13</span>
|
||||
<span class="cline-any cline-yes">2</span>
|
||||
<span class="cline-any cline-yes">3</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">12</span>
|
||||
<span class="cline-any cline-yes">4</span>
|
||||
<span class="cline-any cline-yes">4</span>
|
||||
<span class="cline-any cline-yes">4</span>
|
||||
<span class="cline-any cline-yes">4</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">12</span>
|
||||
<span class="cline-any cline-yes">15</span>
|
||||
<span class="cline-any cline-yes">15</span>
|
||||
<span class="cline-any cline-yes">14</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">12</span>
|
||||
<span class="cline-any cline-yes">6</span>
|
||||
<span class="cline-any cline-yes">6</span>
|
||||
<span class="cline-any cline-yes">6</span>
|
||||
<span class="cline-any cline-yes">6</span>
|
||||
<span class="cline-any cline-yes">6</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">12</span>
|
||||
<span class="cline-any cline-yes">7</span>
|
||||
<span class="cline-any cline-yes">7</span>
|
||||
<span class="cline-any cline-yes">1</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-yes">12</span>
|
||||
<span class="cline-any cline-yes">5</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">12</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">1</span>
|
||||
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">var stream = require("stream"),
|
||||
constants = require("./constants"),
|
||||
util = require("util");
|
||||
|
||||
var ReadableStreamBuffer = module.exports = function(opts) {
|
||||
var that = this;
|
||||
|
||||
stream.Stream.call(this);
|
||||
|
||||
opts = opts || {};
|
||||
var frequency = opts.hasOwnProperty("frequency") ? opts.frequency : constants.DEFAULT_FREQUENCY;
|
||||
var chunkSize = opts.chunkSize || constants.DEFAULT_CHUNK_SIZE;
|
||||
var initialSize = opts.initialSize || constants.DEFAULT_INITIAL_SIZE;
|
||||
var incrementAmount = opts.incrementAmount || constants.DEFAULT_INCREMENT_AMOUNT;
|
||||
|
||||
var size = 0;
|
||||
var buffer = new Buffer(initialSize);
|
||||
var encoding = null;
|
||||
|
||||
this.readable = true;
|
||||
this.writable = false;
|
||||
|
||||
var sendData = function() {
|
||||
var amount = Math.min(chunkSize, size);
|
||||
|
||||
if (amount > 0) {
|
||||
var chunk = null;
|
||||
if(encoding) {
|
||||
chunk = buffer.toString(encoding, 0, amount);
|
||||
}
|
||||
else {
|
||||
chunk = new Buffer(amount);
|
||||
buffer.copy(chunk, 0, 0, amount);
|
||||
}
|
||||
|
||||
that.emit("data", chunk);
|
||||
|
||||
<span class="missing-if-branch" title="else path not taken" >E</span>if(amount < buffer.length)
|
||||
buffer.copy(buffer, 0, amount, size);
|
||||
size -= amount;
|
||||
}
|
||||
|
||||
if(size === 0 && !that.readable) {
|
||||
that.emit("end");
|
||||
that.emit("close");
|
||||
if (sendData && sendData.interval) {
|
||||
clearInterval(sendData.interval);
|
||||
sendData.interval = null;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
this.size = function() {
|
||||
return size;
|
||||
};
|
||||
|
||||
this.maxSize = function() {
|
||||
return buffer.length;
|
||||
};
|
||||
|
||||
var increaseBufferIfNecessary = function(incomingDataSize) {
|
||||
if((buffer.length - size) < incomingDataSize) {
|
||||
var factor = Math.ceil((incomingDataSize - (buffer.length - size)) / incrementAmount);
|
||||
|
||||
var newBuffer = new Buffer(buffer.length + (incrementAmount * factor));
|
||||
buffer.copy(newBuffer, 0, 0, size);
|
||||
buffer = newBuffer;
|
||||
}
|
||||
};
|
||||
|
||||
this.put = function(data, encoding) {
|
||||
<span class="missing-if-branch" title="if path not taken" >I</span>if(!that.readable) <span class="cstat-no" title="statement not covered" >return;</span>
|
||||
|
||||
var wasEmpty = size === 0;
|
||||
if(Buffer.isBuffer(data)) {
|
||||
increaseBufferIfNecessary(data.length);
|
||||
data.copy(buffer, size, 0);
|
||||
size += data.length;
|
||||
}
|
||||
else {
|
||||
data = data + "";
|
||||
var dataSizeInBytes = Buffer.byteLength(data);
|
||||
increaseBufferIfNecessary(dataSizeInBytes);
|
||||
buffer.write(data, size, encoding || "utf8");
|
||||
size += dataSizeInBytes;
|
||||
}
|
||||
|
||||
if (wasEmpty && size > 0) {
|
||||
this.emit('readable')
|
||||
}
|
||||
|
||||
if (!this.isPaused && !frequency) {
|
||||
while (size > 0) {
|
||||
sendData();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
this.pause = function() {
|
||||
this.isPaused = true;
|
||||
<span class="missing-if-branch" title="else path not taken" >E</span>if(sendData && sendData.interval) {
|
||||
clearInterval(sendData.interval);
|
||||
delete sendData.interval;
|
||||
}
|
||||
};
|
||||
|
||||
this.resume = function() {
|
||||
this.isPaused = false;
|
||||
if(sendData && !sendData.interval && frequency > 0) {
|
||||
sendData.interval = setInterval(sendData, frequency);
|
||||
}
|
||||
};
|
||||
|
||||
this.destroy = function() {
|
||||
that.emit("end");
|
||||
if(sendData.interval) clearInterval(sendData.interval);
|
||||
sendData = null;
|
||||
that.readable = false;
|
||||
that.emit("close");
|
||||
};
|
||||
|
||||
this.destroySoon = function() {
|
||||
that.readable = false;
|
||||
if (!sendData.interval) {
|
||||
that.emit("end");
|
||||
that.emit("close");
|
||||
}
|
||||
};
|
||||
|
||||
this.setEncoding = function(_encoding) {
|
||||
encoding = _encoding;
|
||||
};
|
||||
|
||||
this.resume();
|
||||
};
|
||||
util.inherits(ReadableStreamBuffer, stream.Stream);
|
||||
</pre></td></tr>
|
||||
</table></pre>
|
||||
|
||||
</div>
|
||||
<div class="footer">
|
||||
<div class="meta">Generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Wed Jul 01 2015 04:16:19 GMT+0000 (UTC)</div>
|
||||
</div>
|
||||
<script src="../prettify.js"></script>
|
||||
<script>
|
||||
window.onload = function () {
|
||||
if (typeof prettyPrint === 'function') {
|
||||
prettyPrint();
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<script src="../sorter.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
54
node_modules/stream-buffers/coverage/lcov-report/lib/streambuffer.js.html
generated
vendored
Normal file
54
node_modules/stream-buffers/coverage/lcov-report/lib/streambuffer.js.html
generated
vendored
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Code coverage report for lib/streambuffer.js</title>
|
||||
<meta charset="utf-8">
|
||||
<link rel="stylesheet" href="../prettify.css">
|
||||
<link rel="stylesheet" href="../base.css">
|
||||
<style type='text/css'>
|
||||
div.coverage-summary .sorter {
|
||||
background-image: url(../sort-arrow-sprite.png);
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="header high">
|
||||
<h1>Code coverage report for <span class="entity">lib/streambuffer.js</span></h1>
|
||||
<h2>
|
||||
Statements: <span class="metric">100% <small>(3 / 3)</small></span>
|
||||
Branches: <span class="metric">100% <small>(0 / 0)</small></span>
|
||||
Functions: <span class="metric">100% <small>(0 / 0)</small></span>
|
||||
Lines: <span class="metric">100% <small>(3 / 3)</small></span>
|
||||
Ignored: <span class="metric"><span class="ignore-none">none</span></span>
|
||||
</h2>
|
||||
<div class="path"><a href="../index.html">All files</a> » <a href="index.html">lib/</a> » streambuffer.js</div>
|
||||
</div>
|
||||
<div class="body">
|
||||
<pre><table class="coverage">
|
||||
<tr><td class="line-count">1
|
||||
2
|
||||
3
|
||||
4</td><td class="line-coverage"><span class="cline-any cline-yes">1</span>
|
||||
<span class="cline-any cline-yes">1</span>
|
||||
<span class="cline-any cline-yes">1</span>
|
||||
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">module.exports = require("./constants");
|
||||
module.exports.ReadableStreamBuffer = require("./readable_streambuffer");
|
||||
module.exports.WritableStreamBuffer = require("./writable_streambuffer");
|
||||
</pre></td></tr>
|
||||
</table></pre>
|
||||
|
||||
</div>
|
||||
<div class="footer">
|
||||
<div class="meta">Generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Wed Jul 01 2015 04:16:19 GMT+0000 (UTC)</div>
|
||||
</div>
|
||||
<script src="../prettify.js"></script>
|
||||
<script>
|
||||
window.onload = function () {
|
||||
if (typeof prettyPrint === 'function') {
|
||||
prettyPrint();
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<script src="../sorter.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
336
node_modules/stream-buffers/coverage/lcov-report/lib/writable_streambuffer.js.html
generated
vendored
Normal file
336
node_modules/stream-buffers/coverage/lcov-report/lib/writable_streambuffer.js.html
generated
vendored
Normal file
|
|
@ -0,0 +1,336 @@
|
|||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Code coverage report for lib/writable_streambuffer.js</title>
|
||||
<meta charset="utf-8">
|
||||
<link rel="stylesheet" href="../prettify.css">
|
||||
<link rel="stylesheet" href="../base.css">
|
||||
<style type='text/css'>
|
||||
div.coverage-summary .sorter {
|
||||
background-image: url(../sort-arrow-sprite.png);
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="header high">
|
||||
<h1>Code coverage report for <span class="entity">lib/writable_streambuffer.js</span></h1>
|
||||
<h2>
|
||||
Statements: <span class="metric">96.77% <small>(60 / 62)</small></span>
|
||||
Branches: <span class="metric">90.63% <small>(29 / 32)</small></span>
|
||||
Functions: <span class="metric">100% <small>(9 / 9)</small></span>
|
||||
Lines: <span class="metric">98.25% <small>(56 / 57)</small></span>
|
||||
Ignored: <span class="metric"><span class="ignore-none">none</span></span>
|
||||
</h2>
|
||||
<div class="path"><a href="../index.html">All files</a> » <a href="index.html">lib/</a> » writable_streambuffer.js</div>
|
||||
</div>
|
||||
<div class="body">
|
||||
<pre><table class="coverage">
|
||||
<tr><td class="line-count">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
|
||||
61
|
||||
62
|
||||
63
|
||||
64
|
||||
65
|
||||
66
|
||||
67
|
||||
68
|
||||
69
|
||||
70
|
||||
71
|
||||
72
|
||||
73
|
||||
74
|
||||
75
|
||||
76
|
||||
77
|
||||
78
|
||||
79
|
||||
80
|
||||
81
|
||||
82
|
||||
83
|
||||
84
|
||||
85
|
||||
86
|
||||
87
|
||||
88
|
||||
89
|
||||
90
|
||||
91
|
||||
92
|
||||
93
|
||||
94
|
||||
95
|
||||
96
|
||||
97
|
||||
98</td><td class="line-coverage"><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-yes">1</span>
|
||||
<span class="cline-any cline-yes">10</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">10</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">10</span>
|
||||
<span class="cline-any cline-yes">10</span>
|
||||
<span class="cline-any cline-yes">10</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">10</span>
|
||||
<span class="cline-any cline-yes">10</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">10</span>
|
||||
<span class="cline-any cline-yes">10</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">10</span>
|
||||
<span class="cline-any cline-yes">5</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">10</span>
|
||||
<span class="cline-any cline-yes">5</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">10</span>
|
||||
<span class="cline-any cline-yes">2</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">1</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-no"> </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-yes">10</span>
|
||||
<span class="cline-any cline-yes">8</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">7</span>
|
||||
<span class="cline-any cline-yes">7</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">7</span>
|
||||
<span class="cline-any cline-yes">1</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">7</span>
|
||||
<span class="cline-any cline-yes">7</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">10</span>
|
||||
<span class="cline-any cline-yes">10</span>
|
||||
<span class="cline-any cline-yes">2</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">2</span>
|
||||
<span class="cline-any cline-yes">2</span>
|
||||
<span class="cline-any cline-yes">2</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">10</span>
|
||||
<span class="cline-any cline-yes">11</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">10</span>
|
||||
<span class="cline-any cline-yes">2</span>
|
||||
<span class="cline-any cline-yes">2</span>
|
||||
<span class="cline-any cline-yes">2</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">8</span>
|
||||
<span class="cline-any cline-yes">8</span>
|
||||
<span class="cline-any cline-yes">8</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">10</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">10</span>
|
||||
<span class="cline-any cline-yes">1</span>
|
||||
<span class="cline-any cline-yes">1</span>
|
||||
<span class="cline-any cline-yes">1</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-yes">10</span>
|
||||
<span class="cline-any cline-yes">4</span>
|
||||
<span class="cline-any cline-yes">4</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-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">var util = require("util"),
|
||||
stream = require("stream"),
|
||||
constants = require("./constants");
|
||||
|
||||
// TODO: clear up specs on returning false from a write and emitting a drain event.
|
||||
// Does this mean if I return false from a write, I should ignore any write requests between that false return and the drain event?
|
||||
var WritableStreamBuffer = module.exports = function(opts) {
|
||||
var that = this;
|
||||
|
||||
stream.Stream.call(this);
|
||||
|
||||
opts = opts || {};
|
||||
var initialSize = opts.initialSize || constants.DEFAULT_INITIAL_SIZE;
|
||||
var incrementAmount = opts.incrementAmount || constants.DEFAULT_INCREMENT_AMOUNT;
|
||||
|
||||
var buffer = new Buffer(initialSize);
|
||||
var size = 0;
|
||||
|
||||
this.writable = true;
|
||||
this.readable = false;
|
||||
|
||||
this.size = function() {
|
||||
return size;
|
||||
};
|
||||
|
||||
this.maxSize = function() {
|
||||
return buffer.length;
|
||||
};
|
||||
|
||||
this.getContents = function(length) {
|
||||
if(!size) return false;
|
||||
|
||||
var data = new Buffer(Math.min(length || size, size));
|
||||
buffer.copy(data, 0, 0, data.length);
|
||||
|
||||
<span class="missing-if-branch" title="if path not taken" >I</span>if(data.length < size)
|
||||
<span class="cstat-no" title="statement not covered" > buffer.copy(buffer, 0, data.length);</span>
|
||||
|
||||
size -= data.length;
|
||||
|
||||
return data;
|
||||
};
|
||||
|
||||
this.getContentsAsString = function(encoding, length) {
|
||||
if(!size) return false;
|
||||
|
||||
var data = buffer.toString(encoding || "utf8", 0, Math.min(length || size, size));
|
||||
var dataLength = Buffer.byteLength(data);
|
||||
|
||||
if(dataLength < size)
|
||||
buffer.copy(buffer, 0, dataLength);
|
||||
|
||||
size -= dataLength;
|
||||
return data;
|
||||
};
|
||||
|
||||
var increaseBufferIfNecessary = function(incomingDataSize) {
|
||||
if((buffer.length - size) < incomingDataSize) {
|
||||
var factor = Math.ceil((incomingDataSize - (buffer.length - size)) / incrementAmount);
|
||||
|
||||
var newBuffer = new Buffer(buffer.length + (incrementAmount * factor));
|
||||
buffer.copy(newBuffer, 0, 0, size);
|
||||
buffer = newBuffer;
|
||||
}
|
||||
};
|
||||
|
||||
this.write = function(data, encoding, callback) {
|
||||
if(!that.writable) return;
|
||||
|
||||
if(Buffer.isBuffer(data)) {
|
||||
increaseBufferIfNecessary(data.length);
|
||||
data.copy(buffer, size, 0);
|
||||
size += data.length;
|
||||
}
|
||||
else {
|
||||
data = data + "";
|
||||
increaseBufferIfNecessary(Buffer.byteLength(data));
|
||||
buffer.write(data, size, encoding || "utf8");
|
||||
size += Buffer.byteLength(data);
|
||||
}
|
||||
|
||||
<span class="missing-if-branch" title="if path not taken" >I</span>if(typeof callback === "function") { <span class="cstat-no" title="statement not covered" >callback() ;}</span>
|
||||
};
|
||||
|
||||
this.end = function() {
|
||||
var args = Array.prototype.slice.apply(arguments);
|
||||
<span class="missing-if-branch" title="else path not taken" >E</span>if(args.length) that.write.apply(that, args);
|
||||
that.emit('finish');
|
||||
that.destroy();
|
||||
};
|
||||
|
||||
this.destroySoon = this.destroy = function() {
|
||||
that.writable = false;
|
||||
that.emit("close");
|
||||
};
|
||||
};
|
||||
util.inherits(WritableStreamBuffer, stream.Stream);
|
||||
</pre></td></tr>
|
||||
</table></pre>
|
||||
|
||||
</div>
|
||||
<div class="footer">
|
||||
<div class="meta">Generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Wed Jul 01 2015 04:16:19 GMT+0000 (UTC)</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/stream-buffers/coverage/lcov-report/prettify.css
generated
vendored
Normal file
1
node_modules/stream-buffers/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/stream-buffers/coverage/lcov-report/prettify.js
generated
vendored
Normal file
1
node_modules/stream-buffers/coverage/lcov-report/prettify.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
BIN
node_modules/stream-buffers/coverage/lcov-report/sort-arrow-sprite.png
generated
vendored
Normal file
BIN
node_modules/stream-buffers/coverage/lcov-report/sort-arrow-sprite.png
generated
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 209 B |
156
node_modules/stream-buffers/coverage/lcov-report/sorter.js
generated
vendored
Normal file
156
node_modules/stream-buffers/coverage/lcov-report/sorter.js
generated
vendored
Normal file
|
|
@ -0,0 +1,156 @@
|
|||
var addSorting = (function () {
|
||||
"use strict";
|
||||
var cols,
|
||||
currentSort = {
|
||||
index: 0,
|
||||
desc: false
|
||||
};
|
||||
|
||||
// returns the summary table element
|
||||
function getTable() { return document.querySelector('.coverage-summary table'); }
|
||||
// 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) {
|
||||
el = getNthColumn(i).querySelector('.sorter');
|
||||
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);
|
||||
305
node_modules/stream-buffers/coverage/lcov.info
generated
vendored
Normal file
305
node_modules/stream-buffers/coverage/lcov.info
generated
vendored
Normal file
|
|
@ -0,0 +1,305 @@
|
|||
TN:
|
||||
SF:/home/travis/build/samcday/node-stream-buffer/lib/streambuffer.js
|
||||
FNF:0
|
||||
FNH:0
|
||||
DA:1,1
|
||||
DA:2,1
|
||||
DA:3,1
|
||||
LF:3
|
||||
LH:3
|
||||
BRF:0
|
||||
BRH:0
|
||||
end_of_record
|
||||
TN:
|
||||
SF:/home/travis/build/samcday/node-stream-buffer/lib/constants.js
|
||||
FNF:0
|
||||
FNH:0
|
||||
DA:1,1
|
||||
LF:1
|
||||
LH:1
|
||||
BRF:0
|
||||
BRH:0
|
||||
end_of_record
|
||||
TN:
|
||||
SF:/home/travis/build/samcday/node-stream-buffer/lib/readable_streambuffer.js
|
||||
FN:5,(anonymous_1)
|
||||
FN:23,(anonymous_2)
|
||||
FN:53,(anonymous_3)
|
||||
FN:57,(anonymous_4)
|
||||
FN:61,(anonymous_5)
|
||||
FN:71,(anonymous_6)
|
||||
FN:99,(anonymous_7)
|
||||
FN:107,(anonymous_8)
|
||||
FN:114,(anonymous_9)
|
||||
FN:122,(anonymous_10)
|
||||
FN:130,(anonymous_11)
|
||||
FNF:11
|
||||
FNH:11
|
||||
FNDA:12,(anonymous_1)
|
||||
FNDA:268,(anonymous_2)
|
||||
FNDA:3,(anonymous_3)
|
||||
FNDA:5,(anonymous_4)
|
||||
FNDA:13,(anonymous_5)
|
||||
FNDA:13,(anonymous_6)
|
||||
FNDA:4,(anonymous_7)
|
||||
FNDA:15,(anonymous_8)
|
||||
FNDA:6,(anonymous_9)
|
||||
FNDA:7,(anonymous_10)
|
||||
FNDA:5,(anonymous_11)
|
||||
DA:1,1
|
||||
DA:5,1
|
||||
DA:6,12
|
||||
DA:8,12
|
||||
DA:10,12
|
||||
DA:11,12
|
||||
DA:12,12
|
||||
DA:13,12
|
||||
DA:14,12
|
||||
DA:16,12
|
||||
DA:17,12
|
||||
DA:18,12
|
||||
DA:20,12
|
||||
DA:21,12
|
||||
DA:23,12
|
||||
DA:24,268
|
||||
DA:26,268
|
||||
DA:27,44
|
||||
DA:28,44
|
||||
DA:29,9
|
||||
DA:32,35
|
||||
DA:33,35
|
||||
DA:36,44
|
||||
DA:38,44
|
||||
DA:39,44
|
||||
DA:40,44
|
||||
DA:43,268
|
||||
DA:44,7
|
||||
DA:45,7
|
||||
DA:46,7
|
||||
DA:47,6
|
||||
DA:48,6
|
||||
DA:53,12
|
||||
DA:54,3
|
||||
DA:57,12
|
||||
DA:58,5
|
||||
DA:61,12
|
||||
DA:62,13
|
||||
DA:63,2
|
||||
DA:65,2
|
||||
DA:66,2
|
||||
DA:67,2
|
||||
DA:71,12
|
||||
DA:72,13
|
||||
DA:74,13
|
||||
DA:75,13
|
||||
DA:76,4
|
||||
DA:77,4
|
||||
DA:78,4
|
||||
DA:81,9
|
||||
DA:82,9
|
||||
DA:83,9
|
||||
DA:84,9
|
||||
DA:85,9
|
||||
DA:88,13
|
||||
DA:89,12
|
||||
DA:92,13
|
||||
DA:93,2
|
||||
DA:94,3
|
||||
DA:99,12
|
||||
DA:100,4
|
||||
DA:101,4
|
||||
DA:102,4
|
||||
DA:103,4
|
||||
DA:107,12
|
||||
DA:108,15
|
||||
DA:109,15
|
||||
DA:110,14
|
||||
DA:114,12
|
||||
DA:115,6
|
||||
DA:116,6
|
||||
DA:117,6
|
||||
DA:118,6
|
||||
DA:119,6
|
||||
DA:122,12
|
||||
DA:123,7
|
||||
DA:124,7
|
||||
DA:125,1
|
||||
DA:126,1
|
||||
DA:130,12
|
||||
DA:131,5
|
||||
DA:134,12
|
||||
DA:136,1
|
||||
LF:83
|
||||
LH:83
|
||||
BRDA:10,1,0,12
|
||||
BRDA:10,1,1,6
|
||||
BRDA:11,2,0,2
|
||||
BRDA:11,2,1,10
|
||||
BRDA:12,3,0,12
|
||||
BRDA:12,3,1,8
|
||||
BRDA:13,4,0,12
|
||||
BRDA:13,4,1,10
|
||||
BRDA:14,5,0,12
|
||||
BRDA:14,5,1,11
|
||||
BRDA:26,6,0,44
|
||||
BRDA:26,6,1,224
|
||||
BRDA:28,7,0,9
|
||||
BRDA:28,7,1,35
|
||||
BRDA:38,8,0,44
|
||||
BRDA:38,8,1,0
|
||||
BRDA:43,9,0,7
|
||||
BRDA:43,9,1,261
|
||||
BRDA:43,10,0,268
|
||||
BRDA:43,10,1,234
|
||||
BRDA:46,11,0,6
|
||||
BRDA:46,11,1,1
|
||||
BRDA:46,12,0,7
|
||||
BRDA:46,12,1,6
|
||||
BRDA:62,13,0,2
|
||||
BRDA:62,13,1,11
|
||||
BRDA:72,14,0,0
|
||||
BRDA:72,14,1,13
|
||||
BRDA:75,15,0,4
|
||||
BRDA:75,15,1,9
|
||||
BRDA:84,16,0,9
|
||||
BRDA:84,16,1,9
|
||||
BRDA:88,17,0,12
|
||||
BRDA:88,17,1,1
|
||||
BRDA:88,18,0,13
|
||||
BRDA:88,18,1,12
|
||||
BRDA:92,19,0,2
|
||||
BRDA:92,19,1,11
|
||||
BRDA:92,20,0,13
|
||||
BRDA:92,20,1,8
|
||||
BRDA:101,21,0,4
|
||||
BRDA:101,21,1,0
|
||||
BRDA:101,22,0,4
|
||||
BRDA:101,22,1,4
|
||||
BRDA:109,23,0,14
|
||||
BRDA:109,23,1,1
|
||||
BRDA:109,24,0,15
|
||||
BRDA:109,24,1,15
|
||||
BRDA:109,24,2,15
|
||||
BRDA:116,25,0,4
|
||||
BRDA:116,25,1,2
|
||||
BRDA:124,26,0,1
|
||||
BRDA:124,26,1,6
|
||||
BRF:53
|
||||
BRH:50
|
||||
end_of_record
|
||||
TN:
|
||||
SF:/home/travis/build/samcday/node-stream-buffer/lib/writable_streambuffer.js
|
||||
FN:7,(anonymous_1)
|
||||
FN:22,(anonymous_2)
|
||||
FN:26,(anonymous_3)
|
||||
FN:30,(anonymous_4)
|
||||
FN:44,(anonymous_5)
|
||||
FN:57,(anonymous_6)
|
||||
FN:67,(anonymous_7)
|
||||
FN:85,(anonymous_8)
|
||||
FN:92,(anonymous_9)
|
||||
FNF:9
|
||||
FNH:9
|
||||
FNDA:10,(anonymous_1)
|
||||
FNDA:5,(anonymous_2)
|
||||
FNDA:5,(anonymous_3)
|
||||
FNDA:2,(anonymous_4)
|
||||
FNDA:8,(anonymous_5)
|
||||
FNDA:10,(anonymous_6)
|
||||
FNDA:11,(anonymous_7)
|
||||
FNDA:1,(anonymous_8)
|
||||
FNDA:4,(anonymous_9)
|
||||
DA:1,1
|
||||
DA:7,1
|
||||
DA:8,10
|
||||
DA:10,10
|
||||
DA:12,10
|
||||
DA:13,10
|
||||
DA:14,10
|
||||
DA:16,10
|
||||
DA:17,10
|
||||
DA:19,10
|
||||
DA:20,10
|
||||
DA:22,10
|
||||
DA:23,5
|
||||
DA:26,10
|
||||
DA:27,5
|
||||
DA:30,10
|
||||
DA:31,2
|
||||
DA:33,1
|
||||
DA:34,1
|
||||
DA:36,1
|
||||
DA:37,0
|
||||
DA:39,1
|
||||
DA:41,1
|
||||
DA:44,10
|
||||
DA:45,8
|
||||
DA:47,7
|
||||
DA:48,7
|
||||
DA:50,7
|
||||
DA:51,1
|
||||
DA:53,7
|
||||
DA:54,7
|
||||
DA:57,10
|
||||
DA:58,10
|
||||
DA:59,2
|
||||
DA:61,2
|
||||
DA:62,2
|
||||
DA:63,2
|
||||
DA:67,10
|
||||
DA:68,11
|
||||
DA:70,10
|
||||
DA:71,2
|
||||
DA:72,2
|
||||
DA:73,2
|
||||
DA:76,8
|
||||
DA:77,8
|
||||
DA:78,8
|
||||
DA:79,8
|
||||
DA:82,10
|
||||
DA:85,10
|
||||
DA:86,1
|
||||
DA:87,1
|
||||
DA:88,1
|
||||
DA:89,1
|
||||
DA:92,10
|
||||
DA:93,4
|
||||
DA:94,4
|
||||
DA:97,1
|
||||
LF:57
|
||||
LH:56
|
||||
BRDA:12,1,0,10
|
||||
BRDA:12,1,1,9
|
||||
BRDA:13,2,0,10
|
||||
BRDA:13,2,1,9
|
||||
BRDA:14,3,0,10
|
||||
BRDA:14,3,1,9
|
||||
BRDA:31,4,0,1
|
||||
BRDA:31,4,1,1
|
||||
BRDA:33,5,0,1
|
||||
BRDA:33,5,1,1
|
||||
BRDA:36,6,0,0
|
||||
BRDA:36,6,1,1
|
||||
BRDA:45,7,0,1
|
||||
BRDA:45,7,1,7
|
||||
BRDA:47,8,0,7
|
||||
BRDA:47,8,1,5
|
||||
BRDA:47,9,0,7
|
||||
BRDA:47,9,1,5
|
||||
BRDA:50,10,0,1
|
||||
BRDA:50,10,1,6
|
||||
BRDA:58,11,0,2
|
||||
BRDA:58,11,1,8
|
||||
BRDA:68,12,0,1
|
||||
BRDA:68,12,1,10
|
||||
BRDA:70,13,0,2
|
||||
BRDA:70,13,1,8
|
||||
BRDA:78,14,0,8
|
||||
BRDA:78,14,1,8
|
||||
BRDA:82,15,0,0
|
||||
BRDA:82,15,1,10
|
||||
BRDA:87,16,0,1
|
||||
BRDA:87,16,1,0
|
||||
BRF:32
|
||||
BRH:29
|
||||
end_of_record
|
||||
6
node_modules/stream-buffers/lib/constants.js
generated
vendored
Normal file
6
node_modules/stream-buffers/lib/constants.js
generated
vendored
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
module.exports = {
|
||||
DEFAULT_INITIAL_SIZE: (8 * 1024),
|
||||
DEFAULT_INCREMENT_AMOUNT: (8 * 1024),
|
||||
DEFAULT_FREQUENCY: 1,
|
||||
DEFAULT_CHUNK_SIZE: 1024
|
||||
};
|
||||
136
node_modules/stream-buffers/lib/readable_streambuffer.js
generated
vendored
Normal file
136
node_modules/stream-buffers/lib/readable_streambuffer.js
generated
vendored
Normal file
|
|
@ -0,0 +1,136 @@
|
|||
var stream = require("stream"),
|
||||
constants = require("./constants"),
|
||||
util = require("util");
|
||||
|
||||
var ReadableStreamBuffer = module.exports = function(opts) {
|
||||
var that = this;
|
||||
|
||||
stream.Stream.call(this);
|
||||
|
||||
opts = opts || {};
|
||||
var frequency = opts.hasOwnProperty("frequency") ? opts.frequency : constants.DEFAULT_FREQUENCY;
|
||||
var chunkSize = opts.chunkSize || constants.DEFAULT_CHUNK_SIZE;
|
||||
var initialSize = opts.initialSize || constants.DEFAULT_INITIAL_SIZE;
|
||||
var incrementAmount = opts.incrementAmount || constants.DEFAULT_INCREMENT_AMOUNT;
|
||||
|
||||
var size = 0;
|
||||
var buffer = new Buffer(initialSize);
|
||||
var encoding = null;
|
||||
|
||||
this.readable = true;
|
||||
this.writable = false;
|
||||
|
||||
var sendData = function() {
|
||||
var amount = Math.min(chunkSize, size);
|
||||
|
||||
if (amount > 0) {
|
||||
var chunk = null;
|
||||
if(encoding) {
|
||||
chunk = buffer.toString(encoding, 0, amount);
|
||||
}
|
||||
else {
|
||||
chunk = new Buffer(amount);
|
||||
buffer.copy(chunk, 0, 0, amount);
|
||||
}
|
||||
|
||||
that.emit("data", chunk);
|
||||
|
||||
if(amount < buffer.length)
|
||||
buffer.copy(buffer, 0, amount, size);
|
||||
size -= amount;
|
||||
}
|
||||
|
||||
if(size === 0 && !that.readable) {
|
||||
that.emit("end");
|
||||
that.emit("close");
|
||||
if (sendData && sendData.interval) {
|
||||
clearInterval(sendData.interval);
|
||||
sendData.interval = null;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
this.size = function() {
|
||||
return size;
|
||||
};
|
||||
|
||||
this.maxSize = function() {
|
||||
return buffer.length;
|
||||
};
|
||||
|
||||
var increaseBufferIfNecessary = function(incomingDataSize) {
|
||||
if((buffer.length - size) < incomingDataSize) {
|
||||
var factor = Math.ceil((incomingDataSize - (buffer.length - size)) / incrementAmount);
|
||||
|
||||
var newBuffer = new Buffer(buffer.length + (incrementAmount * factor));
|
||||
buffer.copy(newBuffer, 0, 0, size);
|
||||
buffer = newBuffer;
|
||||
}
|
||||
};
|
||||
|
||||
this.put = function(data, encoding) {
|
||||
if(!that.readable) return;
|
||||
|
||||
var wasEmpty = size === 0;
|
||||
if(Buffer.isBuffer(data)) {
|
||||
increaseBufferIfNecessary(data.length);
|
||||
data.copy(buffer, size, 0);
|
||||
size += data.length;
|
||||
}
|
||||
else {
|
||||
data = data + "";
|
||||
var dataSizeInBytes = Buffer.byteLength(data);
|
||||
increaseBufferIfNecessary(dataSizeInBytes);
|
||||
buffer.write(data, size, encoding || "utf8");
|
||||
size += dataSizeInBytes;
|
||||
}
|
||||
|
||||
if (wasEmpty && size > 0) {
|
||||
this.emit('readable')
|
||||
}
|
||||
|
||||
if (!this.isPaused && !frequency) {
|
||||
while (size > 0) {
|
||||
sendData();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
this.pause = function() {
|
||||
this.isPaused = true;
|
||||
if(sendData && sendData.interval) {
|
||||
clearInterval(sendData.interval);
|
||||
delete sendData.interval;
|
||||
}
|
||||
};
|
||||
|
||||
this.resume = function() {
|
||||
this.isPaused = false;
|
||||
if(sendData && !sendData.interval && frequency > 0) {
|
||||
sendData.interval = setInterval(sendData, frequency);
|
||||
}
|
||||
};
|
||||
|
||||
this.destroy = function() {
|
||||
that.emit("end");
|
||||
if(sendData.interval) clearInterval(sendData.interval);
|
||||
sendData = null;
|
||||
that.readable = false;
|
||||
that.emit("close");
|
||||
};
|
||||
|
||||
this.destroySoon = function() {
|
||||
that.readable = false;
|
||||
if (!sendData.interval) {
|
||||
that.emit("end");
|
||||
that.emit("close");
|
||||
}
|
||||
};
|
||||
|
||||
this.setEncoding = function(_encoding) {
|
||||
encoding = _encoding;
|
||||
};
|
||||
|
||||
this.resume();
|
||||
};
|
||||
util.inherits(ReadableStreamBuffer, stream.Stream);
|
||||
3
node_modules/stream-buffers/lib/streambuffer.js
generated
vendored
Normal file
3
node_modules/stream-buffers/lib/streambuffer.js
generated
vendored
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
module.exports = require("./constants");
|
||||
module.exports.ReadableStreamBuffer = require("./readable_streambuffer");
|
||||
module.exports.WritableStreamBuffer = require("./writable_streambuffer");
|
||||
97
node_modules/stream-buffers/lib/writable_streambuffer.js
generated
vendored
Normal file
97
node_modules/stream-buffers/lib/writable_streambuffer.js
generated
vendored
Normal file
|
|
@ -0,0 +1,97 @@
|
|||
var util = require("util"),
|
||||
stream = require("stream"),
|
||||
constants = require("./constants");
|
||||
|
||||
// TODO: clear up specs on returning false from a write and emitting a drain event.
|
||||
// Does this mean if I return false from a write, I should ignore any write requests between that false return and the drain event?
|
||||
var WritableStreamBuffer = module.exports = function(opts) {
|
||||
var that = this;
|
||||
|
||||
stream.Stream.call(this);
|
||||
|
||||
opts = opts || {};
|
||||
var initialSize = opts.initialSize || constants.DEFAULT_INITIAL_SIZE;
|
||||
var incrementAmount = opts.incrementAmount || constants.DEFAULT_INCREMENT_AMOUNT;
|
||||
|
||||
var buffer = new Buffer(initialSize);
|
||||
var size = 0;
|
||||
|
||||
this.writable = true;
|
||||
this.readable = false;
|
||||
|
||||
this.size = function() {
|
||||
return size;
|
||||
};
|
||||
|
||||
this.maxSize = function() {
|
||||
return buffer.length;
|
||||
};
|
||||
|
||||
this.getContents = function(length) {
|
||||
if(!size) return false;
|
||||
|
||||
var data = new Buffer(Math.min(length || size, size));
|
||||
buffer.copy(data, 0, 0, data.length);
|
||||
|
||||
if(data.length < size)
|
||||
buffer.copy(buffer, 0, data.length);
|
||||
|
||||
size -= data.length;
|
||||
|
||||
return data;
|
||||
};
|
||||
|
||||
this.getContentsAsString = function(encoding, length) {
|
||||
if(!size) return false;
|
||||
|
||||
var data = buffer.toString(encoding || "utf8", 0, Math.min(length || size, size));
|
||||
var dataLength = Buffer.byteLength(data);
|
||||
|
||||
if(dataLength < size)
|
||||
buffer.copy(buffer, 0, dataLength);
|
||||
|
||||
size -= dataLength;
|
||||
return data;
|
||||
};
|
||||
|
||||
var increaseBufferIfNecessary = function(incomingDataSize) {
|
||||
if((buffer.length - size) < incomingDataSize) {
|
||||
var factor = Math.ceil((incomingDataSize - (buffer.length - size)) / incrementAmount);
|
||||
|
||||
var newBuffer = new Buffer(buffer.length + (incrementAmount * factor));
|
||||
buffer.copy(newBuffer, 0, 0, size);
|
||||
buffer = newBuffer;
|
||||
}
|
||||
};
|
||||
|
||||
this.write = function(data, encoding, callback) {
|
||||
if(!that.writable) return;
|
||||
|
||||
if(Buffer.isBuffer(data)) {
|
||||
increaseBufferIfNecessary(data.length);
|
||||
data.copy(buffer, size, 0);
|
||||
size += data.length;
|
||||
}
|
||||
else {
|
||||
data = data + "";
|
||||
increaseBufferIfNecessary(Buffer.byteLength(data));
|
||||
buffer.write(data, size, encoding || "utf8");
|
||||
size += Buffer.byteLength(data);
|
||||
}
|
||||
|
||||
if(typeof callback === "function") { callback() ;}
|
||||
};
|
||||
|
||||
this.end = function() {
|
||||
var args = Array.prototype.slice.apply(arguments);
|
||||
if(args.length) that.write.apply(that, args);
|
||||
that.emit('finish');
|
||||
that.destroy();
|
||||
};
|
||||
|
||||
this.destroySoon = this.destroy = function() {
|
||||
that.writable = false;
|
||||
that.emit("close");
|
||||
};
|
||||
};
|
||||
util.inherits(WritableStreamBuffer, stream.Stream);
|
||||
28
node_modules/stream-buffers/package.json
generated
vendored
Normal file
28
node_modules/stream-buffers/package.json
generated
vendored
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
{
|
||||
"name": "stream-buffers",
|
||||
"version": "2.2.0",
|
||||
"description": "Buffer-backed Streams for reading and writing.",
|
||||
"keywords": [
|
||||
"memory streams",
|
||||
"streams",
|
||||
"buffer streams"
|
||||
],
|
||||
"author": "Sam Day <me@samcday.com.au>",
|
||||
"main": "./lib/streambuffer.js",
|
||||
"engines": {
|
||||
"node": ">= 0.10.0"
|
||||
},
|
||||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"istanbul": "~0.3.2",
|
||||
"vows": ">= 0.5.6"
|
||||
},
|
||||
"license": "Unlicense",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/samcday/node-stream-buffer.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "[ -n \"$NO_COVERAGE\" ] && vows --spec || istanbul cover vows -- --spec"
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue