@sprucelabs/calendar-utils 31.4.0 → 31.4.2

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.
@@ -2,10 +2,13 @@ import { cloneDeep } from '@sprucelabs/schema';
2
2
  import { timezoneChoices } from '@sprucelabs/spruce-core-schemas';
3
3
  import TimezoneChoiceSorter from '../locales/TimezoneChoiceSorter.js';
4
4
  export default function sortTimezoneChoices(locale, schema, fieldName) {
5
+ var _a;
5
6
  const sorter = new TimezoneChoiceSorter(locale);
6
7
  const choices = sorter.sort(timezoneChoices);
7
8
  const copy = cloneDeep(schema);
8
- //@ts-ignore
9
- copy.fields[fieldName].options.choices = choices;
9
+ const field = (_a = copy.fields) === null || _a === void 0 ? void 0 : _a[fieldName];
10
+ if (field) {
11
+ field.options = Object.assign(Object.assign({}, field.options), { choices });
12
+ }
10
13
  return copy;
11
14
  }
@@ -7,11 +7,14 @@ const schema_1 = require("@sprucelabs/schema");
7
7
  const spruce_core_schemas_1 = require("@sprucelabs/spruce-core-schemas");
8
8
  const TimezoneChoiceSorter_1 = __importDefault(require("../locales/TimezoneChoiceSorter"));
9
9
  function sortTimezoneChoices(locale, schema, fieldName) {
10
+ var _a;
10
11
  const sorter = new TimezoneChoiceSorter_1.default(locale);
11
12
  const choices = sorter.sort(spruce_core_schemas_1.timezoneChoices);
12
13
  const copy = (0, schema_1.cloneDeep)(schema);
13
- //@ts-ignore
14
- copy.fields[fieldName].options.choices = choices;
14
+ const field = (_a = copy.fields) === null || _a === void 0 ? void 0 : _a[fieldName];
15
+ if (field) {
16
+ field.options = Object.assign(Object.assign({}, field.options), { choices });
17
+ }
15
18
  return copy;
16
19
  }
17
20
  exports.default = sortTimezoneChoices;
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "31.4.0",
6
+ "version": "31.4.2",
7
7
  "files": [
8
8
  "build/**/*",
9
9
  "!build/__tests__",
@@ -65,29 +65,29 @@
65
65
  "watch.rebuild": "yarn clean.all && yarn && yarn watch.build.dev"
66
66
  },
67
67
  "dependencies": {
68
- "@sprucelabs/error": "^5.0.573",
69
- "@sprucelabs/mercury-event-emitter": "^35.0.122",
70
- "@sprucelabs/mercury-types": "^38.0.89",
71
- "@sprucelabs/schema": "^28.5.116",
72
- "@sprucelabs/spruce-core-schemas": "^35.1.152",
73
- "@sprucelabs/spruce-event-utils": "^30.0.102",
68
+ "@sprucelabs/error": "^5.0.574",
69
+ "@sprucelabs/mercury-event-emitter": "^35.0.123",
70
+ "@sprucelabs/mercury-types": "^38.0.90",
71
+ "@sprucelabs/schema": "^28.5.117",
72
+ "@sprucelabs/spruce-core-schemas": "^35.1.153",
73
+ "@sprucelabs/spruce-event-utils": "^30.0.103",
74
74
  "date-fns": "^2.29.3",
75
75
  "date-fns-tz": "^1.3.7",
76
76
  "lodash": "^4.17.21",
77
77
  "rrule": "^2.7.1"
78
78
  },
79
79
  "devDependencies": {
80
- "@sprucelabs/esm-postbuild": "^2.0.78",
80
+ "@sprucelabs/esm-postbuild": "^2.0.79",
81
81
  "@sprucelabs/jest-json-reporter": "^6.0.554",
82
- "@sprucelabs/resolve-path-aliases": "^1.1.169",
82
+ "@sprucelabs/resolve-path-aliases": "^1.1.170",
83
83
  "@sprucelabs/semantic-release": "^4.0.8",
84
- "@sprucelabs/test": "^7.7.414",
85
- "@sprucelabs/test-utils": "^3.2.105",
84
+ "@sprucelabs/test": "^7.7.415",
85
+ "@sprucelabs/test-utils": "^3.2.106",
86
86
  "@types/lodash": "^4.14.191",
87
87
  "@types/node": "^18.11.18",
88
88
  "chokidar-cli": "^3.0.0",
89
89
  "concurrently": "^7.6.0",
90
- "eslint": "^8.32.0",
90
+ "eslint": "^8.33.0",
91
91
  "eslint-config-spruce": "^10.12.0",
92
92
  "jest": "^29.4.1",
93
93
  "jest-circus": "^29.4.1",