New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

machinepack-strings

Package Overview
Dependencies
Maintainers
2
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

machinepack-strings - npm Package Compare versions

Comparing version 6.0.0 to 6.0.1

33

lib/from-stream.js

@@ -49,3 +49,3 @@ module.exports = {

// references to them again below as we clean up.)
var $onReadable;
var $onData;
var $onEnd;

@@ -55,18 +55,27 @@ var $onError;

var data = '';
var dataSoFar = '';
var spun;
// Bind "readable", "end", and "error" listeners.
$onReadable = function () {
var chunk;
while (null !== (chunk = stream.read())) {
data += chunk;
}//∞
// Bind "data", "end", and "error" listeners.
$onData = function (chunk) {
// console.log('on("data")', arguments);
dataSoFar += chunk.toString();
// console.log('read chunk:', dataSoFar);
};//ƒ
stream.on('readable', $onReadable);
stream.on('data', $onData);
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// For some reason, we have to use the traditional streams1 approach here,
// for some streams anyway. It seems like the request module does not fully
// support the streams>=2 API as documented, as of mid-2017 and request@2.81 thru 2.83.
//
// For proof, try out:
// https://github.com/sailshq/machinepack-strings/commit/ca02704a1d5ae6ba168d988ee20972b5de6e7258
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
$onEnd = function () {
// console.log('end', arguments);
if (spun) { return; }
spun = true;
proceed(undefined, data);
proceed(undefined, dataSoFar);
};//ƒ

@@ -76,2 +85,3 @@ stream.on('end', $onEnd);

$onError = function(err) {
// console.log('error', err);
if (spun) { return; }

@@ -83,4 +93,5 @@ spun = true;

})(function(err, data) {
stream.removeListener('readable', $onReadable);
stream.removeListener('data', $onData);
stream.removeListener('end', $onEnd);

@@ -87,0 +98,0 @@ stream.removeListener('error', $onError);

{
"name": "machinepack-strings",
"version": "6.0.0",
"version": "6.0.1",
"description": "Work with strings.",

@@ -5,0 +5,0 @@ "scripts": {

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