(ctx, key, isPrivate)
| 345 | } |
| 346 | |
| 347 | function formatKey(ctx, key, isPrivate) { |
| 348 | var name = '' + key; |
| 349 | if (isPrivate) { |
| 350 | return ctx.stylize('[' + name + ']', 'private'); |
| 351 | } else if (! ctx.quoteKeys && name.match(/^[a-zA-Z_][a-zA-Z_0-9]*$/)) { |
| 352 | return ctx.stylize(name, 'name'); |
| 353 | } else { |
| 354 | name = ctx.quoteString(name); |
| 355 | return ctx.stylize(name, 'name'); |
| 356 | } |
| 357 | } |
| 358 | |
| 359 | function Formatter (config) { |
| 360 | var ctx = {}; |