@timardex/cluemart-shared 1.2.97 → 1.2.99

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.
@@ -11,7 +11,7 @@ import {
11
11
  dateFormat,
12
12
  normalizeUrl,
13
13
  timeFormat
14
- } from "../chunk-TSO32GGI.mjs";
14
+ } from "../chunk-TP5T5JLJ.mjs";
15
15
  import {
16
16
  EnumEventDateStatus,
17
17
  EnumEventType,
package/dist/index.cjs CHANGED
@@ -667,18 +667,25 @@ var defaultRegion = {
667
667
  longitude: 174.7450494,
668
668
  longitudeDelta: 5
669
669
  };
670
+ var isIsoDateString = (value) => {
671
+ return typeof value === "string" && !isNaN(Date.parse(value));
672
+ };
670
673
  var removeTypename = (obj) => {
674
+ if (obj instanceof Date) {
675
+ return obj;
676
+ }
677
+ if (isIsoDateString(obj)) {
678
+ return obj;
679
+ }
671
680
  if (Array.isArray(obj)) {
672
- return obj.map((item) => removeTypename(item));
673
- } else if (obj !== null && typeof obj === "object") {
681
+ return obj.map(removeTypename);
682
+ }
683
+ if (obj !== null && typeof obj === "object") {
674
684
  const { __typename, ...cleanedObj } = obj;
675
- return Object.keys(cleanedObj).reduce(
676
- (acc, key) => {
677
- acc[key] = removeTypename(cleanedObj[key]);
678
- return acc;
679
- },
680
- {}
681
- );
685
+ return Object.keys(cleanedObj).reduce((acc, key) => {
686
+ acc[key] = removeTypename(cleanedObj[key]);
687
+ return acc;
688
+ }, {});
682
689
  }
683
690
  return obj;
684
691
  };