(ctx, value)
| 243 | } |
| 244 | |
| 245 | function formatArray(ctx, value) { |
| 246 | ctx.seen.push(value); |
| 247 | |
| 248 | var output = []; |
| 249 | for (var i = 0, l = value.length; i < l; ++i) { |
| 250 | if (Object.prototype.hasOwnProperty.call(value, String(i))) { |
| 251 | if (ctx.jsonParity && value[i] === undefined) { |
| 252 | // jsonParity: when array entries are equal to 'undefined', JSON.stringify prints 'null' |
| 253 | output.push(ctx.stylize('null', 'null')); |
| 254 | } else { |
| 255 | output.push(formatProperty(ctx, value, String(i), false, true)); |
| 256 | } |
| 257 | } else { |
| 258 | // jsonParity: when value entries are unset, JSON.stringify prints 'null' |
| 259 | output.push(ctx.jsonParity ? ctx.stylize('null', 'null') : ''); |
| 260 | } |
| 261 | } |
| 262 | |
| 263 | |
| 264 | ctx.seen.pop(); |
| 265 | |
| 266 | return joinCollection(ctx, output, '[', ']'); |
| 267 | } |
| 268 | |
| 269 | function formatObject(ctx, value, type) { |
| 270 | ctx.seen.push(value); |
no test coverage detected