Skip to content

Commit d4b6c80

Browse files
committed
Removed dependency on type-is library
1 parent 531ae94 commit d4b6c80

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

index.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
'use strict';
22

3-
var xml2js = require('xml2js'),
4-
typeis = require('type-is');
3+
var xml2js = require('xml2js');
54

65
module.exports = function(bodyParser) {
76
if(bodyParser.xml) {
@@ -21,7 +20,7 @@ module.exports = function(bodyParser) {
2120
// First, run the body through the text parser.
2221
textParser(req, res, function(err) {
2322
if(err) { return next(err); }
24-
if(!typeis(req, xmlTypes)) { return next(); }
23+
if(typeof req.body !== 'string') { return next(); }
2524

2625
// Then, parse as XML.
2726
var parser = new xml2js.Parser(options.xmlParseOptions);

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
},
2323
"homepage": "https://github.com/fiznool/body-parser-xml#readme",
2424
"dependencies": {
25-
"type-is": "^1.6.10",
2625
"xml2js": "^0.4.15"
2726
},
2827
"devDependencies": {

0 commit comments

Comments
 (0)