@hebcal/icalendar 4.14.3 → 4.15.1

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 (3) hide show
  1. package/dist/index.js +39 -166
  2. package/dist/index.mjs +24 -151
  3. package/package.json +14 -22
package/dist/index.js CHANGED
@@ -1,174 +1,34 @@
1
- /*! @hebcal/icalendar v4.14.3 */
1
+ /*! @hebcal/icalendar v4.15.1 */
2
2
  'use strict';
3
3
 
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
6
  var core = require('@hebcal/core');
7
+ var murmurhash3 = require('murmurhash3');
7
8
  var leyn = require('@hebcal/leyning');
8
9
  var fs = require('fs');
9
10
 
10
11
  function _interopNamespace(e) {
11
- if (e && e.__esModule) return e;
12
- var n = Object.create(null);
13
- if (e) {
14
- Object.keys(e).forEach(function (k) {
15
- if (k !== 'default') {
16
- var d = Object.getOwnPropertyDescriptor(e, k);
17
- Object.defineProperty(n, k, d.get ? d : {
18
- enumerable: true,
19
- get: function () { return e[k]; }
20
- });
21
- }
22
- });
23
- }
24
- n["default"] = e;
25
- return Object.freeze(n);
12
+ if (e && e.__esModule) return e;
13
+ var n = Object.create(null);
14
+ if (e) {
15
+ Object.keys(e).forEach(function (k) {
16
+ if (k !== 'default') {
17
+ var d = Object.getOwnPropertyDescriptor(e, k);
18
+ Object.defineProperty(n, k, d.get ? d : {
19
+ enumerable: true,
20
+ get: function () { return e[k]; }
21
+ });
22
+ }
23
+ });
24
+ }
25
+ n["default"] = e;
26
+ return Object.freeze(n);
26
27
  }
27
28
 
28
29
  var leyn__namespace = /*#__PURE__*/_interopNamespace(leyn);
29
30
 
30
- var murmurhashJs = {exports: {}};
31
-
32
- var murmurhash3_gc = {exports: {}};
33
-
34
- /**
35
- * JS Implementation of MurmurHash3 (r136) (as of May 20, 2011)
36
- *
37
- * @author <a href="mailto:gary.court@gmail.com">Gary Court</a>
38
- * @see http://github.com/garycourt/murmurhash-js
39
- * @author <a href="mailto:aappleby@gmail.com">Austin Appleby</a>
40
- * @see http://sites.google.com/site/murmurhash/
41
- *
42
- * @param {string} key ASCII only
43
- * @param {number} seed Positive integer only
44
- * @return {number} 32-bit positive integer hash
45
- */
46
-
47
- (function (module) {
48
- function murmurhash3_32_gc(key, seed) {
49
- var remainder, bytes, h1, h1b, c1, c2, k1, i;
50
-
51
- remainder = key.length & 3; // key.length % 4
52
- bytes = key.length - remainder;
53
- h1 = seed;
54
- c1 = 0xcc9e2d51;
55
- c2 = 0x1b873593;
56
- i = 0;
57
-
58
- while (i < bytes) {
59
- k1 =
60
- ((key.charCodeAt(i) & 0xff)) |
61
- ((key.charCodeAt(++i) & 0xff) << 8) |
62
- ((key.charCodeAt(++i) & 0xff) << 16) |
63
- ((key.charCodeAt(++i) & 0xff) << 24);
64
- ++i;
65
-
66
- k1 = ((((k1 & 0xffff) * c1) + ((((k1 >>> 16) * c1) & 0xffff) << 16))) & 0xffffffff;
67
- k1 = (k1 << 15) | (k1 >>> 17);
68
- k1 = ((((k1 & 0xffff) * c2) + ((((k1 >>> 16) * c2) & 0xffff) << 16))) & 0xffffffff;
69
-
70
- h1 ^= k1;
71
- h1 = (h1 << 13) | (h1 >>> 19);
72
- h1b = ((((h1 & 0xffff) * 5) + ((((h1 >>> 16) * 5) & 0xffff) << 16))) & 0xffffffff;
73
- h1 = (((h1b & 0xffff) + 0x6b64) + ((((h1b >>> 16) + 0xe654) & 0xffff) << 16));
74
- }
75
-
76
- k1 = 0;
77
-
78
- switch (remainder) {
79
- case 3: k1 ^= (key.charCodeAt(i + 2) & 0xff) << 16;
80
- case 2: k1 ^= (key.charCodeAt(i + 1) & 0xff) << 8;
81
- case 1: k1 ^= (key.charCodeAt(i) & 0xff);
82
-
83
- k1 = (((k1 & 0xffff) * c1) + ((((k1 >>> 16) * c1) & 0xffff) << 16)) & 0xffffffff;
84
- k1 = (k1 << 15) | (k1 >>> 17);
85
- k1 = (((k1 & 0xffff) * c2) + ((((k1 >>> 16) * c2) & 0xffff) << 16)) & 0xffffffff;
86
- h1 ^= k1;
87
- }
88
-
89
- h1 ^= key.length;
90
-
91
- h1 ^= h1 >>> 16;
92
- h1 = (((h1 & 0xffff) * 0x85ebca6b) + ((((h1 >>> 16) * 0x85ebca6b) & 0xffff) << 16)) & 0xffffffff;
93
- h1 ^= h1 >>> 13;
94
- h1 = ((((h1 & 0xffff) * 0xc2b2ae35) + ((((h1 >>> 16) * 0xc2b2ae35) & 0xffff) << 16))) & 0xffffffff;
95
- h1 ^= h1 >>> 16;
96
-
97
- return h1 >>> 0;
98
- }
99
-
100
- {
101
- module.exports = murmurhash3_32_gc;
102
- }
103
- }(murmurhash3_gc));
104
-
105
- var murmurhash2_gc = {exports: {}};
106
-
107
- /**
108
- * JS Implementation of MurmurHash2
109
- *
110
- * @author <a href="mailto:gary.court@gmail.com">Gary Court</a>
111
- * @see http://github.com/garycourt/murmurhash-js
112
- * @author <a href="mailto:aappleby@gmail.com">Austin Appleby</a>
113
- * @see http://sites.google.com/site/murmurhash/
114
- *
115
- * @param {string} str ASCII only
116
- * @param {number} seed Positive integer only
117
- * @return {number} 32-bit positive integer hash
118
- */
119
-
120
- (function (module) {
121
- function murmurhash2_32_gc(str, seed) {
122
- var
123
- l = str.length,
124
- h = seed ^ l,
125
- i = 0,
126
- k;
127
-
128
- while (l >= 4) {
129
- k =
130
- ((str.charCodeAt(i) & 0xff)) |
131
- ((str.charCodeAt(++i) & 0xff) << 8) |
132
- ((str.charCodeAt(++i) & 0xff) << 16) |
133
- ((str.charCodeAt(++i) & 0xff) << 24);
134
-
135
- k = (((k & 0xffff) * 0x5bd1e995) + ((((k >>> 16) * 0x5bd1e995) & 0xffff) << 16));
136
- k ^= k >>> 24;
137
- k = (((k & 0xffff) * 0x5bd1e995) + ((((k >>> 16) * 0x5bd1e995) & 0xffff) << 16));
138
-
139
- h = (((h & 0xffff) * 0x5bd1e995) + ((((h >>> 16) * 0x5bd1e995) & 0xffff) << 16)) ^ k;
140
-
141
- l -= 4;
142
- ++i;
143
- }
144
-
145
- switch (l) {
146
- case 3: h ^= (str.charCodeAt(i + 2) & 0xff) << 16;
147
- case 2: h ^= (str.charCodeAt(i + 1) & 0xff) << 8;
148
- case 1: h ^= (str.charCodeAt(i) & 0xff);
149
- h = (((h & 0xffff) * 0x5bd1e995) + ((((h >>> 16) * 0x5bd1e995) & 0xffff) << 16));
150
- }
151
-
152
- h ^= h >>> 13;
153
- h = (((h & 0xffff) * 0x5bd1e995) + ((((h >>> 16) * 0x5bd1e995) & 0xffff) << 16));
154
- h ^= h >>> 15;
155
-
156
- return h >>> 0;
157
- }
158
-
159
- {
160
- module.exports = murmurhash2_32_gc;
161
- }
162
- }(murmurhash2_gc));
163
-
164
- var murmur3 = murmurhash3_gc.exports;
165
- var murmur2 = murmurhash2_gc.exports;
166
-
167
- murmurhashJs.exports = murmur3;
168
- var murmur3_1 = murmurhashJs.exports.murmur3 = murmur3;
169
- murmurhashJs.exports.murmur2 = murmur2;
170
-
171
- /*! @hebcal/rest-api v3.8.6 */
31
+ /*! @hebcal/rest-api v3.12.0 */
172
32
 
