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

koa-body

Package Overview
Dependencies
Maintainers
1
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

koa-body - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

11

index.js
'use strict';
var co_body = require('co-body');
module.exports = function(opts){
var patchNode = (opts && opts.patchNode) || false;
var patchKoa = (opts && opts.patchKoa) || true;
var patchNode = (opts && 'patchNode' in opts) ? opts.patchNode : false;
var patchKoa = (opts && 'patchKoa' in opts) ? opts.patchKoa : true;
return function *(next){
var body;
if(this.is('application/json')){
var body = yield co_body.json(this);
body = yield co_body.json(this);
if(patchNode){

@@ -20,3 +19,3 @@ this.req.body = body;

else if(this.is('application/x-www-form-urlencoded')){
var body = yield co_body.form(this);
body = yield co_body.form(this);
if(patchNode){

@@ -23,0 +22,0 @@ this.req.body = body;

{
"name": "koa-body",
"version": "0.0.3",
"description": "Simple wrapper around co-body for koa",
"version": "0.0.4",
"description": "koa middleware that parses request body",
"main": "index.js",

@@ -6,0 +6,0 @@ "scripts": {

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