koa-json-body
Advanced tools
Comparing version 0.0.3 to 1.0.0
18
index.js
'use strict'; | ||
var coBody = require('co-body'); | ||
var parse = require('co-body'); | ||
var initialize = function(opts) { | ||
opts = opts || {}; | ||
opts = opts || { strict: true }; | ||
return function *(next) { | ||
this.request.body = {}; | ||
this.request.body = yield parse.json(this, opts); | ||
this.body = this.request.body; | ||
try { | ||
if (this.is('application/json')) { | ||
this.request.body = yield coBody.json(this, opts); | ||
} | ||
} catch(e) { | ||
} | ||
yield next; | ||
} | ||
} | ||
}; | ||
}; | ||
module.exports = initialize; |
{ | ||
"name": "koa-json-body", | ||
"version": "0.0.3", | ||
"version": "1.0.0", | ||
"description": "koa middleware to parse json request bodies", | ||
@@ -27,4 +27,4 @@ "main": "index.js", | ||
"dependencies": { | ||
"co-body": "^0.0.1" | ||
"co-body": "^2.0.0" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
1
2027
11
+ Addedco-body@2.0.0(transitive)
+ Addediconv-lite@0.4.8(transitive)
+ Addedqs@2.4.2(transitive)
+ Addedraw-body@1.3.4(transitive)
- Removedco-body@0.0.1(transitive)
- Removedqs@0.6.6(transitive)
- Removedraw-body@1.1.7(transitive)
- Removedstring_decoder@0.10.31(transitive)
Updatedco-body@^2.0.0