nightingale-formatter 11.6.0 → 11.7.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/.eslintrc.json +1 -1
  2. package/CHANGELOG.md +41 -0
  3. package/babel.config.cjs +14 -0
  4. package/dist/formatObject.d.ts.map +1 -1
  5. package/dist/index-browser-dev.cjs.js +167 -130
  6. package/dist/index-browser-dev.cjs.js.map +1 -1
  7. package/dist/index-browser-dev.es.js +151 -113
  8. package/dist/index-browser-dev.es.js.map +1 -1
  9. package/dist/index-browser.cjs.js +167 -130
  10. package/dist/index-browser.cjs.js.map +1 -1
  11. package/dist/index-browser.es.js +151 -113
  12. package/dist/index-browser.es.js.map +1 -1
  13. package/dist/index-browsermodern-dev.es.js +16 -4
  14. package/dist/index-browsermodern-dev.es.js.map +1 -1
  15. package/dist/index-browsermodern.es.js +16 -4
  16. package/dist/index-browsermodern.es.js.map +1 -1
  17. package/dist/index-node12-dev.cjs.js +30 -22
  18. package/dist/index-node12-dev.cjs.js.map +1 -1
  19. package/dist/index-node12-dev.mjs +15 -3
  20. package/dist/index-node12-dev.mjs.map +1 -1
  21. package/dist/index-node12.cjs.js +30 -22
  22. package/dist/index-node12.cjs.js.map +1 -1
  23. package/dist/index-node12.mjs +15 -3
  24. package/dist/index-node12.mjs.map +1 -1
  25. package/dist/levelToStyles.d.ts +1 -3
  26. package/dist/levelToStyles.d.ts.map +1 -1
  27. package/dist/levelToSymbol.d.ts +1 -3
  28. package/dist/levelToSymbol.d.ts.map +1 -1
  29. package/dist/styleToHexColor.d.ts +1 -3
  30. package/dist/styleToHexColor.d.ts.map +1 -1
  31. package/dist/styleToHtmlStyle.d.ts +1 -3
  32. package/dist/styleToHtmlStyle.d.ts.map +1 -1
  33. package/package.json +22 -35
  34. package/rollup.config.mjs +3 -0
  35. package/src/formatObject.test.ts +23 -1
  36. package/src/formatObject.ts +14 -1
  37. package/src/formatRecordToString.ts +2 -2
  38. package/src/levelToStyles.ts +2 -4
  39. package/src/levelToSymbol.ts +2 -4
  40. package/src/styleToHexColor.ts +1 -3
  41. package/src/styleToHtmlStyle.ts +1 -3
  42. package/index.js +0 -6
package/.eslintrc.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "root": true,
3
- "extends": ["@pob/eslint-config/root", "@pob/eslint-config-node"],
3
+ "extends": ["@pob/eslint-config/root-commonjs"],
4
4
  "ignorePatterns": ["*.d.ts", "/dist"]
5
5
  }
