@hebcal/icalendar 4.18.5 → 4.19.0

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.18.5 */
1
+ /*! @hebcal/icalendar v4.19.0 */
2
2
  'use strict';
3
3
 
4
4
  var core = require('@hebcal/core');
@@ -6,13 +6,14 @@ var murmurhash3 = require('murmurhash3');
6
6
  var restApi = require('@hebcal/rest-api');
7
7
  var fs = require('fs');
8
8
 
9
- const version="4.18.5";
9
+ const version="4.19.0";
10
10
 
11
11
  const VTIMEZONE = {};
12
12
  const CATEGORY = {
13
13
  candles: 'Holiday',
14
14
  dafyomi: 'Daf Yomi',
15
15
  mishnayomi: 'Mishna Yomi',
16
+ nachyomi: 'Nach Yomi',
16
17
  yerushalmi: 'Yerushalmi Yomi',
17
18
  havdalah: 'Holiday',
18
19
  hebdate: null,
@@ -80,6 +81,8 @@ class IcalEvent {
80
81
  this.locationName = core.Locale.gettext('Daf Yomi');
81
82
  } else if (mask & core.flags.YERUSHALMI_YOMI) {
82
83
  this.locationName = core.Locale.gettext('Yerushalmi Yomi');
84
+ } else if (mask & core.flags.NACH_YOMI) {
85
+ this.locationName = core.Locale.gettext('Nach Yomi');
83
86
  } else if (mask & core.flags.MISHNA_YOMI) {
84
87
  this.locationName = core.Locale.gettext('Mishna Yomi');
85
88
  } else if (timed && options.location && options.location.name) {
@@ -143,6 +146,8 @@ class IcalEvent {
143
146
  const evAlarm = ev.alarm;
144
147
  if (typeof evAlarm === 'string') {
145
148
  return 'TRIGGER:' + evAlarm;
149
+ } else if (typeof evAlarm === 'boolean' && !evAlarm) {
150
+ return null;
146
151
  } else if (core.greg.isDate(evAlarm)) {
147
152
  evAlarm.setSeconds(0);
148
153
  return 'TRIGGER;VALUE=DATE-TIME:' + IcalEvent.makeDtstamp(evAlarm);
@@ -312,7 +317,7 @@ function eventToIcal(ev, options) {
312
317
  return ical.toString();
313
318
  }
314
319
  const torahMemoCache = new Map();
315
- 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.YERUSHALMI_YOMI | core.flags.HEBREW_DATE;
320
+ 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.YERUSHALMI_YOMI | core.flags.NACH_YOMI | core.flags.HEBREW_DATE;
316
321
 
317
322
  /**
318
323
  * @private
package/dist/index.mjs CHANGED
@@ -1,16 +1,17 @@
1
- /*! @hebcal/icalendar v4.18.5 */
1
+ /*! @hebcal/icalendar v4.19.0 */
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.18.5";
7
+ const version="4.19.0";
8
8
 
9
9
  const VTIMEZONE = {};
10
10
  const CATEGORY = {
11
11
  candles: 'Holiday',
12
12
  dafyomi: 'Daf Yomi',
13
13
  mishnayomi: 'Mishna Yomi',
14
+ nachyomi: 'Nach Yomi',
14
15
  yerushalmi: 'Yerushalmi Yomi',
15
16
  havdalah: 'Holiday',
16
17
  hebdate: null,
@@ -78,6 +79,8 @@ class IcalEvent {
78
79
  this.locationName = Locale.gettext('Daf Yomi');
79
80
  } else if (mask & flags.YERUSHALMI_YOMI) {
80
81
  this.locationName = Locale.gettext('Yerushalmi Yomi');
82
+ } else if (mask & flags.NACH_YOMI) {
83
+ this.locationName = Locale.gettext('Nach Yomi');
81
84
  } else if (mask & flags.MISHNA_YOMI) {
82
85
  this.locationName = Locale.gettext('Mishna Yomi');
83
86
  } else if (timed && options.location && options.location.name) {
@@ -141,6 +144,8 @@ class IcalEvent {
141
144
  const evAlarm = ev.alarm;
142
145
  if (typeof evAlarm === 'string') {
143
146
  return 'TRIGGER:' + evAlarm;
147
+ } else if (typeof evAlarm === 'boolean' && !evAlarm) {
148
+ return null;
144
149
  } else if (greg.isDate(evAlarm)) {
145
150
  evAlarm.setSeconds(0);
146
151
  return 'TRIGGER;VALUE=DATE-TIME:' + IcalEvent.makeDtstamp(evAlarm);
@@ -310,7 +315,7 @@ function eventToIcal(ev, options) {
310
315
  return ical.toString();
311
316
  }
312
317
  const torahMemoCache = new Map();
313
- const HOLIDAY_IGNORE_MASK = flags.DAF_YOMI | flags.OMER_COUNT | flags.SHABBAT_MEVARCHIM | flags.MOLAD | flags.USER_EVENT | flags.MISHNA_YOMI | flags.YERUSHALMI_YOMI | flags.HEBREW_DATE;
318
+ const HOLIDAY_IGNORE_MASK = flags.DAF_YOMI | flags.OMER_COUNT | flags.SHABBAT_MEVARCHIM | flags.MOLAD | flags.USER_EVENT | flags.MISHNA_YOMI | flags.YERUSHALMI_YOMI | flags.NACH_YOMI | flags.HEBREW_DATE;
314
319
 
315
320
  /**
316
321
  * @private
package/icalendar.d.ts CHANGED
@@ -1,20 +1,20 @@
1
1
  /// <reference types="node"/>
2
- import {HebrewCalendar, Event} from '@hebcal/core';
2
+ import {Event, CalOptions} from '@hebcal/core';
3
3
  declare module '@hebcal/icalendar' {
4
4
  /**
5
5
  * @returns multi-line result, delimited by \r\n
6
6
  */
7
- export function eventToIcal(e: Event, options: HebrewCalendar.Options): string;
7
+ export function eventToIcal(e: Event, options: CalOptions): string;
8
8
  /**
9
9
  * Renders an array of events as a full RFC 2445 iCalendar string
10
10
  * @returns multi-line result, delimited by \r\n
11
11
  */
12
- export async function eventsToIcalendar(events: Event[], options: HebrewCalendar.Options): string;
12
+ export function eventsToIcalendar(events: Event[], options: CalOptions): Promise<string>;
13
13
  /**
14
14
  * Generates an RFC 2445 iCalendar string from an array of IcalEvents
15
15
  * @returns multi-line result, delimited by \r\n
16
16
  */
17
- export async function icalEventsToString(icals: IcalEvent[], options: HebrewCalendar.Options): string;
17
+ export function icalEventsToString(icals: IcalEvent[], options: CalOptions): Promise<string>;
18
18
 
19
19
  /**
20
20
  * Represents an RFC 2445 iCalendar VEVENT
@@ -23,7 +23,7 @@ export class IcalEvent {
23
23
  /**
24
24
  * Builds an IcalEvent object from a Hebcal Event
25
25
  */
26
- constructor(ev: Event, options: HebrewCalendar.Options);
26
+ constructor(ev: Event, options: CalOptions);
27
27
  toString(): string;
28
28
  getLines(): string[];
29
29
  getLongLines(): string[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hebcal/icalendar",
3
- "version": "4.18.5",
3
+ "version": "4.19.0",
4
4
  "author": "Michael J. Radwin (https://github.com/mjradwin)",
5
5
  "keywords": [
6
6
  "ical",
@@ -11,6 +11,10 @@
11
11
  "description": "Jewish holidays and Hebrew calendar as iCalendar RFC 2445",
12
12
  "main": "dist/index.js",
13
13
  "module": "dist/index.mjs",
14
+ "exports": {
15
+ "import": "./dist/index.mjs",
16
+ "require": "./dist/index.js"
17
+ },
14
18
  "typings": "icalendar.d.ts",
15
19
  "files": [
16
20
  "dist",
@@ -24,8 +28,8 @@
24
28
  "url": "https://github.com/hebcal/hebcal-icalendar/issues"
25
29
  },
26
30
  "dependencies": {
27
- "@hebcal/core": "^3.46.5",
28
- "@hebcal/rest-api": "^4.3.8",
31
+ "@hebcal/core": "^3.49.0",
32
+ "@hebcal/rest-api": "^4.3.14",
29
33
  "murmurhash3": "^0.5.0"
30
34
  },
31
35
  "scripts": {
@@ -37,28 +41,20 @@
37
41
  },
38
42
  "license": "BSD-2-Clause",
39
43
  "ava": {
40
- "files": [
41
- "src/**/*.spec.js"
42
- ],
43
- "require": [
44
- "@babel/register",
45
- "regenerator-runtime/runtime"
46
- ],
47
- "inherit": true,
48
- "verbose": true
44
+ "require": ["@babel/register"]
49
45
  },
50
46
  "devDependencies": {
51
- "@babel/core": "^7.20.5",
47
+ "@babel/core": "^7.20.12",
52
48
  "@babel/preset-env": "^7.20.2",
53
49
  "@babel/register": "^7.18.9",
54
50
  "@rollup/plugin-babel": "^6.0.3",
55
- "@rollup/plugin-commonjs": "^23.0.3",
56
- "@rollup/plugin-json": "^5.0.2",
51
+ "@rollup/plugin-commonjs": "^24.0.0",
52
+ "@rollup/plugin-json": "^6.0.0",
57
53
  "ava": "^5.1.0",
58
- "eslint": "^8.28.0",
54
+ "eslint": "^8.31.0",
59
55
  "eslint-config-google": "^0.14.0",
60
56
  "jsdoc": "^4.0.0",
61
57
  "jsdoc-to-markdown": "^8.0.0",
62
- "rollup": "^3.5.1"
58
+ "rollup": "^3.9.1"
63
59
  }
64
60
  }