@hebcal/icalendar 5.0.2 → 5.0.4

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/dist/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
- /*! @hebcal/icalendar v5.0.2 */
1
+ /*! @hebcal/icalendar v5.0.4 */
2
2
  'use strict';
3
3
 
4
4
  var core = require('@hebcal/core');
@@ -7,9 +7,9 @@ var restApi = require('@hebcal/rest-api');
7
7
  var fs = require('fs');
8
8
 
9
9
  // DO NOT EDIT THIS AUTO-GENERATED FILE!
10
- const version = '5.0.2';
10
+ const version = '5.0.4';
11
11
 
12
- const VTIMEZONE = {};
12
+ const vtimezoneCache = new Map();
13
13
  const CATEGORY = {
14
14
  candles: 'Holiday',
15
15
  dafyomi: 'Daf Yomi',
@@ -494,8 +494,9 @@ async function icalEventsToString(icals, options) {
494
494
  const tzid = location?.getTzid();
495
495
  if (tzid) {
496
496
  stream.push(`X-WR-TIMEZONE;VALUE=TEXT:${tzid}\r\n`);
497
- if (VTIMEZONE[tzid]) {
498
- stream.push(VTIMEZONE[tzid]);
497
+ const vtz = vtimezoneCache.get(tzid);
498
+ if (typeof vtz === 'string') {
499
+ stream.push(vtz);
499
500
  stream.push('\r\n');
500
501
  } else {
501
502
  const vtimezoneFilename = `./zoneinfo/${tzid}.ics`;
@@ -506,7 +507,7 @@ async function icalEventsToString(icals, options) {
506
507
  const str = lines.slice(3, lines.length - 2).join('\r\n');
507
508
  stream.push(str);
508
509
  stream.push('\r\n');
509
- VTIMEZONE[tzid] = str; // cache for later
510
+ vtimezoneCache.set(tzid, str);
510
511
  } catch (error) {
511
512
  // ignore failure when no timezone definition to read
512
513
  }
package/dist/index.mjs CHANGED
@@ -1,13 +1,13 @@
1
- /*! @hebcal/icalendar v5.0.2 */
1
+ /*! @hebcal/icalendar v5.0.4 */
2
2
  import { flags, Locale, greg } from '@hebcal/core';
3
3
  import { murmur32HexSync } from 'murmurhash3';
4
4
  import { shouldRenderBrief, pad2, getEventCategories, makeAnchor, pad4, getHolidayDescription, getCalendarTitle, appendIsraelAndTracking, makeTorahMemoText } from '@hebcal/rest-api';
5
5
  import { promises } from 'fs';
6
6
 
7
7
  // DO NOT EDIT THIS AUTO-GENERATED FILE!
8
- const version = '5.0.2';
8
+ const version = '5.0.4';
9
9
 
10
- const VTIMEZONE = {};
10
+ const vtimezoneCache = new Map();
11
11
  const CATEGORY = {
12
12
  candles: 'Holiday',
13
13
  dafyomi: 'Daf Yomi',
@@ -492,8 +492,9 @@ async function icalEventsToString(icals, options) {
492
492
  const tzid = location?.getTzid();
493
493
  if (tzid) {
494
494
  stream.push(`X-WR-TIMEZONE;VALUE=TEXT:${tzid}\r\n`);
495
- if (VTIMEZONE[tzid]) {
496
- stream.push(VTIMEZONE[tzid]);
495
+ const vtz = vtimezoneCache.get(tzid);
496
+ if (typeof vtz === 'string') {
497
+ stream.push(vtz);
497
498
  stream.push('\r\n');
498
499
  } else {
499
500
  const vtimezoneFilename = `./zoneinfo/${tzid}.ics`;
@@ -504,7 +505,7 @@ async function icalEventsToString(icals, options) {
504
505
  const str = lines.slice(3, lines.length - 2).join('\r\n');
505
506
  stream.push(str);
506
507
  stream.push('\r\n');
507
- VTIMEZONE[tzid] = str; // cache for later
508
+ vtimezoneCache.set(tzid, str);
508
509
  } catch (error) {
509
510
  // ignore failure when no timezone definition to read
510
511
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hebcal/icalendar",
3
- "version": "5.0.2",
3
+ "version": "5.0.4",
4
4
  "author": "Michael J. Radwin (https://github.com/mjradwin)",
5
5
  "keywords": [
6
6
  "ical",
@@ -14,7 +14,8 @@
14
14
  "type": "module",
15
15
  "exports": {
16
16
  "import": "./dist/index.mjs",
17
- "require": "./dist/index.cjs"
17
+ "require": "./dist/index.cjs",
18
+ "types": "./icalendar.d.ts"
18
19
  },
19
20
  "typings": "icalendar.d.ts",
20
21
  "files": [
@@ -29,7 +30,7 @@
29
30
  "url": "https://github.com/hebcal/hebcal-icalendar/issues"
30
31
  },
31
32
  "dependencies": {
32
- "@hebcal/core": "^5.0.3",
33
+ "@hebcal/core": "^5.0.8",
33
34
  "@hebcal/rest-api": "^5.0.2",
34
35
  "murmurhash3": "^0.5.0"
35
36
  },
@@ -52,6 +53,6 @@
52
53
  "eslint-config-google": "^0.14.0",
53
54
  "jsdoc": "^4.0.2",
54
55
  "jsdoc-to-markdown": "^8.0.0",
55
- "rollup": "^4.9.1"
56
+ "rollup": "^4.9.5"
56
57
  }
57
58
  }