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

as-buffer

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

as-buffer - npm Package Compare versions

Comparing version 1.4.1 to 1.4.2

13

index.js

@@ -1,4 +0,4 @@

const readAsBuffer = (s, maxsize=1e7) =>
const readAsBuffer = (s, maxsize = 1e7) =>
new Promise((resolve, reject) => {
if (Buffer.isBuffer(s) || Array.isArray(s) || typeof s == 'string') {
if (Buffer.isBuffer(s) || Array.isArray(s) || typeof s === 'string') {
return resolve(Buffer.from(s));

@@ -15,3 +15,3 @@ }

err.status = 413;
return reject(err);
reject(err);
}

@@ -25,8 +25,9 @@ });

function onEnd(err) {
if (err) reject(err);
else resolve(s._readableState && s._readableState.objectMode ? bufs : Buffer.concat(bufs));
if (err) {
return reject(err);
}
resolve(s._readableState && s._readableState.objectMode ? bufs : Buffer.concat(bufs));
}
});
module.exports = readAsBuffer;
{
"name": "as-buffer",
"version": "1.4.1",
"version": "1.4.2",
"description": "stream or anything to buffer as a Promise",

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

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

## Read stream as buffer\*
## Read stream and other types as buffer\*
[![npm version][npm-image]][npm-url]

@@ -3,0 +3,0 @@ [![build status][travis-image]][travis-url]

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