react-timezone-select 3.2.5 → 3.2.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.
Files changed (2) hide show
  1. package/dist/index.js +6 -3
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -196,13 +196,16 @@ function useTimezoneSelect({
196
196
  return { tz, score };
197
197
  }).sort((a, b) => b.score - a.score)) == null ? void 0 : _a[0]) == null ? void 0 : _b.tz;
198
198
  };
199
+ function isObject(item) {
200
+ return typeof item === "object" && !Array.isArray(item) && item !== null;
201
+ }
199
202
  const parseTimezone = (zone) => {
200
- if (typeof zone === "object" && zone.value && zone.label)
201
- return zone;
202
203
  if (typeof zone === "string") {
203
204
  return options.find((tz) => tz.value === zone) || zone.indexOf("/") !== -1 && findFuzzyTz(zone);
204
- } else if (zone.value && !zone.label) {
205
+ } else if (isObject(zone) && !zone.label) {
205
206
  return options.find((tz) => tz.value === zone.value);
207
+ } else {
208
+ return zone;
206
209
  }
207
210
  };
208
211
  return { options, parseTimezone };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-timezone-select",
3
- "version": "3.2.5",
3
+ "version": "3.2.6",
4
4
  "description": "Usable, dynamic React Timezone Select",
5
5
  "author": "Nico Domino <yo@ndo.dev>",
6
6
  "homepage": "https://github.com/ndom91/react-timezone-select",