ical-generator 8.0.1-develop.7 → 8.0.1-develop.8

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
@@ -129,5 +129,5 @@
129
129
  "test": "mocha"
130
130
  },
131
131
  "type": "module",
132
- "version": "8.0.1-develop.7"
132
+ "version": "8.0.1-develop.8"
133
133
  }
package/src/event.ts CHANGED
@@ -938,7 +938,7 @@ export default class ICalEvent {
938
938
  }
939
939
  if (location && (
940
940
  ('title' in location && !location.title) ||
941
- (location?.geo && (!isFinite(location.geo.lat) || !isFinite(location.geo.lon))) ||
941
+ (location?.geo && (typeof location.geo.lat !== 'number' || !isFinite(location.geo.lat) || typeof location.geo.lon !== 'number' || !isFinite(location.geo.lon))) ||
942
942
  (!('title' in location) && !location?.geo)
943
943
  )) {
944
944
  throw new Error(
@@ -1791,11 +1791,11 @@ export default class ICalEvent {
1791
1791
  }
1792
1792
 
1793
1793
  // GEO
1794
- if (this.data.location && 'geo' in this.data.location && this.data.location.geo) {
1795
- g += 'GEO:' + escape(this.data.location.geo?.lat, false) + ';' +
1796
- escape(this.data.location.geo?.lon, false) + '\r\n';
1794
+ if (this.data.location?.geo?.lat && this.data.location.geo.lon) {
1795
+ g += 'GEO:' + escape(this.data.location.geo.lat, false) + ';' +
1796
+ escape(this.data.location.geo.lon, false) + '\r\n';
1797
1797
  }
1798
-
1798
+
1799
1799
  // DESCRIPTION
1800
1800
  if (this.data.description) {
1801
1801
  g += 'DESCRIPTION:' + escape(this.data.description.plain, false) + '\r\n';