braid-http 0.3.16 → 0.3.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -362,7 +362,7 @@ var subscription_parser = (cb) => ({
362
362
  read (input) {
363
363
 
364
364
  // Store the new input!
365
- this.state.input.push(...input)
365
+ for (let x of input) this.state.input.push(x)
366
366
 
367
367
  // Now loop through the input and parse until we hit a dead end
368
368
  while (this.state.input.length) {
@@ -377,7 +377,7 @@ var subscription_parser = (cb) => ({
377
377
 
378
378
  // Maybe we parsed an update! That's cool!
379
379
  if (this.state.result === 'success') {
380
- this.cb({
380
+ var update = {
381
381
  version: this.state.version,
382
382
  parents: this.state.parents,
383
383
  body: this.state.body,
@@ -385,7 +385,10 @@ var subscription_parser = (cb) => ({
385
385
 
386
386
  // Output extra_headers if there are some
387
387
  extra_headers: extra_headers(this.state.headers)
388
- })
388
+ }
389
+ for (var k in update)
390
+ if (update[k] === undefined) delete update[k]
391
+ this.cb(update)
389
392
 
390
393
  // Reset the parser for the next version!
391
394
  this.state = {input: this.state.input}
@@ -123,7 +123,7 @@ function parse_update (req, cb) {
123
123
  req.on('data', function parse (chunk) {
124
124
 
125
125
  // Merge the latest chunk into our buffer
126
- buffer.push(...chunk)
126
+ for (let x of chunk) buffer.push(x)
127
127
 
128
128
  while (patches.length < num_patches) {
129
129
  let h = extractHeader(buffer)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "braid-http",
3
- "version": "0.3.16",
3
+ "version": "0.3.18",
4
4
  "description": "An implementation of Braid-HTTP for Node.js and Browsers",
5
5
  "scripts": {
6
6
  "test": "node test/server.js"