173
33
  var Chanukah="Hanukkah, the Jewish festival of rededication. Also known as the Festival of Lights";var Pesach="Passover, the Feast of Unleavened Bread. Also called Chag HaMatzot (the Festival of Matzah), it commemorates the Exodus and freedom of the Israelites from ancient Egypt";var Purim="Celebration of Jewish deliverance as told by Megilat Esther. It commemorates a time when the Jewish people living in Persia were saved from extermination";var Shavuot="Festival of Weeks. Commemorates the giving of the Torah at Mount Sinai";var Sigd="Ethiopian Jewish holiday occurring 50 days after Yom Kippur";var Sukkot="Feast of Booths";var holidayDescription = {"Asara B'Tevet":"Fast commemorating the siege of Jerusalem",Chanukah:Chanukah,"Days of the Omer":"7 weeks from the second night of Pesach to the day before Shavuot","Lag BaOmer":"33rd day of counting the Omer","Leil Selichot":"Prayers for forgiveness in preparation for the High Holidays","Pesach Sheni":"Second Passover, one month after Passover",Pesach:Pesach,"Purim Katan":"Minor Purim celebration during Adar I on leap years",Purim:Purim,"Rosh Chodesh Nisan":"Start of month of Nisan on the Hebrew calendar. נִיסָן (transliterated Nisan or Nissan) is the 1st month of the Hebrew year, has 30 days, and corresponds to March or April on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon","Rosh Chodesh Iyyar":"Start of month of Iyyar on the Hebrew calendar. אִיָיר (transliterated Iyyar or Iyar) is the 2nd month of the Hebrew year, has 29 days, and corresponds to April or May on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon","Rosh Chodesh Sivan":"Start of month of Sivan on the Hebrew calendar. Sivan (סִיוָן) is the 3rd month of the Hebrew year, has 30 days, and corresponds to May or June on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon","Rosh Chodesh Tamuz":"Start of month of Tamuz on the Hebrew calendar. תַּמּוּז (transliterated Tamuz or Tammuz) is the 4th month of the Hebrew year, has 29 days, and corresponds to June or July on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon","Rosh Chodesh Av":"Start of month of Av on the Hebrew calendar. Av (אָב) is the 5th month of the Hebrew year, has 30 days, and corresponds to July or August on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon","Rosh Chodesh Elul":"Start of month of Elul on the Hebrew calendar. Elul (אֱלוּל) is the 6th month of the Hebrew year, has 29 days, and corresponds to August or September on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon","Rosh Chodesh Cheshvan":"Start of month of Cheshvan on the Hebrew calendar. חֶשְׁוָן (transliterated Cheshvan or Heshvan) is the 8th month of the Hebrew year, has 29 or 30 days, and corresponds to October or November on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon","Rosh Chodesh Kislev":"Start of month of Kislev on the Hebrew calendar. Kislev (כִּסְלֵו) is the 9th month of the Hebrew year, has 30 or 29 days, and corresponds to November or December on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon","Rosh Chodesh Tevet":"Start of month of Tevet on the Hebrew calendar. Tevet (טֵבֵת) is the 10th month of the Hebrew year, has 29 days, and corresponds to December or January on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon","Rosh Chodesh Sh'vat":"Start of month of Sh'vat on the Hebrew calendar. שְׁבָט (transliterated Sh'vat or Shevat) is the 11th month of the Hebrew year, has 30 days, and corresponds to January or February on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon","Rosh Chodesh Adar":"Start of month of Adar on the Hebrew calendar. Adar (אַדָר) is the 12th month of the Hebrew year, has 29 days, and corresponds to February or March on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon","Rosh Chodesh Adar I":"Start of month of Adar I (on leap years) on the Hebrew calendar. Adar I (אַדָר א׳) is the 12th month of the Hebrew year, occurs only on leap years, has 30 days, and corresponds to February or March on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon","Rosh Chodesh Adar II":"Start of month of Adar II (on leap years) on the Hebrew calendar. Adar II (אַדָר ב׳), sometimes \"Adar Bet\" or \"Adar Sheni\", is the 13th month of the Hebrew year, has 29 days, occurs only on leap years, and corresponds to February or March on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon","Rosh Hashana":"The Jewish New Year. Also spelled Rosh Hashanah","Rosh Hashana LaBehemot":"New Year for Tithing Animals","Shabbat Chazon":"Shabbat before Tish'a B'Av (Shabbat of Prophecy/Shabbat of Vision)","Shabbat HaChodesh":"Shabbat before Rosh Chodesh Nissan","Shabbat HaGadol":"Shabbat before Pesach","Shabbat Machar Chodesh":"When Shabbat falls the day before Rosh Chodesh","Shabbat Nachamu":"Shabbat after Tish'a B'Av (Shabbat of Consolation). The first of seven Shabbatot leading up to Rosh Hashanah. Named after the Haftarah (from Isaiah 40) which begins with the verse נַחֲמוּ נַחֲמוּ, עַמִּי (\"Comfort, oh comfort my people\")","Shabbat Parah":"Shabbat of the Red Heifer","Shabbat Rosh Chodesh":"When Shabbat falls on Rosh Chodesh","Shabbat Shekalim":"Shabbat before Rosh Chodesh Adar","Shabbat Shirah":"Shabbat of Song","Shabbat Shuva":"Shabbat that falls between Rosh Hashanah and Yom Kippur (Shabbat of Returning)","Shabbat Zachor":"Shabbat before Purim",Shavuot:Shavuot,"Shmini Atzeret":"Eighth Day of Assembly","Shushan Purim":"Purim celebrated in Jerusalem and walled cities",Sigd:Sigd,"Simchat Torah":"Day of Celebrating the Torah",Sukkot:Sukkot,"Ta'anit Bechorot":"Fast of the First Born","Ta'anit Esther":"Fast of Esther","Tish'a B'Av":"The Ninth of Av. Fast commemorating the destruction of the two Temples","Tu B'Av":"Minor Jewish holiday of love. Observed on the 15th day of the Hebrew month of Av","Tu BiShvat":"New Year for Trees","Tzom Gedaliah":"Fast of the Seventh Month. Commemorates the assassination of the Jewish governor of Judah","Tzom Tammuz":"Fast commemorating breaching of the walls of Jerusalem before the destruction of the Second Temple","Yom HaAliyah":"Recognizes Aliyah, immigration to the Jewish State of Israel","Yom HaAliyah School Observance":"Aliyah Day observed in Israeli schools","Yom HaAtzma'ut":"Israeli Independence Day. Commemorates the declaration of independence of Israel in 1948. Note that Hebcal displays modern holidays like Yom HaAtzma'ut according to the Israeli schedule. Although Yom HaAtzma'ut is normally observed on the 5th of Iyyar, it may be moved earlier or postponed if observance of the holiday (or Yom HaZikaron, which always precedes it) would conflict with Shabbat","Yom HaShoah":"Holocaust Memorial Day","Yom HaZikaron":"Israeli Memorial Day. Note that Hebcal displays modern holidays like Yom HaZikaron according to the Israeli schedule. Although Yom Hazikaron is normally observed on the 4th of Iyyar, it may be moved earlier or postponed if observance of the holiday (or Yom HaAtzma'ut, which always follows it) would conflict with Shabbat","Yom Kippur":"Day of Atonement","Yom Yerushalayim":"Jerusalem Day. Commemorates the re-unification of Jerusalem in 1967"};
