@hebcal/leyning 4.20.0 → 5.1.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/README.md CHANGED
@@ -69,7 +69,7 @@ for (const [num, aliyah] of Object.entries(triReading)) {
69
69
  ## Constants
70
70
 
71
71
  <dl>
72
- <dt><a href="#BOOK">BOOK</a></dt>
72
+ <dt><a href="#BOOK">BOOK</a> : <code>Array.&lt;string&gt;</code></dt>
73
73
  <dd><p>Names of the books of the Torah. BOOK[1] === &#39;Genesis&#39;</p>
74
74
  </dd>
75
75
  </dl>
@@ -77,20 +77,22 @@ for (const [num, aliyah] of Object.entries(triReading)) {
77
77
  ## Functions
78
78
 
79
79
  <dl>
80
- <dt><del><a href="#addSefariaLinksToLeyning">addSefariaLinksToLeyning(aliyot, showBook)</a></del></dt>
81
- <dd><p>Makes Sefaria links by adding <code>href</code>, <code>verses</code> and <code>num</code> attributes to each aliyah.
82
- CAUTION: Modifies the <code>aliyot</code> parameter instead of making a copy.</p>
83
- </dd>
84
80
  <dt><a href="#formatAliyahWithBook">formatAliyahWithBook(a)</a> ⇒ <code>string</code></dt>
85
81
  <dd><p>Formats an aliyah object like &quot;Numbers 28:9-28:15&quot;</p>
86
82
  </dd>
87
83
  <dt><a href="#formatAliyahShort">formatAliyahShort(aliyah, showBook)</a> ⇒ <code>string</code></dt>
88
84
  <dd><p>Formats an aliyah object like &quot;Numbers 28:9-15&quot;</p>
89
85
  </dd>
90
- <dt><a href="#getLeyningKeyForEvent">getLeyningKeyForEvent(e, [il])</a> ⇒ <code>string</code></dt>
86
+ <dt><a href="#hasFestival">hasFestival(holiday)</a> ⇒ <code>boolean</code></dt>
87
+ <dd><p>Is there a special festival Torah Reading for <code>holiday</code>?</p>
88
+ </dd>
89
+ <dt><a href="#lookupFestival">lookupFestival(holiday)</a> ⇒ <code>any</code></dt>
90
+ <dd><p>Returns the raw metadata for festival reading for <code>holiday</code></p>
91
+ </dd>
92
+ <dt><a href="#getLeyningKeyForEvent">getLeyningKeyForEvent(ev, [il])</a> ⇒ <code>string</code></dt>
91
93
  <dd><p>Based on the event date, type and title, finds the relevant leyning key</p>
92
94
  </dd>
93
- <dt><a href="#getLeyningForHoliday">getLeyningForHoliday(e, [il])</a> ⇒ <code><a href="#Leyning">Leyning</a></code></dt>
95
+ <dt><a href="#getLeyningForHoliday">getLeyningForHoliday(ev, [il])</a> ⇒ <code><a href="#Leyning">Leyning</a></code></dt>
94
96
  <dd><p>Looks up leyning for a given holiday. Returns some
95
97
  of full kriyah aliyot, special Maftir, special Haftarah</p>
96
98
  </dd>
@@ -118,10 +120,13 @@ reading for that day (see <a href="#getLeyningForHoliday">getLeyningForHoliday</
118
120
  Parashat haShavua, containing only the <code>weekday</code> aliyot (no <code>fullkriyah</code>).</p>
119
121
  <p>Otherwise, returns <code>undefined</code>.</p>
120
122
  </dd>
123
+ <dt><a href="#lookupParsha">lookupParsha(parsha)</a> ⇒ <code><a href="#ParshaMeta">ParshaMeta</a></code></dt>
124
+ <dd><p>Returns the parsha metadata</p>
125
+ </dd>
121
126
  <dt><a href="#getTriennial">getTriennial(year)</a> ⇒ <code><a href="#Triennial">Triennial</a></code></dt>
122
127
  <dd><p>Calculates the 3-year readings for a given year</p>
123
128
  </dd>
124
- <dt><a href="#getTriennialForParshaHaShavua">getTriennialForParshaHaShavua(ev, [context])</a> ⇒ <code><a href="#TriennialAliyot">TriennialAliyot</a></code> | <code>Object.&lt;string, Aliyah&gt;</code></dt>
129
+ <dt><a href="#getTriennialForParshaHaShavua">getTriennialForParshaHaShavua(ev)</a> ⇒ <code><a href="#TriennialAliyot">TriennialAliyot</a></code></dt>
125
130
  <dd><p>Looks up the triennial leyning for this Parashat HaShavua</p>
126
131
  </dd>
127
132
  <dt><a href="#getTriennialHaftaraForHoliday">getTriennialHaftaraForHoliday(key, yearNum)</a> ⇒ <code>Object</code></dt>
@@ -141,6 +146,9 @@ Parashat haShavua, containing only the <code>weekday</code> aliyot (no <code>ful
141
146
  <dt><a href="#Leyning">Leyning</a> : <code>Object</code></dt>
142
147
  <dd><p>Leyning for a parsha hashavua or holiday</p>
143
148
  </dd>
149
+ <dt><a href="#ParshaMeta">ParshaMeta</a> : <code>Object</code></dt>
150
+ <dd><p>Parsha metadata</p>
151
+ </dd>
144
152
  <dt><a href="#TriennialAliyot">TriennialAliyot</a> : <code>Object</code></dt>
145
153
  <dd><p>Represents triennial aliyot for a given date</p>
146
154
  </dd>
@@ -216,25 +224,11 @@ Returns Hebrew year that this 3-year triennial cycle began
216
224
 
217
225
  <a name="BOOK"></a>
218
226
 
219
- ## BOOK
227
+ ## BOOK : <code>Array.&lt;string&gt;</code>
220
228
  Names of the books of the Torah. BOOK[1] === 'Genesis'
221
229
 
222
230
  **Kind**: global constant
223
- <a name="addSefariaLinksToLeyning"></a>
224
-
225
- ## ~~addSefariaLinksToLeyning(aliyot, showBook)~~
226
- ***Deprecated***
227
-
228
- Makes Sefaria links by adding `href`, `verses` and `num` attributes to each aliyah.
229
- CAUTION: Modifies the `aliyot` parameter instead of making a copy.
230
-
231
- **Kind**: global function
232
-
233
- | Param | Type | Description |
234
- | --- | --- | --- |
235
- | aliyot | <code>Object.&lt;string, Aliyah&gt;</code> | aliyah map to decorate |
236
- | showBook | <code>boolean</code> | display the book name in the `verses` field (e.g. for special Maftir) |
237
-
231
+ **Read only**: true
238
232
  <a name="formatAliyahWithBook"></a>
239
233
 
240
234
  ## formatAliyahWithBook(a) ⇒ <code>string</code>
@@ -258,9 +252,31 @@ Formats an aliyah object like "Numbers 28:9-15"
258
252
  | aliyah | [<code>Aliyah</code>](#Aliyah) |
259
253
  | showBook | <code>boolean</code> |
260
254
 
255
+ <a name="hasFestival"></a>
256
+
257
+ ## hasFestival(holiday) ⇒ <code>boolean</code>
258
+ Is there a special festival Torah Reading for `holiday`?
259
+
260
+ **Kind**: global function
261
+
262
+ | Param | Type |
263
+ | --- | --- |
264
+ | holiday | <code>string</code> |
265
+
266
+ <a name="lookupFestival"></a>
267
+
268
+ ## lookupFestival(holiday) ⇒ <code>any</code>
269
+ Returns the raw metadata for festival reading for `holiday`
270
+
271
+ **Kind**: global function
272
+
273
+ | Param | Type |
274
+ | --- | --- |
275
+ | holiday | <code>string</code> |
276
+
261
277
  <a name="getLeyningKeyForEvent"></a>
262
278
 
263
- ## getLeyningKeyForEvent(e, [il]) ⇒ <code>string</code>
279
+ ## getLeyningKeyForEvent(ev, [il]) ⇒ <code>string</code>
264
280
  Based on the event date, type and title, finds the relevant leyning key
265
281
 
266
282
  **Kind**: global function
@@ -268,12 +284,12 @@ Based on the event date, type and title, finds the relevant leyning key
268
284
 
269
285
  | Param | Type | Default | Description |
270
286
  | --- | --- | --- | --- |
271
- | e | <code>Event</code> | | event |
287
+ | ev | <code>Event</code> | | event |
272
288
  | [il] | <code>boolean</code> | <code>false</code> | true if Israel holiday scheme |
273
289
 
274
290
  <a name="getLeyningForHoliday"></a>
275
291
 
276
- ## getLeyningForHoliday(e, [il]) ⇒ [<code>Leyning</code>](#Leyning)
292
+ ## getLeyningForHoliday(ev, [il]) ⇒ [<code>Leyning</code>](#Leyning)
277
293
  Looks up leyning for a given holiday. Returns some
278
294
  of full kriyah aliyot, special Maftir, special Haftarah
279
295
 
@@ -282,7 +298,7 @@ of full kriyah aliyot, special Maftir, special Haftarah
282
298
 
283
299
  | Param | Type | Default | Description |
284
300
  | --- | --- | --- | --- |
285
- | e | <code>Event</code> | | the Hebcal event associated with this leyning |
301
+ | ev | <code>Event</code> | | the Hebcal event associated with this leyning |
286
302
  | [il] | <code>boolean</code> | <code>false</code> | true if Israel holiday scheme |
287
303
 
288
304
  <a name="makeLeyningSummary"></a>
@@ -364,6 +380,17 @@ Otherwise, returns `undefined`.
364
380
  | hdate | <code>HDate</code> | Hebrew Date |
365
381
  | il | <code>boolean</code> | in Israel |
366
382
 
383
+ <a name="lookupParsha"></a>
384
+
385
+ ## lookupParsha(parsha) ⇒ [<code>ParshaMeta</code>](#ParshaMeta)
386
+ Returns the parsha metadata
387
+
388
+ **Kind**: global function
389
+
390
+ | Param | Type |
391
+ | --- | --- |
392
+ | parsha | <code>string</code> \| <code>Array.&lt;string&gt;</code> |
393
+
367
394
  <a name="getTriennial"></a>
368
395
 
369
396
  ## getTriennial(year) ⇒ [<code>Triennial</code>](#Triennial)
@@ -377,16 +404,15 @@ Calculates the 3-year readings for a given year
377
404
 
378
405
  <a name="getTriennialForParshaHaShavua"></a>
379
406
 
380
- ## getTriennialForParshaHaShavua(ev, [context]) ⇒ [<code>TriennialAliyot</code>](#TriennialAliyot) \| <code>Object.&lt;string, Aliyah&gt;</code>
407
+ ## getTriennialForParshaHaShavua(ev) ⇒ [<code>TriennialAliyot</code>](#TriennialAliyot)
381
408
  Looks up the triennial leyning for this Parashat HaShavua
382
409
 
383
410
  **Kind**: global function
384
- **Returns**: [<code>TriennialAliyot</code>](#TriennialAliyot) \| <code>Object.&lt;string, Aliyah&gt;</code> - a map of aliyot 1-7 plus "M"
411
+ **Returns**: [<code>TriennialAliyot</code>](#TriennialAliyot) - a map of aliyot 1-7 plus "M"
385
412
 
386
- | Param | Type | Default | Description |
387
- | --- | --- | --- | --- |
388
- | ev | <code>Event</code> | | |
389
- | [context] | <code>boolean</code> | <code>false</code> | returns a reading wrapper object which includes `date`, `yearNum` and `aliyot` |
413
+ | Param | Type |
414
+ | --- | --- |
415
+ | ev | <code>Event</code> |
390
416
 
391
417
  <a name="getTriennialHaftaraForHoliday"></a>
392
418
 
@@ -441,7 +467,7 @@ Leyning for a parsha hashavua or holiday
441
467
  | --- | --- | --- |
442
468
  | name | [<code>LeyningNames</code>](#LeyningNames) | |
443
469
  | [parsha] | <code>Array.&lt;string&gt;</code> | An array of either 1 (regular) or 2 (doubled parsha). `undefined` for holiday readings |
444
- | [parshaNum] | <code>num</code> | 1 for Bereshit, 2 for Noach, etc. `undefined` for holiday readings |
470
+ | [parshaNum] | <code>number</code> | 1 for Bereshit, 2 for Noach, etc. `undefined` for holiday readings |
445
471
  | summary | <code>string</code> | Such as `Genesis 1:1 - 6:8` |
446
472
  | haft | [<code>Aliyah</code>](#Aliyah) \| [<code>Array.&lt;Aliyah&gt;</code>](#Aliyah) | Haftarah object(s) |
447
473
  | haftara | <code>string</code> | Haftarah, such as `Isaiah 42:5 – 43:11` |
@@ -453,6 +479,24 @@ Leyning for a parsha hashavua or holiday
453
479
  | [weekday] | <code>Object.&lt;string, Aliyah&gt;</code> | Optional map of weekday Torah Readings aliyot `1` through `3` for Monday and Thursday |
454
480
  | [reason] | <code>Object.&lt;string, string&gt;</code> | Explanations for special readings, keyed by aliyah number, `M` for maftir or `haftara` for Haftarah |
455
481
 
482
+ <a name="ParshaMeta"></a>
483
+
484
+ ## ParshaMeta : <code>Object</code>
485
+ Parsha metadata
486
+
487
+ **Kind**: global typedef
488
+ **Properties**
489
+
490
+ | Name | Type | Description |
491
+ | --- | --- | --- |
492
+ | num | <code>number</code> | 1 for Bereshit, 2 for Noach, etc. `undefined` for holiday readings |
493
+ | hebrew | <code>string</code> | parsha name in Hebrew with niqud |
494
+ | book | <code>number</code> | 1 for Genesis, 2 for Exodus, 5 for Deuteronomy |
495
+ | haft | [<code>Aliyah</code>](#Aliyah) \| [<code>Array.&lt;Aliyah&gt;</code>](#Aliyah) | Haftarah object(s) |
496
+ | [seph] | [<code>Aliyah</code>](#Aliyah) \| [<code>Array.&lt;Aliyah&gt;</code>](#Aliyah) | Haftarah object(s) for Sephardim |
497
+ | fullkriyah | <code>Object.&lt;string, Array.&lt;string&gt;&gt;</code> | Map of aliyot `1` through `7` plus `M` for maftir |
498
+ | weekday | <code>Object.&lt;string, Array.&lt;string&gt;&gt;</code> | Map of weekday Torah Readings aliyot `1` through `3` for Monday and Thursday |
499
+
456
500
  <a name="TriennialAliyot"></a>
457
501
 
458
502
  ## TriennialAliyot : <code>Object</code>