Skip to content

Commit f20f6ad

Browse files
authored
Remove redundant depth check (#538)
1 parent 1752951 commit f20f6ad

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

lib/types/urlencoded.js

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,6 @@ function urlencoded (options) {
5555
: opts.limit
5656
var type = opts.type || 'application/x-www-form-urlencoded'
5757
var verify = opts.verify || false
58-
var depth = typeof opts.depth !== 'number'
59-
? Number(opts.depth || 32)
60-
: opts.depth
6158

6259
if (verify !== false && typeof verify !== 'function') {
6360
throw new TypeError('option verify must be function')
@@ -121,8 +118,7 @@ function urlencoded (options) {
121118
encoding: charset,
122119
inflate: inflate,
123120
limit: limit,
124-
verify: verify,
125-
depth: depth
121+
verify: verify
126122
})
127123
}
128124
}
@@ -137,10 +133,7 @@ function extendedparser (options) {
137133
var parameterLimit = options.parameterLimit !== undefined
138134
? options.parameterLimit
139135
: 1000
140-
141-
var depth = typeof options.depth !== 'number'
142-
? Number(options.depth || 32)
143-
: options.depth
136+
var depth = options.depth !== undefined ? options.depth : 32
144137
var parse = parser('qs')
145138

146139
if (isNaN(parameterLimit) || parameterLimit < 1) {

0 commit comments

Comments
 (0)