Socket
Socket
Sign inDemoInstall

final-stream

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

final-stream - npm Package Compare versions

Comparing version 1.0.0 to 1.0.2

test/testInvalidJsonFileToStream.json

8

index.js

@@ -26,3 +26,9 @@ const ErrorWithObject = require('error-with-object');

callback(null, bodyString && mutation ? mutation(bodyString) : bodyString);
let finalBody;
try {
finalBody = bodyString && mutation ? mutation(bodyString) : bodyString;
callback(null, finalBody);
} catch (error) {
callback(error);
}
})

@@ -29,0 +35,0 @@ .on('error', function (error) {

2

package.json
{
"name": "final-stream",
"version": "1.0.0",
"version": "1.0.2",
"description": "",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -1,2 +0,2 @@

# FinalStream
# Final Stream
[![Build Status](https://travis-ci.org/markwylde/final-stream.svg?branch=master)](https://travis-ci.org/markwylde/final-stream)

@@ -13,6 +13,6 @@ [![David DM](https://david-dm.org/markwylde/final-stream.svg)](https://david-dm.org/markwylde/final-stream)

```javascript
const finalStream = require('final-stream')
const finalStream = require('final-stream');
finalStream(response, function (error, result) {
console.log({error, result})
})
console.log({error, result});
});
```

@@ -22,6 +22,6 @@

```javascript
const finalStream = require('final-stream')
const finalStream = require('final-stream');
finalStream(response, JSON.parse, function (error, result) {
console.log({error, result})
})
console.log({error, result});
});
```

@@ -28,0 +28,0 @@

@@ -32,2 +32,12 @@ const test = require('tape');

test('basic stream with invalid json', t => {
t.plan(1);
const stream = fs.createReadStream('./test/testInvalidJsonFileToStream.json', { highWaterMark: 32 });
finalStream(stream, JSON.parse, function (error, result) {
t.ok(error.toString().includes('SyntaxError: Unexpected token } in JSON'));
});
});
test('with no stream object', t => {

@@ -34,0 +44,0 @@ t.plan(1);

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc