@hebcal/leyning 6.2.4 → 7.0.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/README.md CHANGED
@@ -89,14 +89,15 @@ e.g. <code>Genesis 21:1-34; Numbers 29:1-6</code>.</p>
89
89
  <dt><a href="#getLeyningKeyForEvent">getLeyningKeyForEvent(ev, [il])</a> ⇒ <code>string</code></dt>
90
90
  <dd><p>Based on the event date, type and title, finds the relevant leyning key</p>
91
91
  </dd>
92
- <dt><a href="#specialReadings">specialReadings(hd, il, aliyot, reason, parsha)</a> ⇒ <code><a href="#Aliyah">Aliyah</a></code> | <code><a href="#Aliyah">Array.&lt;Aliyah&gt;</a></code></dt>
92
+ <dt><a href="#specialReadings2">specialReadings2(parsha, hd, il, aliyot)</a> ⇒ <code><a href="#SpecialReading">SpecialReading</a></code></dt>
93
93
  <dd><p>Determines if the regular parashat haShavua coincides with an event that requires
94
94
  a special maftir or Haftara (for example Shabbat HaGadol, Shabbat Chanukah, Rosh
95
95
  Chodesh or Machar Chodesh, etc.).</p>
96
- <p>If a special maftir occurs, modifies <code>aliyot</code> to replace <code>M</code> and sets <code>reason.M</code>
97
- (and in some cases modifies the 6th and 7th aliyah, setting <code>reason[&#39;7&#39;]</code>).</p>
98
- <p>If a special Haftarah applies, returns the Haftarah object and sets <code>reason.haftara</code>.
99
- If no special Haftarah, returns <code>undefined</code></p>
96
+ <p>This function does not modify <code>aliyot</code>. Instead, it returns a deep copy
97
+ with <code>aliyot[&#39;M&#39;]</code> replaced and sets <code>reason.M</code>
98
+ (and in some cases the 6th and 7th aliyah, setting <code>reason[&#39;7&#39;]</code>).</p>
99
+ <p>If a special Haftarah applies, the result will have a <code>haft</code> property
100
+ pointing to Haftarah object and sets <code>reason.haftara</code>.</p>
100
101
  </dd>
101
102
  <dt><a href="#getLeyningForHoliday">getLeyningForHoliday(ev, [il])</a> ⇒ <code><a href="#Leyning">Leyning</a></code></dt>
102
103
  <dd><p>Looks up leyning for a given holiday. Returns some
@@ -107,6 +108,9 @@ of full kriyah aliyot, special Maftir, special Haftarah</p>
107
108
  (untranslated) string used in holiday-readings.json. Returns some
108
109
  of full kriyah aliyot, special Maftir, special Haftarah</p>
109
110
  </dd>
111
+ <dt><a href="#getWeekdayReading">getWeekdayReading(parsha)</a> ⇒ <code>Object.&lt;string, Aliyah&gt;</code></dt>
112
+ <dd><p>Looks up Monday/Thursday aliyot for a regular parsha</p>
113
+ </dd>
110
114
  <dt><a href="#getLeyningForParsha">getLeyningForParsha(parsha)</a> ⇒ <code><a href="#Leyning">Leyning</a></code></dt>
111
115
  <dd><p>Looks up regular leyning for a weekly parsha with no special readings</p>
112
116
  </dd>
@@ -137,6 +141,9 @@ Parashat haShavua, containing only the <code>weekday</code> aliyot (no <code>ful
137
141
  <dt><a href="#Aliyah">Aliyah</a> : <code>Object</code></dt>
138
142
  <dd><p>Represents an aliyah</p>
139
143
  </dd>
144
+ <dt><a href="#SpecialReading">SpecialReading</a> : <code>Object</code></dt>
145
+ <dd><p>Leyning for a parsha hashavua or holiday</p>
146
+ </dd>
140
147
  <dt><a href="#LeyningNames">LeyningNames</a> : <code>Object</code></dt>
141
148
  <dd><p>Name of the parsha hashavua or holiday</p>
142
149
  </dd>
@@ -162,9 +169,9 @@ Formats parsha as a string
162
169
 
163
170
  **Kind**: global function
164
171
 
165
- | Param | Type |
166
- | --- | --- |
167
- | parsha | <code>Array.&lt;string&gt;</code> |
172
+ | Param | Type | Description |
173
+ | --- | --- | --- |
174
+ | parsha | <code>string</code> \| <code>Array.&lt;string&gt;</code> | untranslated name like 'Pinchas' or ['Pinchas'] or ['Matot','Masei'] |
168
175
 
169
176
  <a name="clone"></a>
170
177
 
@@ -297,28 +304,28 @@ Based on the event date, type and title, finds the relevant leyning key
297
304
  | ev | <code>Event</code> | | event |
298
305
  | [il] | <code>boolean</code> | <code>false</code> | true if Israel holiday scheme |
299
306
 
300
- <a name="specialReadings"></a>
307
+ <a name="specialReadings2"></a>
301
308
 
302
- ## specialReadings(hd, il, aliyot, reason, parsha) ⇒ [<code>Aliyah</code>](#Aliyah) \| [<code>Array.&lt;Aliyah&gt;</code>](#Aliyah)
309
+ ## specialReadings2(parsha, hd, il, aliyot) ⇒ [<code>SpecialReading</code>](#SpecialReading)
303
310
  Determines if the regular parashat haShavua coincides with an event that requires
304
311
  a special maftir or Haftara (for example Shabbat HaGadol, Shabbat Chanukah, Rosh
305
312
  Chodesh or Machar Chodesh, etc.).
306
313
 
307
- If a special maftir occurs, modifies `aliyot` to replace `M` and sets `reason.M`
308
- (and in some cases modifies the 6th and 7th aliyah, setting `reason['7']`).
314
+ This function does not modify `aliyot`. Instead, it returns a deep copy
315
+ with `aliyot['M']` replaced and sets `reason.M`
316
+ (and in some cases the 6th and 7th aliyah, setting `reason['7']`).
309
317
 
310
- If a special Haftarah applies, returns the Haftarah object and sets `reason.haftara`.
311
- If no special Haftarah, returns `undefined`
318
+ If a special Haftarah applies, the result will have a `haft` property
319
+ pointing to Haftarah object and sets `reason.haftara`.
312
320
 
313
321
  **Kind**: global function
314
322
 
315
323
  | Param | Type |
316
324
  | --- | --- |
325
+ | parsha | <code>Array.&lt;string&gt;</code> |
317
326
  | hd | <code>HDate</code> |
318
327
  | il | <code>boolean</code> |
319
328
  | aliyot | <code>Object.&lt;string, Aliyah&gt;</code> |
320
- | reason | <code>Object.&lt;string, string&gt;</code> |
321
- | parsha | <code>Array.&lt;string&gt;</code> |
322
329
 
323
330
  <a name="getLeyningForHoliday"></a>
324
331
 
@@ -349,6 +356,18 @@ of full kriyah aliyot, special Maftir, special Haftarah
349
356
  | key | <code>string</code> | name from `holiday-readings.json` to find |
350
357
  | [cholHaMoedDay] | <code>number</code> | |
351
358
 
359
+ <a name="getWeekdayReading"></a>
360
+
361
+ ## getWeekdayReading(parsha) ⇒ <code>Object.&lt;string, Aliyah&gt;</code>
362
+ Looks up Monday/Thursday aliyot for a regular parsha
363
+
364
+ **Kind**: global function
365
+ **Returns**: <code>Object.&lt;string, Aliyah&gt;</code> - map of aliyot
366
+
367
+ | Param | Type | Description |
368
+ | --- | --- | --- |
369
+ | parsha | <code>string</code> \| <code>Array.&lt;string&gt;</code> | untranslated name like 'Pinchas' or ['Pinchas'] or ['Matot','Masei'] |
370
+
352
371
  <a name="getLeyningForParsha"></a>
353
372
 
354
373
  ## getLeyningForParsha(parsha) ⇒ [<code>Leyning</code>](#Leyning)
@@ -361,10 +380,6 @@ Looks up regular leyning for a weekly parsha with no special readings
361
380
  | --- | --- | --- |
362
381
  | parsha | <code>string</code> \| <code>Array.&lt;string&gt;</code> | untranslated name like 'Pinchas' or ['Pinchas'] or ['Matot','Masei'] |
363
382
 
364
- <a name="getLeyningForParsha..result"></a>
365
-
366
- ### getLeyningForParsha~result : [<code>Leyning</code>](#Leyning)
367
- **Kind**: inner constant of [<code>getLeyningForParsha</code>](#getLeyningForParsha)
368
383
  <a name="getLeyningForParshaHaShavua"></a>
369
384
 
370
385
  ## getLeyningForParshaHaShavua(ev, [il]) ⇒ [<code>Leyning</code>](#Leyning)
@@ -409,9 +424,9 @@ Returns the parsha metadata
409
424
 
410
425
  **Kind**: global function
411
426
 
412
- | Param | Type |
413
- | --- | --- |
414
- | parsha | <code>string</code> \| <code>Array.&lt;string&gt;</code> |
427
+ | Param | Type | Description |
428
+ | --- | --- | --- |
429
+ | parsha | <code>string</code> \| <code>Array.&lt;string&gt;</code> | untranslated name like 'Pinchas' or ['Pinchas'] or ['Matot','Masei'] |
415
430
 
416
431
  <a name="writeCsvLines"></a>
417
432
 
@@ -444,6 +459,21 @@ Represents an aliyah
444
459
  | [v] | <code>number</code> | number of verses |
445
460
  | [p] | <code>number</code> | parsha number (1=Bereshit, 54=Vezot HaBracha) |
446
461
 
462
+ <a name="SpecialReading"></a>
463
+
464
+ ## SpecialReading : <code>Object</code>
465
+ Leyning for a parsha hashavua or holiday
466
+
467
+ **Kind**: global typedef
468
+ **Properties**
469
+
470
+ | Name | Type | Description |
471
+ | --- | --- | --- |
472
+ | aliyot | <code>Object.&lt;string, Aliyah&gt;</code> | Map of aliyot `1` through `7` plus `M` for maftir |
473
+ | [reason] | <code>Object.&lt;string, string&gt;</code> | Explanations for special readings, keyed by aliyah number, `M` for maftir or `haftara` for Haftarah |
474
+ | haft | [<code>Aliyah</code>](#Aliyah) \| [<code>Array.&lt;Aliyah&gt;</code>](#Aliyah) | Haftarah object(s) |
475
+ | seph | [<code>Aliyah</code>](#Aliyah) \| [<code>Array.&lt;Aliyah&gt;</code>](#Aliyah) | Haftarah object(s) |
476
+
447
477
  <a name="LeyningNames"></a>
448
478
 
449
479
  ## LeyningNames : <code>Object</code>