@hebcal/icalendar 4.19.0 → 4.20.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.
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! @hebcal/icalendar v4.19.0 */
1
+ /*! @hebcal/icalendar v4.20.1 */
2
2
  'use strict';
3
3
 
4
4
  var core = require('@hebcal/core');
@@ -6,7 +6,7 @@ var murmurhash3 = require('murmurhash3');
6
6
  var restApi = require('@hebcal/rest-api');
7
7
  var fs = require('fs');
8
8
 
9
- const version="4.19.0";
9
+ const version="4.20.1";
10
10
 
11
11
  const VTIMEZONE = {};
12
12
  const CATEGORY = {
@@ -389,7 +389,7 @@ function createMemo(e, options) {
389
389
  * Generates an RFC 2445 iCalendar string from an array of events
390
390
  * @param {Event[]} events
391
391
  * @param {HebrewCalendar.Options} options
392
- * @return {string}
392
+ * @return {Promise<string>}
393
393
  */
394
394
  async function eventsToIcalendar(events, options) {
395
395
  if (!events.length) throw new RangeError('Events can not be empty');
@@ -407,7 +407,7 @@ async function eventsToIcalendar(events, options) {
407
407
  * Generates an RFC 2445 iCalendar string from an array of IcalEvents
408
408
  * @param {IcalEvent[]} icals
409
409
  * @param {HebrewCalendar.Options} options
410
- * @return {string}
410
+ * @return {Promise<string>}
411
411
  */
412
412
  async function icalEventsToString(icals, options) {
413
413
  const stream = [];
@@ -416,9 +416,14 @@ async function icalEventsToString(icals, options) {
416
416
  opts.dtstamp = opts.dtstamp || IcalEvent.makeDtstamp(new Date());
417
417
  const title = opts.title ? IcalEvent.escape(opts.title) : 'Untitled';
418
418
  const caldesc = opts.caldesc ? IcalEvent.escape(opts.caldesc) : opts.yahrzeit ? 'Yahrzeits + Anniversaries from www.hebcal.com' : 'Jewish Holidays from www.hebcal.com';
419
- const publishedTTL = opts.publishedTTL || 'PT7D';
420
419
  const prodid = opts.prodid || `-//hebcal.com/NONSGML Hebcal Calendar v1${version}//${uclang}`;
421
- const preamble = ['BEGIN:VCALENDAR', 'VERSION:2.0', `PRODID:${prodid}`, 'CALSCALE:GREGORIAN', 'METHOD:PUBLISH', 'X-LOTUS-CHARSET:UTF-8', `X-PUBLISHED-TTL:${publishedTTL}`, `X-WR-CALNAME:${title}`, `X-WR-CALDESC:${caldesc}`];
420
+ const preamble = ['BEGIN:VCALENDAR', 'VERSION:2.0', `PRODID:${prodid}`, 'CALSCALE:GREGORIAN', 'METHOD:PUBLISH', 'X-LOTUS-CHARSET:UTF-8'];
421
+ if (opts.publishedTTL !== false) {
422
+ const publishedTTL = opts.publishedTTL || 'PT7D';
423
+ preamble.push(`X-PUBLISHED-TTL:${publishedTTL}`);
424
+ }
425
+ preamble.push(`X-WR-CALNAME:${title}`);
426
+ preamble.push(`X-WR-CALDESC:${caldesc}`);
422
427
  for (const line of preamble.map(IcalEvent.fold)) {
423
428
  stream.push(line);
424
429
  stream.push('\r\n');
package/dist/index.mjs CHANGED
@@ -1,10 +1,10 @@
1
- /*! @hebcal/icalendar v4.19.0 */
1
+ /*! @hebcal/icalendar v4.20.1 */
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
- const version="4.19.0";
7
+ const version="4.20.1";
8
8
 
9
9
  const VTIMEZONE = {};
10
10
  const CATEGORY = {
@@ -387,7 +387,7 @@ function createMemo(e, options) {
387
387
  * Generates an RFC 2445 iCalendar string from an array of events
388
388
  * @param {Event[]} events
389
389
  * @param {HebrewCalendar.Options} options
390
- * @return {string}
390
+ * @return {Promise<string>}
391
391
  */
392
392
  async function eventsToIcalendar(events, options) {
393
393
  if (!events.length) throw new RangeError('Events can not be empty');
@@ -405,7 +405,7 @@ async function eventsToIcalendar(events, options) {
405
405
  * Generates an RFC 2445 iCalendar string from an array of IcalEvents
406
406
  * @param {IcalEvent[]} icals
407
407
  * @param {HebrewCalendar.Options} options
408
- * @return {string}
408
+ * @return {Promise<string>}
409
409
  */
410
410
  async function icalEventsToString(icals, options) {
411
411
  const stream = [];
@@ -414,9 +414,14 @@ async function icalEventsToString(icals, options) {
414
414
  opts.dtstamp = opts.dtstamp || IcalEvent.makeDtstamp(new Date());
415
415
  const title = opts.title ? IcalEvent.escape(opts.title) : 'Untitled';
416
416
  const caldesc = opts.caldesc ? IcalEvent.escape(opts.caldesc) : opts.yahrzeit ? 'Yahrzeits + Anniversaries from www.hebcal.com' : 'Jewish Holidays from www.hebcal.com';
417
- const publishedTTL = opts.publishedTTL || 'PT7D';
418
417
  const prodid = opts.prodid || `-//hebcal.com/NONSGML Hebcal Calendar v1${version}//${uclang}`;
419
- const preamble = ['BEGIN:VCALENDAR', 'VERSION:2.0', `PRODID:${prodid}`, 'CALSCALE:GREGORIAN', 'METHOD:PUBLISH', 'X-LOTUS-CHARSET:UTF-8', `X-PUBLISHED-TTL:${publishedTTL}`, `X-WR-CALNAME:${title}`, `X-WR-CALDESC:${caldesc}`];
418
+ const preamble = ['BEGIN:VCALENDAR', 'VERSION:2.0', `PRODID:${prodid}`, 'CALSCALE:GREGORIAN', 'METHOD:PUBLISH', 'X-LOTUS-CHARSET:UTF-8'];
419
+ if (opts.publishedTTL !== false) {
420
+ const publishedTTL = opts.publishedTTL || 'PT7D';
421
+ preamble.push(`X-PUBLISHED-TTL:${publishedTTL}`);
422
+ }
423
+ preamble.push(`X-WR-CALNAME:${title}`);
424
+ preamble.push(`X-WR-CALDESC:${caldesc}`);
420
425
  for (const line of preamble.map(IcalEvent.fold)) {
421
426
  stream.push(line);
422
427
  stream.push('\r\n');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hebcal/icalendar",
3
- "version": "4.19.0",
3
+ "version": "4.20.1",
4
4
  "author": "Michael J. Radwin (https://github.com/mjradwin)",
5
5
  "keywords": [
6
6
  "ical",
@@ -28,8 +28,8 @@
28
28
  "url": "https://github.com/hebcal/hebcal-icalendar/issues"
29
29
  },
30
30
  "dependencies": {
31
- "@hebcal/core": "^3.49.0",
32
- "@hebcal/rest-api": "^4.3.14",
31
+ "@hebcal/core": "^4.1.1",
32
+ "@hebcal/rest-api": "^4.5.1",
33
33
  "murmurhash3": "^0.5.0"
34
34
  },
35
35
  "scripts": {
@@ -41,20 +41,23 @@
41
41
  },
42
42
  "license": "BSD-2-Clause",
43
43
  "ava": {
44
- "require": ["@babel/register"]
44
+ "require": [
45
+ "@babel/register"
46
+ ]
45
47
  },
46
48
  "devDependencies": {
47
- "@babel/core": "^7.20.12",
48
- "@babel/preset-env": "^7.20.2",
49
- "@babel/register": "^7.18.9",
49
+ "@babel/core": "^7.22.5",
50
+ "@babel/preset-env": "^7.22.5",
51
+ "@babel/register": "^7.22.5",
52
+ "@hebcal/learning": "^1.4.0",
50
53
  "@rollup/plugin-babel": "^6.0.3",
51
- "@rollup/plugin-commonjs": "^24.0.0",
54
+ "@rollup/plugin-commonjs": "^25.0.2",
52
55
  "@rollup/plugin-json": "^6.0.0",
53
- "ava": "^5.1.0",
54
- "eslint": "^8.31.0",
56
+ "ava": "^5.3.1",
57
+ "eslint": "^8.43.0",
55
58
  "eslint-config-google": "^0.14.0",
56
- "jsdoc": "^4.0.0",
59
+ "jsdoc": "^4.0.2",
57
60
  "jsdoc-to-markdown": "^8.0.0",
58
- "rollup": "^3.9.1"
61
+ "rollup": "^3.25.3"
59
62
  }
60
63
  }