mdtg 4.1.5 → 4.1.6

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mdtg",
3
- "version": "4.1.5",
3
+ "version": "4.1.6",
4
4
  "main": "src/index.js",
5
5
  "types": "src/index.d.ts",
6
6
  "type": "module",
@@ -37,7 +37,8 @@
37
37
  "description": "This package offers you methods to convert Date Objects to military date time group and vice versa",
38
38
  "devDependencies": {
39
39
  "@biomejs/biome": "2.5.15",
40
- "@stryker-mutator/core": "10.0.0",
40
+ "@systemfsoftware/stryker-js": "15.0.1",
41
+ "@systemfsoftware/stryker-js-vitest-runner": "8.0.3",
41
42
  "@vitest/coverage-v8": "5.0.3",
42
43
  "knip": "6.39.0",
43
44
  "prettier": "3.9.9",
package/src/constants.js CHANGED
@@ -51,5 +51,4 @@ export const EXTENDED_FORMAT_REGEX =
51
51
  export const FORM = Object.freeze({
52
52
  SHORT: "short",
53
53
  STANDARD: "standard",
54
- EXTENDED: "extended",
55
54
  });
package/src/format.js CHANGED
@@ -51,10 +51,7 @@ const buildStandard = (date, timezone) => {
51
51
  return result;
52
52
  };
53
53
 
54
- export const formatMDTG = (
55
- date = new Date(),
56
- { form = FORM.EXTENDED, timezone: timezoneInput = "Z" } = {},
57
- ) => {
54
+ export const formatMDTG = (date = new Date(), { form, timezone: timezoneInput } = {}) => {
58
55
  validateDate(date);
59
56
 
60
57
  const timezone = validateTimezone(timezoneInput);
package/src/validation.js CHANGED
@@ -23,7 +23,9 @@ export const validateDate = (date) => {
23
23
  };
24
24
 
25
25
  export const validateTimezone = (timezone) => {
26
- const key = typeof timezone === "string" ? timezone.toUpperCase() : "Z";
26
+ if (typeof timezone !== "string") return "Z";
27
+
28
+ const key = timezone.toUpperCase();
27
29
  return key in OFFSETS ? key : "Z";
28
30
  };
29
31