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

raw-body

Package Overview
Dependencies
Maintainers
1
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

raw-body - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

21

index.js

@@ -0,1 +1,3 @@

var bytes = require('bytes')
module.exports = function (stream, options, done) {

@@ -5,15 +7,16 @@ if (typeof options === 'function') {

options = {}
} else if (!options) {
options = {}
}
if (!options)
options = {}
var limit = null
if (typeof options.limit === 'number')
limit = options.limit
if (typeof options.limit === 'string')
limit = bytes(options.limit)
var limit = typeof options.limit === 'number'
? options.limit
: null
var expected = null
if (!isNaN(options.expected))
expected = parseInt(options.expected, 10)
var expected = !isNaN(options.expected)
? parseInt(options.expected, 10)
: null
if (limit !== null && expected !== null && expected > limit) {

@@ -20,0 +23,0 @@ var err = new Error('request entity too large')

{
"name": "raw-body",
"description": "Get and validate the raw body of a readable stream.",
"version": "0.1.0",
"version": "0.1.1",
"author": {

@@ -20,2 +20,5 @@ "name": "Jonathan Ong",

},
"dependencies": {
"bytes": "~0.2.1"
},
"devDependencies": {

@@ -22,0 +25,0 @@ "co": "*",

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