@vidavidorra/bunyan-pretty-stream 6.0.0-beta.1 → 6.0.1

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.
@@ -28,10 +28,13 @@ class Formatter {
28
28
  toIso8601(dateTime, preset) {
29
29
  const includeOffset = preset === 'TIME_ISO_8601_OFFSET' ||
30
30
  preset === 'DATETIME_ISO_8601_OFFSET';
31
- if (preset === 'TIME_ISO_8601_OFFSET' || preset === 'TIME_ISO_8601') {
32
- return dateTime.toISOTime({ includeOffset });
31
+ const value = preset === 'TIME_ISO_8601_OFFSET' || preset === 'TIME_ISO_8601'
32
+ ? dateTime.toISOTime({ includeOffset })
33
+ : dateTime.toISO({ includeOffset });
34
+ if (value === null) {
35
+ throw new Error('invalid Luxon DateTime');
33
36
  }
34
- return dateTime.toISO({ includeOffset });
37
+ return value;
35
38
  }
36
39
  toLocaleString(dateTime) {
37
40
  const presetToFormatOptions = new Map([
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vidavidorra/bunyan-pretty-stream",
3
- "version": "6.0.0-beta.1",
3
+ "version": "6.0.1",
4
4
  "description": "Highly configurable Bunyan stream with pretty output",
5
5
  "type": "module",
6
6
  "exports": "./dist/index.js",
@@ -50,9 +50,9 @@
50
50
  "@semantic-release/exec": "6.0.3",
51
51
  "@semantic-release/git": "10.0.1",
52
52
  "@types/bunyan": "1.8.8",
53
- "@types/luxon": "3.2.0",
53
+ "@types/luxon": "3.3.0",
54
54
  "@types/node": "18.15.0",
55
- "@vidavidorra/commitlint-config": "4.0.12",
55
+ "@vidavidorra/commitlint-config": "4.0.17",
56
56
  "ava": "5.2.0",
57
57
  "bunyan": "*",
58
58
  "bunyan-1.x": "npm:bunyan@1.8.15",