Skip to content

Commit 96b6788

Browse files
authored
Do not convert type-check-function into array
Allows bodyparser.text to use your custom type-check-function
1 parent 3cf7784 commit 96b6788

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ module.exports = function(bodyParser) {
1515
options = options || {};
1616

1717
options.type = options.type || DEFAULT_TYPES;
18-
if(!Array.isArray(options.type)) {
18+
if(typeof options.type !== 'function' && !Array.isArray(options.type)) {
1919
options.type = [options.type];
2020
}
2121

0 commit comments

Comments
 (0)