package/CHANGELOG.md CHANGED
@@ -3,6 +3,47 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [11.7.4](https://github.com/christophehurpeau/nightingale/compare/v11.7.3...v11.7.4) (2021-11-27)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * build all packages ([dbb4785](https://github.com/christophehurpeau/nightingale/commit/dbb4785cbb8c75942935c4a5935df32fd2e93690))
12
+
13
+
14
+
15
+
16
+
17
+ ## [11.7.2](https://github.com/christophehurpeau/nightingale/compare/v11.7.1...v11.7.2) (2021-11-27)
18
+
19
+
20
+ ### Bug Fixes
21
+
22
+ * support formatting symbol and bigint ([f4205b0](https://github.com/christophehurpeau/nightingale/commit/f4205b0add9d570e470f93ac525db1adbfacf1db))
23
+
24
+
25
+
26
+
27
+
28
+ ## [11.7.1](https://github.com/christophehurpeau/nightingale/compare/v11.7.0...v11.7.1) (2021-06-29)
29
+
30
+
31
+ ### Bug Fixes
32
+
33
+ * update pob-babel to bring back webpack 4 support ([4887431](https://github.com/christophehurpeau/nightingale/commit/4887431b3b272496511f879af022638723b9056e))
34
+
35
+
36
+
37
+
38
+
39
+ # [11.7.0](https://github.com/christophehurpeau/nightingale/compare/v11.6.0...v11.7.0) (2021-03-29)
40
+
41
+ **Note:** Version bump only for package nightingale-formatter
42
+
43
+
44
+
45
+
46
+
6
47
  # [11.6.0](https://github.com/christophehurpeau/nightingale/compare/v11.5.4...v11.6.0) (2021-03-21)
7
48
 
8
49
 
@@ -0,0 +1,14 @@
1
+ 'use strict';
2
+
3
+ const path = require('path');
4
+
5
+ module.exports = function babelConfig(api) {
6
+ const isTest = api.env('test');
7
+
8
+ if (!isTest) return {};
9
+
10
+ return {
11
+ only: [path.resolve(__dirname, 'src')],
12
+ presets: [require.resolve('pob-babel/preset')],
13
+ };
14
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"formatObject.d.ts","sourceRoot":"","sources":["../src/formatObject.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAEhD,MAAM,WAAW,mBAAmB;IAClC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,oBAAY,OAAO,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;AAEhE,oBAAY,YAAY,CAAC,IAAI,SAAS,MAAM,GAAG,MAAM,IAAI,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AA4Z9E,wBAAgB,YAAY,CAC1B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,OAAO,GAAE,OAAmB,EAC5B,YAAY,CAAC,EAAE,YAAY,EAC3B,EAAE,OAAc,EAAE,QAAa,EAAE,GAAE,mBAAwB,GAC1D,MAAM,CAkBR"}
1
+ {"version":3,"file":"formatObject.d.ts","sourceRoot":"","sources":["../src/formatObject.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAEhD,MAAM,WAAW,mBAAmB;IAClC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,oBAAY,OAAO,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;AAEhE,oBAAY,YAAY,CAAC,IAAI,SAAS,MAAM,GAAG,MAAM,IAAI,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AAya9E,wBAAgB,YAAY,CAC1B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,OAAO,GAAE,OAAmB,EAC5B,YAAY,CAAC,EAAE,YAAY,EAC3B,EAAE,OAAc,EAAE,QAAa,EAAE,GAAE,mBAAwB,GAC1D,MAAM,CAkBR"}
@@ -2,43 +2,42 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var Level = require('nightingale-levels');
5
+ var nightingaleLevels = require('nightingale-levels');
6
6
  var _extends = require('@babel/runtime/helpers/esm/extends');
7
7
 
8
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e['default'] : e; }
8
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e["default"] : e; }
9
9
 
10
- var Level__default = /*#__PURE__*/_interopDefaultLegacy(Level);
11
10
  var _extends__default = /*#__PURE__*/_interopDefaultLegacy(_extends);
12
11
 
13
- const levelToStyles = {
14
- [Level__default.TRACE]: ['gray'],
15
- [Level__default.DEBUG]: ['gray'],
12
+ var levelToStyles = {
13
+ [nightingaleLevels.Level.TRACE]: ['gray'],
14
+ [nightingaleLevels.Level.DEBUG]: ['gray'],
16
15
  // [Level.INFO]: ['gray'],
17
- [Level__default.WARN]: ['yellow'],
18
- [Level__default.ERROR]: ['red', 'bold'],
19
- [Level__default.CRITICAL]: ['red', 'bold'],
20
- [Level__default.FATAL]: ['bgRed', 'white'],
21
- [Level__default.EMERGENCY]: ['bgRed', 'white']
16
+ [nightingaleLevels.Level.WARN]: ['yellow'],
17
+ [nightingaleLevels.Level.ERROR]: ['red', 'bold'],
18
+ [nightingaleLevels.Level.CRITICAL]: ['red', 'bold'],
19
+ [nightingaleLevels.Level.FATAL]: ['bgRed', 'white'],
20
+ [nightingaleLevels.Level.EMERGENCY]: ['bgRed', 'white']
22
21
  };
23
22
 
24
- const levelToSymbol = {
25
- [Level__default.TRACE]: '•',
26
- [Level__default.DEBUG]: '•',
27
- [Level__default.INFO]: '→',
28
- [Level__default.WARN]: '⚠',
29
- [Level__default.ERROR]: '✖',
30
- [Level__default.CRITICAL]: '!',
31
- [Level__default.FATAL]: '‼',
32
- [Level__default.EMERGENCY]: '‼'
23
+ var levelToSymbol = {
24
+ [nightingaleLevels.Level.TRACE]: '•',
25
+ [nightingaleLevels.Level.DEBUG]: '•',
26
+ [nightingaleLevels.Level.INFO]: '→',
27
+ [nightingaleLevels.Level.WARN]: '⚠',
28
+ [nightingaleLevels.Level.ERROR]: '✖',
29
+ [nightingaleLevels.Level.CRITICAL]: '!',
30
+ [nightingaleLevels.Level.FATAL]: '‼',
31
+ [nightingaleLevels.Level.EMERGENCY]: '‼'
33
32
  };
34
33
 
35
- const styleToHexColor = {
34
+ var styleToHexColor = {
36
35
  orange: 'ff5f00',
37
36
  grayLight: '808080',
38
37
  'gray-light': '808080'
39
38
  };
40
39
 
41
- const styleToHtmlStyleThemeLight = {
40
+ var styleToHtmlStyleThemeLight = {
42
41
  // text style
43
42
  bold: {
44
43
  open: 'font-weight: bold',
@@ -141,7 +140,7 @@ const styleToHtmlStyleThemeLight = {
141
140
  close: 'color: currentcolor'
142
141
  }
143
142
  };
144
- const styleToHtmlStyleThemeDark = _extends__default({}, styleToHtmlStyleThemeLight, {
143
+ var styleToHtmlStyleThemeDark = _extends__default({}, styleToHtmlStyleThemeLight, {
145
144
  black: styleToHtmlStyleThemeLight.white,
146
145
  bgBlack: styleToHtmlStyleThemeLight.bgWhite,
147
146
  white: styleToHtmlStyleThemeLight.black,
@@ -153,7 +152,9 @@ const styleToHtmlStyleThemeDark = _extends__default({}, styleToHtmlStyleThemeLig
153
152
  });
154
153
 
155
154
  /* eslint-disable max-lines, @typescript-eslint/no-use-before-define */
156
- const noStyleFn = (styles, value) => value;
155
+ var noStyleFn = function noStyleFn(styles, value) {
156
+ return value;
157
+ };
157
158
 
158
159
  function tryStringify(arg) {
159
160
  try {
@@ -163,24 +164,29 @@ function tryStringify(arg) {
163
164
  }
164
165
  }
165
166
 
166
- const sameRawFormattedValue = value => ({
167
- stringValue: value,
168
- formattedValue: value
169
- });
167
+ var sameRawFormattedValue = function sameRawFormattedValue(value) {
168
+ return {
169
+ stringValue: value,
170
+ formattedValue: value
171
+ };
172
+ };
170
173
 
171
- function internalFormatValue(value, styleFn, styles, {
172
- padding,
173
- depth,
174
- maxDepth,
175
- objects
176
- }) {
177
- const typeofValue = typeof value;
174
+ function internalFormatValue(value, styleFn, styles, _ref) {
175
+ var padding = _ref.padding,
176
+ depth = _ref.depth,
177
+ maxDepth = _ref.maxDepth,
178
+ objects = _ref.objects;
179
+ var typeofValue = typeof value;
178
180
 
179
181
  if (!styles) {
180
182
  if (value == null) {
181
183
  styles = ['cyan'];
182
184
  } else {
183
185
  switch (typeofValue) {
186
+ case 'undefined':
187
+ styles = ['cyan'];
188
+ break;
189
+
184
190
  case 'boolean':
185
191
  styles = ['green'];
186
192
  break;
@@ -189,6 +195,10 @@ function internalFormatValue(value, styleFn, styles, {
189
195
  styles = ['yellow'];
190
196
  break;
191
197
 
198
+ case 'bigint':
199
+ styles = ['red'];
200
+ break;
201
+
192
202
  case 'string':
193
203
  styles = ['orange'];
194
204
  break;
@@ -200,7 +210,7 @@ function internalFormatValue(value, styleFn, styles, {
200
210
  }
201
211
  }
202
212
 
203
- let stringValue;
213
+ var stringValue;
204
214
 
205
215
  if (value === null) {
206
216
  stringValue = 'null';
@@ -232,10 +242,10 @@ function internalFormatValue(value, styleFn, styles, {
232
242
  });
233
243
  }
234
244
  } else if (value instanceof Error) {
235
- const stack = value.stack;
245
+ var stack = value.stack;
236
246
  stringValue = stack != null && stack.startsWith(value.message) ? stack : `${value.message}\n${stack || ''}`;
237
247
  } else if (value instanceof Map) {
238
- const name = value.constructor.name;
248
+ var name = value.constructor.name;
239
249
 
240
250
  if (depth >= maxDepth) {
241
251
  stringValue = `{${name}...}`;
@@ -247,13 +257,17 @@ function internalFormatValue(value, styleFn, styles, {
247
257
  objects
248
258
  });
249
259
  }
260
+ } else if (typeofValue === 'bigint') {
261
+ stringValue = value.toString();
262
+ } else if (typeofValue === 'symbol') {
263
+ stringValue = value.toString();
250
264
  } else if (value instanceof Set) {
251
- const name = value.constructor.name;
265
+ var _name = value.constructor.name;
252
266
 
253
267
  if (depth >= maxDepth) {
254
- stringValue = `{${name}...}`;
268
+ stringValue = `{${_name}...}`;
255
269
  } else {
256
- return internalFormatSet(name, value, styleFn, {
270
+ return internalFormatSet(_name, value, styleFn, {
257
271
  padding,
258
272
  depth: depth + 1,
259
273
  maxDepth,
@@ -268,33 +282,33 @@ function internalFormatValue(value, styleFn, styles, {
268
282
  stringValue = tryStringify(value);
269
283
  }
270
284
 
271
- const formattedValue = styleFn(styles, stringValue);
285
+ var formattedValue = styleFn(styles, stringValue);
272
286
  return {
273
287
  stringValue,
274
288
  formattedValue
275
289
  };
276
290
  }
277
291
 
278
- const separator = ',';
292
+ var separator = ',';
279
293
 
280
- const internalFormatKey = (key, styleFn) => {
294
+ var internalFormatKey = function internalFormatKey(key, styleFn) {
281
295
  return {
282
296
  stringKey: `${key}: `,
283
297
  formattedKey: `${styleFn(['gray-light', 'bold'], `${key}:`)} `
284
298
  };
285
299
  };
286
300
 
287
- const internalNoKey = () => {
301
+ var internalNoKey = function internalNoKey() {
288
302
  return {
289
303
  stringKey: '',
290
304
  formattedKey: ''
291
305
  };
292
306
  };
293
307
 
294
- const internalFormatMapKey = (key, styleFn, internalFormatParams) => {
295
- const _internalFormatValue = internalFormatValue(key, noStyleFn, undefined, internalFormatParams),
296
- stringValue = _internalFormatValue.stringValue,
297
- formattedValue = _internalFormatValue.formattedValue;
308
+ var internalFormatMapKey = function internalFormatMapKey(key, styleFn, internalFormatParams) {
309
+ var _internalFormatValue = internalFormatValue(key, noStyleFn, undefined, internalFormatParams),
310
+ stringValue = _internalFormatValue.stringValue,
311
+ formattedValue = _internalFormatValue.formattedValue;
298
312
 
299
313
  return {
300
314
  stringKey: `${stringValue} => `,
@@ -302,38 +316,38 @@ const internalFormatMapKey = (key, styleFn, internalFormatParams) => {
302
316
  };
303
317
  };
304
318
 
305
- const internalFormatIterator = (values, styleFn, objectStyles, {
306
- padding,
307
- depth,
308
- maxDepth,
309
- objects
310
- }, {
311
- prefix,
312
- suffix,
313
- prefixSuffixSpace = ' ',
314
- formatKey
315
- }) => {
316
- let breakLine = false;
317
-
318
- const formattedSeparator = () => styleFn(['gray'], separator);
319
-
320
- const valuesMaxIndex = values.length - 1;
321
- const formattedValues = values.map(({
322
- key,
323
- value
324
- }, index) => {
325
- const internalFormatParams = {
319
+ var internalFormatIterator = function internalFormatIterator(values, styleFn, objectStyles, _ref2, _ref3) {
320
+ var padding = _ref2.padding,
321
+ depth = _ref2.depth,
322
+ maxDepth = _ref2.maxDepth,
323
+ objects = _ref2.objects;
324
+ var prefix = _ref3.prefix,
325
+ suffix = _ref3.suffix,
326
+ _ref3$prefixSuffixSpa = _ref3.prefixSuffixSpace,
327
+ prefixSuffixSpace = _ref3$prefixSuffixSpa === void 0 ? ' ' : _ref3$prefixSuffixSpa,
328
+ formatKey = _ref3.formatKey;
329
+ var breakLine = false;
330
+
331
+ var formattedSeparator = function formattedSeparator() {
332
+ return styleFn(['gray'], separator);
333
+ };
334
+
335
+ var valuesMaxIndex = values.length - 1;
336
+ var formattedValues = values.map(function (_ref4, index) {
337
+ var key = _ref4.key,
338
+ value = _ref4.value;
339
+ var internalFormatParams = {
326
340
  padding,
327
341
  depth: depth + 1,
328
342
  maxDepth,
329
343
  objects
330
344
  }; // key must be formatted before value (browser-formatter needs order)
331
345
 
332
- const _formatKey = formatKey(key, styleFn, internalFormatParams),
333
- stringKey = _formatKey.stringKey,
334
- formattedKey = _formatKey.formattedKey;
346
+ var _formatKey = formatKey(key, styleFn, internalFormatParams),
347
+ stringKey = _formatKey.stringKey,
348
+ formattedKey = _formatKey.formattedKey;
335
349
 
336
- let _internalFormatValue2 = internalFormatValue(value, styleFn, key && objectStyles ? objectStyles[key] : undefined, internalFormatParams),
350
+ var _internalFormatValue2 = internalFormatValue(value, styleFn, key && objectStyles ? objectStyles[key] : undefined, internalFormatParams),
337
351
  stringValue = _internalFormatValue2.stringValue,
338
352
  formattedValue = _internalFormatValue2.formattedValue;
339
353
 
@@ -350,32 +364,42 @@ const internalFormatIterator = (values, styleFn, objectStyles, {
350
364
  };
351
365
  });
352
366
  return {
353
- stringValue: prefix + formattedValues.map(breakLine ? v => `\n${padding}${v.stringValue}` : fv => fv.stringValue).join(breakLine ? '\n' : ' ') + suffix,
354
- formattedValue: `${prefix}${breakLine ? '' : prefixSuffixSpace}${formattedValues.map(breakLine ? v => `\n${padding}${v.formattedValue}` : v => v.formattedValue).join(breakLine ? '' : ' ')}${breakLine ? ',\n' : prefixSuffixSpace}${suffix}`
367
+ stringValue: prefix + formattedValues.map(breakLine ? function (v) {
368
+ return `\n${padding}${v.stringValue}`;
369
+ } : function (fv) {
370
+ return fv.stringValue;
371
+ }).join(breakLine ? '\n' : ' ') + suffix,
372
+ formattedValue: `${prefix}${breakLine ? '' : prefixSuffixSpace}${formattedValues.map(breakLine ? function (v) {
373
+ return `\n${padding}${v.formattedValue}`;
374
+ } : function (v) {
375
+ return v.formattedValue;
376
+ }).join(breakLine ? '' : ' ')}${breakLine ? ',\n' : prefixSuffixSpace}${suffix}`
355
377
  };
356
378
  };
357
379
 
358
- function internalFormatObject(object, styleFn, objectStyles, {
359
- padding,
360
- depth,
361
- maxDepth,
362
- objects
363
- }) {
380
+ function internalFormatObject(object, styleFn, objectStyles, _ref5) {
381
+ var padding = _ref5.padding,
382
+ depth = _ref5.depth,
383
+ maxDepth = _ref5.maxDepth,
384
+ objects = _ref5.objects;
385
+
364
386
  if (objects.has(object)) {
365
387
  return sameRawFormattedValue('{Circular Object}');
366
388
  }
367
389
 
368
- const keys = Object.keys(object);
390
+ var keys = Object.keys(object);
369
391
 
370
392
  if (keys.length === 0) {
371
393
  return sameRawFormattedValue('{}');
372
394
  }
373
395
 
374
396
  objects.add(object);
375
- const result = internalFormatIterator(keys.map(key => ({
376
- key,
377
- value: object[key]
378
- })), styleFn, objectStyles, {
397
+ var result = internalFormatIterator(keys.map(function (key) {
398
+ return {
399
+ key,
400
+ value: object[key]
401
+ };
402
+ }), styleFn, objectStyles, {
379
403
  padding,
380
404
  depth,
381
405
  maxDepth,
@@ -389,27 +413,29 @@ function internalFormatObject(object, styleFn, objectStyles, {
389
413
  return result;
390
414
  }
391
415
 
392
- function internalFormatMap(name, map, styleFn, {
393
- padding,
394
- depth,
395
- maxDepth,
396
- objects
397
- }) {
416
+ function internalFormatMap(name, map, styleFn, _ref6) {
417
+ var padding = _ref6.padding,
418
+ depth = _ref6.depth,
419
+ maxDepth = _ref6.maxDepth,
420
+ objects = _ref6.objects;
421
+
398
422
  if (objects.has(map)) {
399
423
  return sameRawFormattedValue(`{Circular ${name}}`);
400
424
  }
401
425
 
402
- const keys = [...map.keys()];
426
+ var keys = [].concat(map.keys());
403
427
 
404
428
  if (keys.length === 0) {
405
429
  return sameRawFormattedValue(`${name} {}`);
406
430
  }
407
431
 
408
432
  objects.add(map);
409
- const result = internalFormatIterator(keys.map(key => ({
410
- key,
411
- value: map.get(key)
412
- })), styleFn, undefined, {
433
+ var result = internalFormatIterator(keys.map(function (key) {
434
+ return {
435
+ key,
436
+ value: map.get(key)
437
+ };
438
+ }), styleFn, undefined, {
413
439
  padding,
414
440
  depth,
415
441
  maxDepth,
@@ -423,12 +449,12 @@ function internalFormatMap(name, map, styleFn, {
423
449
  return result;
424
450
  }
425
451
 
426
- function internalFormatArray(array, styleFn, {
427
- padding,
428
- depth,
429
- maxDepth,
430
- objects
431
- }) {
452
+ function internalFormatArray(array, styleFn, _ref7) {
453
+ var padding = _ref7.padding,
454
+ depth = _ref7.depth,
455
+ maxDepth = _ref7.maxDepth,
456
+ objects = _ref7.objects;
457
+
432
458
  if (objects.has(array)) {
433
459
  return sameRawFormattedValue('{Circular Array}');
434
460
  }
@@ -438,10 +464,12 @@ function internalFormatArray(array, styleFn, {
438
464
  }
439
465
 
440
466
  objects.add(array);
441
- const result = internalFormatIterator(array.map(value => ({
442
- key: undefined,
443
- value
444
- })), styleFn, undefined, {
467
+ var result = internalFormatIterator(array.map(function (value) {
468
+ return {
469
+ key: undefined,
470
+ value
471
+ };
472
+ }), styleFn, undefined, {
445
473
  padding,
446
474
  depth,
447
475
  maxDepth,
@@ -456,27 +484,29 @@ function internalFormatArray(array, styleFn, {
456
484
  return result;
457
485
  }
458
486
 
459
- function internalFormatSet(name, set, styleFn, {
460
- padding,
461
- depth,
462
- maxDepth,
463
- objects
464
- }) {
487
+ function internalFormatSet(name, set, styleFn, _ref8) {
488
+ var padding = _ref8.padding,
489
+ depth = _ref8.depth,
490
+ maxDepth = _ref8.maxDepth,
491
+ objects = _ref8.objects;
492
+
465
493
  if (objects.has(set)) {
466
494
  return sameRawFormattedValue(`{Circular ${name}}`);
467
495
  }
468
496
 
469
- const values = [...set.values()];
497
+ var values = [].concat(set.values());
470
498
 
471
499
  if (values.length === 0) {
472
500
  return sameRawFormattedValue(`${name} []`);
473
501
  }
474
502
 
475
503
  objects.add(set);
476
- const result = internalFormatIterator(values.map(value => ({
477
- key: undefined,
478
- value
479
- })), styleFn, undefined, {
504
+ var result = internalFormatIterator(values.map(function (value) {
505
+ return {
506
+ key: undefined,
507
+ value
508
+ };
509
+ }), styleFn, undefined, {
480
510
  padding,
481
511
  depth,
482
512
  maxDepth,
@@ -490,17 +520,24 @@ function internalFormatSet(name, set, styleFn, {
490
520
  return result;
491
521
  }
492
522
 
493
- function formatObject(object, styleFn = noStyleFn, objectStyles, {
494
- padding = ' ',
495
- maxDepth = 10
496
- } = {}) {
497
- const _internalFormatObject = internalFormatObject(object, styleFn, objectStyles, {
523
+ function formatObject(object, styleFn, objectStyles, _temp) {
524
+ if (styleFn === void 0) {
525
+ styleFn = noStyleFn;
526
+ }
527
+
528
+ var _ref9 = _temp === void 0 ? {} : _temp,
529
+ _ref9$padding = _ref9.padding,
530
+ padding = _ref9$padding === void 0 ? ' ' : _ref9$padding,
531
+ _ref9$maxDepth = _ref9.maxDepth,
532
+ maxDepth = _ref9$maxDepth === void 0 ? 10 : _ref9$maxDepth;
533
+
534
+ var _internalFormatObject = internalFormatObject(object, styleFn, objectStyles, {
498
535
  padding,
499
536
  maxDepth,
500
537
  depth: 0,
501
538
  objects: new Set()
502
539
  }),
503
- result = _internalFormatObject.formattedValue;
540
+ result = _internalFormatObject.formattedValue;
504
541
 
505
542
  if (result === '{}') {
506
543
  return '';
@@ -510,7 +547,7 @@ function formatObject(object, styleFn = noStyleFn, objectStyles, {
510
547
  }
511
548
 
512
549
  function formatRecordToString(record, style) {
513
- const parts = [];
550
+ var parts = [];
514
551
 
515
552
  if (record.displayName) {
516
553
  parts.push(style(['gray-light'], record.displayName));
@@ -523,8 +560,8 @@ function formatRecordToString(record, style) {
523
560
  /* new Date().toFormat('HH24:MI:SS') */
524
561
  }
525
562
 
526
- let message = record.symbol || levelToSymbol[record.level];
527
- const styles = record.styles || levelToStyles[record.level];
563
+ var message = record.symbol || levelToSymbol[record.level];
564
+ var styles = record.styles || levelToStyles[record.level];
528
565
 
529
566
  if (record.message) {
530
567
  if (message) {
@@ -542,12 +579,12 @@ function formatRecordToString(record, style) {
542
579
  parts.push(message);
543
580
  }
544
581
 
545
- const formatRecordObject = (key, object, styles) => {
582
+ var formatRecordObject = function formatRecordObject(key, object, objectStyles) {
546
583
  if (!object) {
547
584
  return;
548
585
  }
549
586
 
550
- const stringObject = formatObject(object, style, styles);
587
+ var stringObject = formatObject(object, style, objectStyles);
551
588
 
552
589
  if (!stringObject) {
553
590
  return;