(value, path, depth = 0)
| 250 | }); |
| 251 | |
| 252 | function build(value, path, depth = 0) { |
| 253 | if (utils.isUndefined(value)) return; |
| 254 | |
| 255 | throwIfMaxDepthExceeded(depth); |
| 256 | |
| 257 | if (stack.indexOf(value) !== -1) { |
| 258 | throw new Error('Circular reference detected in ' + path.join('.')); |
| 259 | } |
| 260 | |
| 261 | stack.push(value); |
| 262 | |
| 263 | utils.forEach(value, function each(el, key) { |
| 264 | const result = |
| 265 | !(utils.isUndefined(el) || el === null) && |
| 266 | visitor.call(formData, el, utils.isString(key) ? key.trim() : key, path, exposedHelpers); |
| 267 | |
| 268 | if (result === true) { |
| 269 | build(el, path ? path.concat(key) : [key], depth + 1); |
| 270 | } |
| 271 | }); |
| 272 | |
| 273 | stack.pop(); |
| 274 | } |
| 275 | |
| 276 | if (!utils.isObject(obj)) { |
| 277 | throw new TypeError('data must be an object'); |
no test coverage detected