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

lib

Package Overview
Dependencies
Maintainers
1
Versions
62
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lib - npm Package Compare versions

Comparing version 4.1.4 to 4.2.0

12

lib/remote.js

@@ -11,9 +11,13 @@ const https = require('https');

function parseBuffers (value) {
function parseBuffers (value, contentType) {
if (Buffer.isBuffer(value)) {
return value;
var buffer = value;
buffer.contentType = contentType || 'application/octet-stream';
return buffer;
} else if (Array.isArray(value)) {
return value.map(v => parseBuffers(v));
} else if (value && typeof value === 'object' && Object.keys(value).length === 1 && typeof value._base64 === 'string') {
return Buffer.from(value._base64, 'base64');
var buffer = Buffer.from(value._base64, 'base64');
buffer.contentType = contentType || 'application/octet-stream';
return buffer;
} else if (value &&typeof value === 'object') {

@@ -120,3 +124,3 @@ return Object.keys(value).reduce((n, key) => {

response = parseBuffers(response);
response = parseBuffers(response, contentType);
responded = true;

@@ -123,0 +127,0 @@

{
"name": "lib",
"version": "4.1.4",
"version": "4.2.0",
"description": "StdLib: Standard Library for Microservices Node.js Bindings",

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

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