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

dicer

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dicer - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

bench/bop-bench-multipart-parser.js

16

lib/Dicer.js

@@ -63,4 +63,4 @@ var EventEmitter = require('events').EventEmitter,

if (buf)
self._parser.push(buf);
var r = self._parser.push(data.slice(start, end));
self._hparser.push(buf);
var r = self._hparser.push(data.slice(start, end));
if (!inHeader && r !== undefined && r < end)

@@ -73,3 +73,3 @@ redo(false, data, start + r, end);

isPreamble = false;
self._parser.reset();
self._hparser.reset();
self._part.emit('end');

@@ -82,4 +82,4 @@ self._part = undefined;

this._part = undefined;
this._parser = new HeaderParser();
this._parser.on('header', function(header) {
this._hparser = new HeaderParser();
this._hparser.on('header', function(header) {
inHeader = false;

@@ -98,2 +98,3 @@ self._part.emit('header', header);

// allows for "easier" testing
if (this._firstWrite) {

@@ -110,3 +111,4 @@ this._bparser.push(B_CRLF);

Dicer.prototype.end = function(data, encoding) {
this.write(data, encoding);
if (data)
this.write(data, encoding);
this.destroy();

@@ -118,3 +120,3 @@ };

this._part = undefined;
this._parser = undefined;
this._bparser = undefined;
this._hparser = undefined;

@@ -121,0 +123,0 @@ this._justMatched = false;

@@ -19,7 +19,4 @@ var EventEmitter = require('events').EventEmitter,

this.ss.on('info', function(isMatch, data, start, end) {
if (data) {
if (data)
self.buffer += data.toString('ascii', start, end);
if (RE_CRLF.test(self.buffer))
self._parseHeader();
}
if (isMatch) {

@@ -26,0 +23,0 @@ if (self.buffer)

{ "name": "dicer",
"version": "0.0.3",
"version": "0.0.4",
"author": "Brian White <mscdex@mscdex.net>",

@@ -7,4 +7,7 @@ "description": "A very fast streaming multipart parser for node.js",

"dependencies": {
"streamsearch": "*"
"streamsearch": "0.1.2"
},
"scripts": {
"test": "node test/test.js"
},
"engines": { "node": ">=0.8.0" },

@@ -11,0 +14,0 @@ "keywords": [ "parser", "parse", "parsing", "multipart", "form-data", "streaming" ],

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