@hebcal/icalendar 7.0.4 → 7.0.5

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/icalendar.js CHANGED
@@ -1,4 +1,3 @@
1
- import { flags } from '@hebcal/core/dist/esm/event';
2
1
  import { Locale } from '@hebcal/core/dist/esm/locale';
3
2
  import { murmur32HexSync } from '@hebcal/murmurhash3';
4
3
  import { pad2, pad4, isDate } from '@hebcal/hdate';
@@ -54,11 +53,6 @@ function appendTrackingToUrl(url, options) {
54
53
  const utmCampaign = options.utmCampaign;
55
54
  return appendIsraelAndTracking(url, options.il, utmSource, utmMedium, utmCampaign);
56
55
  }
57
- const DAILY_LEARNING = flags.DAILY_LEARNING |
58
- flags.DAF_YOMI |
59
- flags.MISHNA_YOMI |
60
- flags.YERUSHALMI_YOMI |
61
- flags.NACH_YOMI;
62
56
  /** Formats a date-time string as `YYYYMMDDTHHMMSS` */
63
57
  function rfc5545DateTime(dt, hour, minute) {
64
58
  return IcalEvent.formatYYYYMMDD(dt) + 'T' + pad2(hour) + pad2(minute) + '00';
@@ -131,14 +125,14 @@ export class IcalEvent {
131
125
  let subj = shouldRenderBrief(ev)
132
126
  ? ev.renderBrief(locale)
133
127
  : ev.render(locale);
134
- const mask = ev.getFlags();
135
128
  if (ev0.locationName) {
136
129
  this.locationName = ev0.locationName;
137
130
  }
138
131
  else if (timed && location) {
139
132
  this.locationName = location.getShortName();
140
133
  }
141
- else if (mask & DAILY_LEARNING && ev0.category) {
134
+ else if (ev.hasAnyFlag('DAILY_LEARNING', 'DAF_YOMI', 'MISHNA_YOMI', 'YERUSHALMI_YOMI', 'NACH_YOMI') &&
135
+ ev0.category) {
142
136
  this.locationName = Locale.gettext(ev0.category, locale);
143
137
  }
144
138
  const hd = ev.getDate();
@@ -161,7 +155,7 @@ export class IcalEvent {
161
155
  // It's more compatible with everthing except ancient versions of
162
156
  // Lotus Notes circa 2004
163
157
  this.dtargs = ';VALUE=DATE';
164
- if (mask & flags.CHAG) {
158
+ if (ev.hasFlag('CHAG')) {
165
159
  this.transp = 'OPAQUE';
166
160
  this.busyStatus = 'OOF';
167
161
  }
@@ -169,7 +163,7 @@ export class IcalEvent {
169
163
  if (opts.emoji) {
170
164
  const prefix = ev.getEmoji();
171
165
  if (prefix) {
172
- if (mask & flags.OMER_COUNT) {
166
+ if (ev.hasFlag('OMER_COUNT')) {
173
167
  subj = subj + ' ' + prefix;
174
168
  }
175
169
  else {
@@ -192,7 +186,6 @@ export class IcalEvent {
192
186
  }
193
187
  getAlarm() {
194
188
  const ev = this.ev;
195
- const mask = ev.getFlags();
196
189
  const evAlarm = ev.alarm;
197
190
  if (typeof evAlarm === 'string') {
198
191
  return 'TRIGGER:' + evAlarm;
@@ -205,10 +198,10 @@ export class IcalEvent {
205
198
  alarmDt.setSeconds(0);
206
199
  return 'TRIGGER;VALUE=DATE-TIME:' + IcalEvent.makeDtstamp(alarmDt);
207
200
  }
208
- else if (mask & flags.OMER_COUNT) {
201
+ else if (ev.hasFlag('OMER_COUNT')) {
209
202
  return 'TRIGGER:-P0DT3H30M0S'; // 8:30pm Omer alarm evening before
210
203
  }
211
- else if (mask & flags.USER_EVENT) {
204
+ else if (ev.hasFlag('USER_EVENT')) {
212
205
  return 'TRIGGER:-P0DT12H0M0S'; // noon the day before
213
206
  }
214
207
  else if (this.timed && ev.getDesc().startsWith('Candle lighting')) {
@@ -257,8 +250,7 @@ export class IcalEvent {
257
250
  arr.push('X-MICROSOFT-CDO-ALLDAYEVENT:TRUE');
258
251
  }
259
252
  const ev = this.ev;
260
- const mask = ev.getFlags();
261
- const isUserEvent = Boolean(mask & flags.USER_EVENT);
253
+ const isUserEvent = ev.hasFlag('USER_EVENT');
262
254
  if (!isUserEvent) {
263
255
  arr.push('CLASS:PUBLIC');
264
256
  }
@@ -1 +1 @@
1
- export declare const version = "7.0.4";
1
+ export declare const version = "7.0.5";
@@ -1,2 +1,2 @@
1
1
  // DO NOT EDIT THIS AUTO-GENERATED FILE!
2
- export const version = '7.0.4';
2
+ export const version = '7.0.5';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hebcal/icalendar",
3
- "version": "7.0.4",
3
+ "version": "7.0.5",
4
4
  "author": "Michael J. Radwin (https://github.com/mjradwin)",
5
5
  "keywords": [
6
6
  "ical",
@@ -30,7 +30,7 @@
30
30
  },
31
31
  "homepage": "https://hebcal.github.io/api/icalendar/",
32
32
  "dependencies": {
33
- "@hebcal/core": "^6.9.3",
33
+ "@hebcal/core": "^6.10.0",
34
34
  "@hebcal/hdate": "^0.22.8",
35
35
  "@hebcal/murmurhash3": "^1.0.0",
36
36
  "@hebcal/rest-api": "^7.1.3"
@@ -40,7 +40,8 @@
40
40
  "build": "npm run build:version && tsc",
41
41
  "pretest": "npm run build",
42
42
  "docs": "npx -y typedoc",
43
- "test": "vitest",
43
+ "test": "vitest run",
44
+ "test:watch": "vitest",
44
45
  "lint": "oxlint && prettier --check .",
45
46
  "clean": "rm -rf dist",
46
47
  "compile": "tsc",
@@ -49,10 +50,10 @@
49
50
  "license": "BSD-2-Clause",
50
51
  "devDependencies": {
51
52
  "@hebcal/learning": "^6.11.3",
52
- "@types/node": "26.6.2",
53
- "oxlint": "^1.83.0",
54
- "prettier": "^3.9.8",
53
+ "@types/node": "26.6.3",
54
+ "oxlint": "^1.86.0",
55
+ "prettier": "^3.9.9",
55
56
  "typescript": "^7.0.2",
56
- "vitest": "^5.0.1"
57
+ "vitest": "^5.0.2"
57
58
  }
58
59
  }