Skip to content

Commit

Permalink
Silence some code warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
mjradwin committed Oct 17, 2023
1 parent 07288ea commit c57adca
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 224 deletions.
184 changes: 0 additions & 184 deletions node-process-browser.js

This file was deleted.

60 changes: 30 additions & 30 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hebcal/rest-api",
"version": "4.5.6",
"version": "4.5.7",
"author": "Michael J. Radwin (https://github.com/mjradwin)",
"keywords": [
"hebcal"
Expand Down
10 changes: 4 additions & 6 deletions src/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ export function getCalendarTitle(events, options) {
const location = options.location;
if (options.yahrzeit) {
title += ' Yahrzeits and Anniversaries';
} else if (location && location.name) {
} else if (location?.name) {
const comma = location.name.indexOf(',');
const name = (comma == -1) ? location.name : location.name.substring(0, comma);
title += ' ' + name;
Expand Down Expand Up @@ -232,9 +232,7 @@ const HOLIDAY_IGNORE_MASK = flags.DAF_YOMI | flags.OMER_COUNT |
*/
export function makeTorahMemoText(ev, il) {
const mask = ev.getFlags();
if (mask & HOLIDAY_IGNORE_MASK) {
return '';
} else if (typeof ev.eventTime !== 'undefined') {
if ((mask & HOLIDAY_IGNORE_MASK) || (typeof ev.eventTime !== 'undefined')) {
return '';
}
const reading = (mask & flags.PARSHA_HASHAVUA) ?
Expand All @@ -250,12 +248,12 @@ export function makeTorahMemoText(ev, il) {
}
if (reading.haftara) {
memo += 'Haftarah: ' + reading.haftara;
if (reading.reason && reading.reason.haftara) {
if (reading.reason?.haftara) {
memo += ' | ' + reading.reason.haftara;
}
}
}
if (reading && reading.sephardic) {
if (reading?.sephardic) {
memo += '\nHaftarah for Sephardim: ' + reading.sephardic;
}
return memo;
Expand Down
6 changes: 3 additions & 3 deletions src/rss.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export function eventsToRss2(events, options) {
const utmSource = options.utmSource || 'shabbat1c';
const utmMedium = options.utmMedium || 'rss';
const mainUrlEsc = appendIsraelAndTracking(mainUrl,
location && location.getIsrael(),
location?.getIsrael(),
utmSource, utmMedium, options.utmCampaign).replace(/&/g, '&');
const selfUrlEsc = options.selfUrl.replace(/&/g, '&');
const lang = options.lang || localeToLg[options.locale] || options.locale || 'en-US';
Expand Down Expand Up @@ -118,8 +118,8 @@ export function eventToRssItem2(ev, options) {
const location = options.location;
const il = location ? location.getIsrael() : false;
const tzid = location ? location.getTzid() : 'UTC';
const utmSource = (options && options.utmSource) || 'shabbat1c';
const utmMedium = (options && options.utmMedium) || 'rss';
const utmSource = options.utmSource || 'shabbat1c';
const utmMedium = options.utmMedium || 'rss';
const linkGuid = getLinkAndGuid(ev, il, tzid, options.mainUrl, utmSource, utmMedium);
const link = linkGuid[0];
const guid = linkGuid[1];
Expand Down

0 comments on commit c57adca

Please sign in to comment.