174
34
 
@@ -267,6 +127,9 @@ function getEventCategories(ev) {
267
127
 
268
128
  case core.flags.MINOR_HOLIDAY:
269
129
  return ['holiday', 'minor'];
130
+
131
+ case core.flags.MISHNA_YOMI:
132
+ return ['mishnayomi'];
270
133
  // fall through to string-based category
271
134
  }
272
135
 
@@ -322,6 +185,10 @@ function getCalendarTitle(events, options) {
322
185
  title += ' Diaspora';
323
186
  }
324
187
 
188
+ if (options.subscribe == '1') {
189
+ return title;
190
+ }
191
+
325
192
  if (options.isHebrewYear || events.length == 0) {
326
193
  title += ' ' + options.year;
327
194
  } else {
@@ -447,12 +314,13 @@ function shouldRenderBrief(ev) {
447
314
  }
448
315
  }
449
316
 
450
- var version="4.14.3";
317
+ var version="4.15.1";
451
318
 
452
319
  const VTIMEZONE = {};
453
320
  const CATEGORY = {
454
321
  candles: 'Holiday',
455
322
  dafyomi: 'Daf Yomi',
323
+ mishnayomi: 'Mishna Yomi',
456
324
  havdalah: 'Holiday',
457
325
  hebdate: null,
458
326
  holiday: 'Holiday',
@@ -521,6 +389,8 @@ class IcalEvent {
521
389
  this.locationName = ev.locationName;
522
390
  } else if (mask & core.flags.DAF_YOMI) {
523
391
  this.locationName = core.Locale.gettext('Daf Yomi');
392
+ } else if (mask & core.flags.MISHNA_YOMI) {
393
+ this.locationName = core.Locale.gettext('Mishna Yomi');
524
394
  } else if (timed && options.location && options.location.name) {
525
395
  const comma = options.location.name.indexOf(',');
526
396
  this.locationName = comma == -1 ? options.location.name : options.location.name.substring(0, comma);
@@ -590,14 +460,13 @@ class IcalEvent {
590
460
  this.category = ev.category || CATEGORY[getEventCategories(ev)[0]];
591
461
  }
592
462
  /**
593
- * @private
594
463
  * @return {string}
595
464
  */
596
465
 
597
466
 
598
467
  getUid() {
599
468
  const options = this.options;
600
- const digest = murmur3_1(this.ev.getDesc()).toString(16);
469
+ const digest = murmurhash3.murmur32HexSync(this.ev.getDesc());
601
470
  let uid = `hebcal-${this.startDate}-${digest}`;
602
471
 
603
472
  if (this.timed && options.location) {
@@ -696,17 +565,21 @@ class IcalEvent {
696
565
 
697
566
  let result = '';
698
567
  let current = '';
568
+ let len = 0;
699
569
 
700
570
  for (let i = 0; i < line.length; i++) {
701
- const candidate = current + line[i];
702
- const len = encoder.encode(candidate).length;
571
+ const char = line[i];
572
+ const octets = char.charCodeAt(0) < 256 ? 1 : encoder.encode(char).length;
573
+ const newlen = len + octets;
703
574
 
704
- if (len < 75) {
705
- current = candidate;
575
+ if (newlen < 75) {
576
+ current += char;
577
+ len = newlen;
706
578
  } else {
707
579
  result += current + '\r\n ';
708
580
  line = line.substring(i);
709
581
  current = '';
582
+ len = 0;
710
583
  i = -1;
711
584
  }
712
585
  }
@@ -770,7 +643,7 @@ function eventToIcal(ev, options) {
770
643
  return ical.toString();
771
644
  }
772
645
  const torahMemoCache = new Map();
773
- const HOLIDAY_IGNORE_MASK = core.flags.DAF_YOMI | core.flags.OMER_COUNT | core.flags.SHABBAT_MEVARCHIM | core.flags.MOLAD | core.flags.USER_EVENT | core.flags.HEBREW_DATE;
646
+ const HOLIDAY_IGNORE_MASK = core.flags.DAF_YOMI | core.flags.OMER_COUNT | core.flags.SHABBAT_MEVARCHIM | core.flags.MOLAD | core.flags.USER_EVENT | core.flags.MISHNA_YOMI | core.flags.HEBREW_DATE;
774
647
  /**
775
648
  * @private
776
649
  * @param {Event} ev
package/dist/index.mjs CHANGED
@@ -1,150 +1,10 @@
1
- /*! @hebcal/icalendar v4.14.3 */
1
+ /*! @hebcal/icalendar v4.15.1 */
2
2
  import { flags, Locale } from '@hebcal/core';
3
+ import { murmur32HexSync } from 'murmurhash3';
3
4
  import * as leyn from '@hebcal/leyning';
4
5
  import { promises } from 'fs';
5
6
 
6
- var murmurhashJs = {exports: {}};
7
-
8
- var murmurhash3_gc = {exports: {}};
9
-
10
- /**
11
- * JS Implementation of MurmurHash3 (r136) (as of May 20, 2011)
12
- *
13
- * @author <a href="mailto:gary.court@gmail.com">Gary Court</a>
14
- * @see http://github.com/garycourt/murmurhash-js
15
- * @author <a href="mailto:aappleby@gmail.com">Austin Appleby</a>
16
- * @see http://sites.google.com/site/murmurhash/
17
- *
18
- * @param {string} key ASCII only
19
- * @param {number} seed Positive integer only
20
- * @return {number} 32-bit positive integer hash
21
- */
22
-
23
- (function (module) {
24
- function murmurhash3_32_gc(key, seed) {
25
- var remainder, bytes, h1, h1b, c1, c2, k1, i;
26
-
27
- remainder = key.length & 3; // key.length % 4
28
- bytes = key.length - remainder;
29
- h1 = seed;
30
- c1 = 0xcc9e2d51;
31
- c2 = 0x1b873593;
32
- i = 0;
33
-
34
- while (i < bytes) {
35
- k1 =
36
- ((key.charCodeAt(i) & 0xff)) |
37
- ((key.charCodeAt(++i) & 0xff) << 8) |
38
- ((key.charCodeAt(++i) & 0xff) << 16) |
39
- ((key.charCodeAt(++i) & 0xff) << 24);
40
- ++i;
41
-
42
- k1 = ((((k1 & 0xffff) * c1) + ((((k1 >>> 16) * c1) & 0xffff) << 16))) & 0xffffffff;
43
- k1 = (k1 << 15) | (k1 >>> 17);
44
- k1 = ((((k1 & 0xffff) * c2) + ((((k1 >>> 16) * c2) & 0xffff) << 16))) & 0xffffffff;
45
-
46
- h1 ^= k1;
47
- h1 = (h1 << 13) | (h1 >>> 19);
48
- h1b = ((((h1 & 0xffff) * 5) + ((((h1 >>> 16) * 5) & 0xffff) << 16))) & 0xffffffff;
49
- h1 = (((h1b & 0xffff) + 0x6b64) + ((((h1b >>> 16) + 0xe654) & 0xffff) << 16));
50
- }
51
-
52
- k1 = 0;
53
-
54
- switch (remainder) {
55
- case 3: k1 ^= (key.charCodeAt(i + 2) & 0xff) << 16;
56
- case 2: k1 ^= (key.charCodeAt(i + 1) & 0xff) << 8;
57
- case 1: k1 ^= (key.charCodeAt(i) & 0xff);
58
-
59
- k1 = (((k1 & 0xffff) * c1) + ((((k1 >>> 16) * c1) & 0xffff) << 16)) & 0xffffffff;
60
- k1 = (k1 << 15) | (k1 >>> 17);
61
- k1 = (((k1 & 0xffff) * c2) + ((((k1 >>> 16) * c2) & 0xffff) << 16)) & 0xffffffff;
62
- h1 ^= k1;
63
- }
64
-
65
- h1 ^= key.length;
66
-
67
- h1 ^= h1 >>> 16;
68
- h1 = (((h1 & 0xffff) * 0x85ebca6b) + ((((h1 >>> 16) * 0x85ebca6b) & 0xffff) << 16)) & 0xffffffff;
69
- h1 ^= h1 >>> 13;
70
- h1 = ((((h1 & 0xffff) * 0xc2b2ae35) + ((((h1 >>> 16) * 0xc2b2ae35) & 0xffff) << 16))) & 0xffffffff;
71
- h1 ^= h1 >>> 16;
72
-
73
- return h1 >>> 0;
74
- }
75
-
76
- {
77
- module.exports = murmurhash3_32_gc;
78
- }
79
- }(murmurhash3_gc));
80
-
81
- var murmurhash2_gc = {exports: {}};
82
-
83
- /**
84
- * JS Implementation of MurmurHash2
85
- *
86
- * @author <a href="mailto:gary.court@gmail.com">Gary Court</a>
87
- * @see http://github.com/garycourt/murmurhash-js
88
- * @author <a href="mailto:aappleby@gmail.com">Austin Appleby</a>
89
- * @see http://sites.google.com/site/murmurhash/
90
- *
91
- * @param {string} str ASCII only
92
- * @param {number} seed Positive integer only
93
- * @return {number} 32-bit positive integer hash
94
- */
95
-
96
- (function (module) {
97
- function murmurhash2_32_gc(str, seed) {
98
- var
99
- l = str.length,
100
- h = seed ^ l,
101
- i = 0,
102
- k;
103
-
104
- while (l >= 4) {
105
- k =
106
- ((str.charCodeAt(i) & 0xff)) |
107
- ((str.charCodeAt(++i) & 0xff) << 8) |
108
- ((str.charCodeAt(++i) & 0xff) << 16) |
109
- ((str.charCodeAt(++i) & 0xff) << 24);
110
-
111
- k = (((k & 0xffff) * 0x5bd1e995) + ((((k >>> 16) * 0x5bd1e995) & 0xffff) << 16));
112
- k ^= k >>> 24;
113
- k = (((k & 0xffff) * 0x5bd1e995) + ((((k >>> 16) * 0x5bd1e995) & 0xffff) << 16));
114
-
115
- h = (((h & 0xffff) * 0x5bd1e995) + ((((h >>> 16) * 0x5bd1e995) & 0xffff) << 16)) ^ k;
116
-
117
- l -= 4;
118
- ++i;
119
- }
120
-
121
- switch (l) {
122
- case 3: h ^= (str.charCodeAt(i + 2) & 0xff) << 16;
123
- case 2: h ^= (str.charCodeAt(i + 1) & 0xff) << 8;
124
- case 1: h ^= (str.charCodeAt(i) & 0xff);
125
- h = (((h & 0xffff) * 0x5bd1e995) + ((((h >>> 16) * 0x5bd1e995) & 0xffff) << 16));
126
- }
127
-
128
- h ^= h >>> 13;
129
- h = (((h & 0xffff) * 0x5bd1e995) + ((((h >>> 16) * 0x5bd1e995) & 0xffff) << 16));
130
- h ^= h >>> 15;
131
-
132
- return h >>> 0;
133
- }
134
-
135
- {
136
- module.exports = murmurhash2_32_gc;
137
- }
138
- }(murmurhash2_gc));
139
-
140
- var murmur3 = murmurhash3_gc.exports;
141
- var murmur2 = murmurhash2_gc.exports;
142
-
143
- murmurhashJs.exports = murmur3;
144
- var murmur3_1 = murmurhashJs.exports.murmur3 = murmur3;
145
- murmurhashJs.exports.murmur2 = murmur2;
146
-
147
- /*! @hebcal/rest-api v3.8.6 */
7
+ /*! @hebcal/rest-api v3.12.0 */
148
8
 
149
9
  var Chanukah="Hanukkah, the Jewish festival of rededication. Also known as the Festival of Lights";var Pesach="Passover, the Feast of Unleavened Bread. Also called Chag HaMatzot (the Festival of Matzah), it commemorates the Exodus and freedom of the Israelites from ancient Egypt";var Purim="Celebration of Jewish deliverance as told by Megilat Esther. It commemorates a time when the Jewish people living in Persia were saved from extermination";var Shavuot="Festival of Weeks. Commemorates the giving of the Torah at Mount Sinai";var Sigd="Ethiopian Jewish holiday occurring 50 days after Yom Kippur";var Sukkot="Feast of Booths";var holidayDescription = {"Asara B'Tevet":"Fast commemorating the siege of Jerusalem",Chanukah:Chanukah,"Days of the Omer":"7 weeks from the second night of Pesach to the day before Shavuot","Lag BaOmer":"33rd day of counting the Omer","Leil Selichot":"Prayers for forgiveness in preparation for the High Holidays","Pesach Sheni":"Second Passover, one month after Passover",Pesach:Pesach,"Purim Katan":"Minor Purim celebration during Adar I on leap years",Purim:Purim,"Rosh Chodesh Nisan":"Start of month of Nisan on the Hebrew calendar. נִיסָן (transliterated Nisan or Nissan) is the 1st month of the Hebrew year, has 30 days, and corresponds to March or April on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon","Rosh Chodesh Iyyar":"Start of month of Iyyar on the Hebrew calendar. אִיָיר (transliterated Iyyar or Iyar) is the 2nd month of the Hebrew year, has 29 days, and corresponds to April or May on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon","Rosh Chodesh Sivan":"Start of month of Sivan on the Hebrew calendar. Sivan (סִיוָן) is the 3rd month of the Hebrew year, has 30 days, and corresponds to May or June on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon","Rosh Chodesh Tamuz":"Start of month of Tamuz on the Hebrew calendar. תַּמּוּז (transliterated Tamuz or Tammuz) is the 4th month of the Hebrew year, has 29 days, and corresponds to June or July on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon","Rosh Chodesh Av":"Start of month of Av on the Hebrew calendar. Av (אָב) is the 5th month of the Hebrew year, has 30 days, and corresponds to July or August on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon","Rosh Chodesh Elul":"Start of month of Elul on the Hebrew calendar. Elul (אֱלוּל) is the 6th month of the Hebrew year, has 29 days, and corresponds to August or September on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon","Rosh Chodesh Cheshvan":"Start of month of Cheshvan on the Hebrew calendar. חֶשְׁוָן (transliterated Cheshvan or Heshvan) is the 8th month of the Hebrew year, has 29 or 30 days, and corresponds to October or November on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon","Rosh Chodesh Kislev":"Start of month of Kislev on the Hebrew calendar. Kislev (כִּסְלֵו) is the 9th month of the Hebrew year, has 30 or 29 days, and corresponds to November or December on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon","Rosh Chodesh Tevet":"Start of month of Tevet on the Hebrew calendar. Tevet (טֵבֵת) is the 10th month of the Hebrew year, has 29 days, and corresponds to December or January on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon","Rosh Chodesh Sh'vat":"Start of month of Sh'vat on the Hebrew calendar. שְׁבָט (transliterated Sh'vat or Shevat) is the 11th month of the Hebrew year, has 30 days, and corresponds to January or February on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon","Rosh Chodesh Adar":"Start of month of Adar on the Hebrew calendar. Adar (אַדָר) is the 12th month of the Hebrew year, has 29 days, and corresponds to February or March on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon","Rosh Chodesh Adar I":"Start of month of Adar I (on leap years) on the Hebrew calendar. Adar I (אַדָר א׳) is the 12th month of the Hebrew year, occurs only on leap years, has 30 days, and corresponds to February or March on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon","Rosh Chodesh Adar II":"Start of month of Adar II (on leap years) on the Hebrew calendar. Adar II (אַדָר ב׳), sometimes \"Adar Bet\" or \"Adar Sheni\", is the 13th month of the Hebrew year, has 29 days, occurs only on leap years, and corresponds to February or March on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon","Rosh Hashana":"The Jewish New Year. Also spelled Rosh Hashanah","Rosh Hashana LaBehemot":"New Year for Tithing Animals","Shabbat Chazon":"Shabbat before Tish'a B'Av (Shabbat of Prophecy/Shabbat of Vision)","Shabbat HaChodesh":"Shabbat before Rosh Chodesh Nissan","Shabbat HaGadol":"Shabbat before Pesach","Shabbat Machar Chodesh":"When Shabbat falls the day before Rosh Chodesh","Shabbat Nachamu":"Shabbat after Tish'a B'Av (Shabbat of Consolation). The first of seven Shabbatot leading up to Rosh Hashanah. Named after the Haftarah (from Isaiah 40) which begins with the verse נַחֲמוּ נַחֲמוּ, עַמִּי (\"Comfort, oh comfort my people\")","Shabbat Parah":"Shabbat of the Red Heifer","Shabbat Rosh Chodesh":"When Shabbat falls on Rosh Chodesh","Shabbat Shekalim":"Shabbat before Rosh Chodesh Adar","Shabbat Shirah":"Shabbat of Song","Shabbat Shuva":"Shabbat that falls between Rosh Hashanah and Yom Kippur (Shabbat of Returning)","Shabbat Zachor":"Shabbat before Purim",Shavuot:Shavuot,"Shmini Atzeret":"Eighth Day of Assembly","Shushan Purim":"Purim celebrated in Jerusalem and walled cities",Sigd:Sigd,"Simchat Torah":"Day of Celebrating the Torah",Sukkot:Sukkot,"Ta'anit Bechorot":"Fast of the First Born","Ta'anit Esther":"Fast of Esther","Tish'a B'Av":"The Ninth of Av. Fast commemorating the destruction of the two Temples","Tu B'Av":"Minor Jewish holiday of love. Observed on the 15th day of the Hebrew month of Av","Tu BiShvat":"New Year for Trees","Tzom Gedaliah":"Fast of the Seventh Month. Commemorates the assassination of the Jewish governor of Judah","Tzom Tammuz":"Fast commemorating breaching of the walls of Jerusalem before the destruction of the Second Temple","Yom HaAliyah":"Recognizes Aliyah, immigration to the Jewish State of Israel","Yom HaAliyah School Observance":"Aliyah Day observed in Israeli schools","Yom HaAtzma'ut":"Israeli Independence Day. Commemorates the declaration of independence of Israel in 1948. Note that Hebcal displays modern holidays like Yom HaAtzma'ut according to the Israeli schedule. Although Yom HaAtzma'ut is normally observed on the 5th of Iyyar, it may be moved earlier or postponed if observance of the holiday (or Yom HaZikaron, which always precedes it) would conflict with Shabbat","Yom HaShoah":"Holocaust Memorial Day","Yom HaZikaron":"Israeli Memorial Day. Note that Hebcal displays modern holidays like Yom HaZikaron according to the Israeli schedule. Although Yom Hazikaron is normally observed on the 4th of Iyyar, it may be moved earlier or postponed if observance of the holiday (or Yom HaAtzma'ut, which always follows it) would conflict with Shabbat","Yom Kippur":"Day of Atonement","Yom Yerushalayim":"Jerusalem Day. Commemorates the re-unification of Jerusalem in 1967"};
150
10
 
@@ -243,6 +103,9 @@ function getEventCategories(ev) {
243
103
 
244
104
  case flags.MINOR_HOLIDAY:
245
105
  return ['holiday', 'minor'];
106
+
107
+ case flags.MISHNA_YOMI:
108
+ return ['mishnayomi'];
246
109
  // fall through to string-based category
247
110
  }
248
111
 
@@ -298,6 +161,10 @@ function getCalendarTitle(events, options) {
298
161
  title += ' Diaspora';
299
162
  }
300
163
 
164
+ if (options.subscribe == '1') {
165
+ return title;
166
+ }
167
+
301
168
  if (options.isHebrewYear || events.length == 0) {
302
169
  title += ' ' + options.year;
303
170
  } else {
@@ -423,12 +290,13 @@ function shouldRenderBrief(ev) {
423
290
  }
424
291
  }
425
292
 
426
- var version="4.14.3";
293
+ var version="4.15.1";
427
294
 
428
295
  const VTIMEZONE = {};
429
296
  const CATEGORY = {
430
297
  candles: 'Holiday',
431
298
  dafyomi: 'Daf Yomi',
299
+ mishnayomi: 'Mishna Yomi',
432
300
  havdalah: 'Holiday',
433
301
  hebdate: null,
434
302
  holiday: 'Holiday',
@@ -497,6 +365,8 @@ class IcalEvent {
497
365
  this.locationName = ev.locationName;
498
366
  } else if (mask & flags.DAF_YOMI) {
499
367
  this.locationName = Locale.gettext('Daf Yomi');
368
+ } else if (mask & flags.MISHNA_YOMI) {
369
+ this.locationName = Locale.gettext('Mishna Yomi');
500
370
  } else if (timed && options.location && options.location.name) {
501
371
  const comma = options.location.name.indexOf(',');
502
372
  this.locationName = comma == -1 ? options.location.name : options.location.name.substring(0, comma);
@@ -566,14 +436,13 @@ class IcalEvent {
566
436
  this.category = ev.category || CATEGORY[getEventCategories(ev)[0]];
567
437
  }
568
438
  /**
569
- * @private
570
439
  * @return {string}
571
440
  */
572
441
 
573
442
 
574
443
  getUid() {
575
444
  const options = this.options;
576
- const digest = murmur3_1(this.ev.getDesc()).toString(16);
445
+ const digest = murmur32HexSync(this.ev.getDesc());
577
446
  let uid = `hebcal-${this.startDate}-${digest}`;
578
447
 
579
448
  if (this.timed && options.location) {
@@ -672,17 +541,21 @@ class IcalEvent {
672
541
 
673
542
  let result = '';
674
543
  let current = '';
544
+ let len = 0;
675
545
 
676
546
  for (let i = 0; i < line.length; i++) {
677
- const candidate = current + line[i];
678
- const len = encoder.encode(candidate).length;
547
+ const char = line[i];
548
+ const octets = char.charCodeAt(0) < 256 ? 1 : encoder.encode(char).length;
549
+ const newlen = len + octets;
679
550
 
680
- if (len < 75) {
681
- current = candidate;
551
+ if (newlen < 75) {
552
+ current += char;
553
+ len = newlen;
682
554
  } else {
683
555
  result += current + '\r\n ';
684
556
  line = line.substring(i);
685
557
  current = '';
558
+ len = 0;
686
559
  i = -1;
687
560
  }
688
561
  }
@@ -746,7 +619,7 @@ function eventToIcal(ev, options) {
746
619
  return ical.toString();
747
620
  }
748
621
  const torahMemoCache = new Map();
749
- const HOLIDAY_IGNORE_MASK = flags.DAF_YOMI | flags.OMER_COUNT | flags.SHABBAT_MEVARCHIM | flags.MOLAD | flags.USER_EVENT | flags.HEBREW_DATE;
622
+ const HOLIDAY_IGNORE_MASK = flags.DAF_YOMI | flags.OMER_COUNT | flags.SHABBAT_MEVARCHIM | flags.MOLAD | flags.USER_EVENT | flags.MISHNA_YOMI | flags.HEBREW_DATE;
750
623
  /**
751
624
  * @private
752
625
  * @param {Event} ev
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hebcal/icalendar",
3
- "version": "4.14.3",
3
+ "version": "4.15.1",
4
4
  "author": "Michael J. Radwin (https://github.com/mjradwin)",
5
5
  "keywords": [
6
6
  "ical",
@@ -24,8 +24,9 @@
24
24
  "url": "https://github.com/hebcal/hebcal-icalendar/issues"
25
25
  },
26
26
  "dependencies": {
27
- "@hebcal/core": "^3.27.0",
28
- "@hebcal/rest-api": "^3.8.6"
27
+ "@hebcal/core": "^3.33.2",
28
+ "@hebcal/rest-api": "^3.12.0",
29
+ "murmurhash3": "^0.5.0"
29
30
  },
30
31
  "scripts": {
31
32
  "build": "rollup -c",
@@ -43,31 +44,22 @@
43
44
  "@babel/register",
44
45
  "regenerator-runtime/runtime"
45
46
  ],
46
- "babel": {
47
- "testOptions": {
48
- "presets": [
49
- "@babel/env"
50
- ]
51
- }
52
- },
53
47
  "inherit": true,
54
48
  "verbose": true
55
49
  },
56
50
  "devDependencies": {
57
- "@ava/babel": "^2.0.0",
58
- "@babel/core": "^7.15.8",
59
- "@babel/preset-env": "^7.15.8",
60
- "@babel/register": "^7.14.5",
51
+ "@babel/core": "^7.17.3",
52
+ "@babel/preset-env": "^7.16.11",
53
+ "@babel/register": "^7.17.0",
61
54
  "@rollup/plugin-babel": "^5.3.0",
62
- "@rollup/plugin-commonjs": "^20.0.0",
55
+ "@rollup/plugin-commonjs": "^21.0.1",
63
56
  "@rollup/plugin-json": "^4.1.0",
64
- "@rollup/plugin-node-resolve": "^13.0.6",
65
- "ava": "^3.15.0",
66
- "eslint": "^7.32.0",
57
+ "@rollup/plugin-node-resolve": "^13.1.3",
58
+ "ava": "^4.0.1",
59
+ "eslint": "^8.9.0",
67
60
  "eslint-config-google": "^0.14.0",
68
- "jsdoc": "^3.6.7",
69
- "jsdoc-to-markdown": "^7.1.0",
70
- "murmurhash-js": "^1.0.0",
71
- "rollup": "^2.58.0"
61
+ "jsdoc": "^3.6.10",
62
+ "jsdoc-to-markdown": "^7.1.1",
63
+ "rollup": "^2.67.2"
72
64
  }
73
65
  }