Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

subtext

Package Overview
Dependencies
Maintainers
2
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

subtext - npm Package Compare versions

Comparing version 4.2.2 to 4.3.0

35

lib/index.js

@@ -45,7 +45,3 @@ 'use strict';

this.result = {};
this.next = (err) => {
return next(err, this.result);
};
this.next = (err) => next(err, this.result);
};

@@ -130,2 +126,6 @@

if (this.result.contentType.mime === 'multipart/form-data') {
if (this.settings.multipart === false) { // Defaults to true
return next(Boom.unsupportedMediaType());
}
return this.multipart(source, contentType);

@@ -165,3 +165,3 @@ }

internals.object(payload, this.result.contentType.mime, this.settings, (err, result) => {
internals.object(payload, this.result.contentType.mime, (err, result) => {

@@ -249,3 +249,3 @@ if (err) {

internals.object = function (payload, mime, options, next) {
internals.object = function (payload, mime, next) {

@@ -358,5 +358,7 @@ // Binary

const output = (this.settings.multipart ? this.settings.multipart.output : this.settings.output);
const onPart = (part) => {
if (this.settings.output === 'file') { // Output: 'file'
if (output === 'file') { // Output: 'file'
const id = nextId++;

@@ -393,3 +395,3 @@ pendingFiles[id] = true;

if (this.settings.output === 'stream') { // Output: 'stream'
if (output === 'stream') { // Output: 'stream'
const item = Wreck.toReadableStream(payload);

@@ -407,15 +409,13 @@

const mime = ct.split(';')[0].trim().toLowerCase();
const annotate = (value) => set(part.name, output === 'annotated' ? { filename: part.filename, headers: part.headers, payload: value } : value);
if (!mime) {
return set(part.name, payload);
return annotate(payload);
}
if (!payload.length) {
return set(part.name, {});
return annotate({});
}
internals.object(payload, mime, this.settings, (err, result) => {
return set(part.name, err ? payload : result);
});
internals.object(payload, mime, (err, result) => annotate(err ? payload : result));
});

@@ -427,7 +427,4 @@ }

const onField = (name, value) => {
const onField = (name, value) => set(name, value);
set(name, value);
};
dispenser.on('field', onField);

@@ -434,0 +431,0 @@

{
"name": "subtext",
"description": "HTTP payload parsing",
"version": "4.2.2",
"version": "4.3.0",
"repository": "git://github.com/hapijs/subtext",

@@ -6,0 +6,0 @@ "main": "lib/index.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