@hebcal/leyning 8.2.2 → 8.2.3
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 +1 -511
- package/dist/bundle.js +17 -18
- package/dist/bundle.min.js +2 -2
- package/dist/clone.d.ts +1 -2
- package/dist/getLeyningForHoliday.d.ts +3 -3
- package/dist/getLeyningKeyForEvent.d.ts +3 -3
- package/dist/holiday-readings.json.d.ts +1 -0
- package/dist/index.cjs +17 -18
- package/dist/index.mjs +17 -18
- package/dist/leyning.d.ts +4 -5
- package/dist/types.d.ts +8 -6
- package/package.json +19 -17
package/README.md
CHANGED
|
@@ -34,514 +34,4 @@ for (const [num, aliyah] of Object.entries(reading.fullkriyah)) {
|
|
|
34
34
|
console.log(`${number}: ${str}`);
|
|
35
35
|
}
|
|
36
36
|
```
|
|
37
|
-
|
|
38
|
-
## Constants
|
|
39
|
-
|
|
40
|
-
<dl>
|
|
41
|
-
<dt><a href="#BOOK">BOOK</a> : <code>Array.<string></code></dt>
|
|
42
|
-
<dd><p>Names of the books of the Torah. BOOK[1] === 'Genesis'</p>
|
|
43
|
-
</dd>
|
|
44
|
-
</dl>
|
|
45
|
-
|
|
46
|
-
## Functions
|
|
47
|
-
|
|
48
|
-
<dl>
|
|
49
|
-
<dt><a href="#parshaToString">parshaToString(parsha)</a> ⇒ <code>string</code></dt>
|
|
50
|
-
<dd><p>Formats parsha as a string</p>
|
|
51
|
-
</dd>
|
|
52
|
-
<dt><a href="#clone">clone(src)</a> ⇒ <code>any</code></dt>
|
|
53
|
-
<dd><p>Makes a deep copy of the src object using JSON stringify and parse</p>
|
|
54
|
-
</dd>
|
|
55
|
-
<dt><a href="#calculateNumVerses">calculateNumVerses(aliyah)</a> ⇒ <code>number</code></dt>
|
|
56
|
-
<dd><p>Calculates the number of verses in an aliyah or haftara based on
|
|
57
|
-
the <code>b</code> (begin verse), <code>e</code> (end verse) and <code>k</code> (book).
|
|
58
|
-
Modifies <code>aliyah</code> by setting the <code>v</code> field.</p>
|
|
59
|
-
</dd>
|
|
60
|
-
<dt><a href="#formatAliyahWithBook">formatAliyahWithBook(a)</a> ⇒ <code>string</code></dt>
|
|
61
|
-
<dd><p>Formats an aliyah object like "Numbers 28:9-28:15"</p>
|
|
62
|
-
</dd>
|
|
63
|
-
<dt><a href="#formatAliyahShort">formatAliyahShort(aliyah, showBook)</a> ⇒ <code>string</code></dt>
|
|
64
|
-
<dd><p>Formats an aliyah object like "Numbers 28:9-15"</p>
|
|
65
|
-
</dd>
|
|
66
|
-
<dt><a href="#sumVerses">sumVerses(aliyot)</a> ⇒ <code>number</code></dt>
|
|
67
|
-
<dd><p>Returns the total number of verses in an array of Aliyah (or haftarah) objects</p>
|
|
68
|
-
</dd>
|
|
69
|
-
<dt><a href="#makeLeyningParts">makeLeyningParts(aliyot)</a> ⇒ <code><a href="#Aliyah">Array.<Aliyah></a></code></dt>
|
|
70
|
-
<dd><p>Summarizes an <code>AliyotMap</code> by collapsing all adjacent aliyot.
|
|
71
|
-
Finds any non-overlapping parts (e.g. special 7th aliyah or maftir)</p>
|
|
72
|
-
</dd>
|
|
73
|
-
<dt><a href="#makeSummaryFromParts">makeSummaryFromParts(parts)</a> ⇒ <code>string</code></dt>
|
|
74
|
-
<dd><p>Returns a string representation of the leyning parts.
|
|
75
|
-
Separate verse ranges read from the same book are separated
|
|
76
|
-
by commas, e.g. <code>Isaiah 6:1-7:6, 9:5-6</code>.
|
|
77
|
-
Verse ranges from different books are separated by semicolons,
|
|
78
|
-
e.g. <code>Genesis 21:1-34; Numbers 29:1-6</code>.</p>
|
|
79
|
-
</dd>
|
|
80
|
-
<dt><a href="#makeLeyningSummary">makeLeyningSummary(aliyot)</a> ⇒ <code>string</code></dt>
|
|
81
|
-
<dd><p>Makes a summary of the leyning, like "Genesis 6:9-11:32"</p>
|
|
82
|
-
</dd>
|
|
83
|
-
<dt><a href="#hasFestival">hasFestival(holiday)</a> ⇒ <code>boolean</code></dt>
|
|
84
|
-
<dd><p>Is there a special festival Torah Reading for <code>holiday</code>?</p>
|
|
85
|
-
</dd>
|
|
86
|
-
<dt><a href="#lookupFestival">lookupFestival(holiday)</a> ⇒ <code>any</code></dt>
|
|
87
|
-
<dd><p>Returns the raw metadata for festival reading for <code>holiday</code></p>
|
|
88
|
-
</dd>
|
|
89
|
-
<dt><a href="#getLeyningKeyForEvent">getLeyningKeyForEvent(ev, [il])</a> ⇒ <code>string</code></dt>
|
|
90
|
-
<dd><p>Based on the event date, type and title, finds the relevant leyning key</p>
|
|
91
|
-
</dd>
|
|
92
|
-
<dt><a href="#specialReadings2">specialReadings2(parsha, hd, il, aliyot)</a> ⇒ <code><a href="#SpecialReading">SpecialReading</a></code></dt>
|
|
93
|
-
<dd><p>Determines if the regular parashat haShavua coincides with an event that requires
|
|
94
|
-
a special maftir or Haftara (for example Shabbat HaGadol, Shabbat Chanukah, Rosh
|
|
95
|
-
Chodesh or Machar Chodesh, etc.).</p>
|
|
96
|
-
<p>This function does not modify <code>aliyot</code>. Instead, it returns a deep copy
|
|
97
|
-
with <code>aliyot['M']</code> replaced and sets <code>reason.M</code>
|
|
98
|
-
(and in some cases the 6th and 7th aliyah, setting <code>reason['7']</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>
|
|
101
|
-
</dd>
|
|
102
|
-
<dt><a href="#getLeyningForHolidayKey">getLeyningForHolidayKey(key, [cholHaMoedDay], [il])</a> ⇒ <code><a href="#Leyning">Leyning</a></code></dt>
|
|
103
|
-
<dd><p>Looks up leyning for a given holiday key. Key should be an
|
|
104
|
-
(untranslated) string used in holiday-readings.json. Returns some
|
|
105
|
-
of full kriyah aliyot, special Maftir, special Haftarah</p>
|
|
106
|
-
</dd>
|
|
107
|
-
<dt><a href="#getLeyningForHoliday">getLeyningForHoliday(ev, [il])</a> ⇒ <code><a href="#Leyning">Leyning</a></code></dt>
|
|
108
|
-
<dd><p>Looks up leyning for a given holiday. Returns some
|
|
109
|
-
of full kriyah aliyot, special Maftir, special Haftarah</p>
|
|
110
|
-
</dd>
|
|
111
|
-
<dt><a href="#makeLeyningNames">makeLeyningNames(parsha)</a> ⇒ <code><a href="#LeyningNames">LeyningNames</a></code></dt>
|
|
112
|
-
<dd><p>Transliterated English and Hebrew names of this parsha</p>
|
|
113
|
-
</dd>
|
|
114
|
-
<dt><a href="#getWeekdayReading">getWeekdayReading(parsha)</a> ⇒ <code>Object.<string, Aliyah></code></dt>
|
|
115
|
-
<dd><p>Looks up Monday/Thursday aliyot for a regular parsha</p>
|
|
116
|
-
</dd>
|
|
117
|
-
<dt><a href="#getLeyningForParsha">getLeyningForParsha(parsha)</a> ⇒ <code><a href="#Leyning">Leyning</a></code></dt>
|
|
118
|
-
<dd><p>Looks up regular leyning for a weekly parsha with no special readings</p>
|
|
119
|
-
</dd>
|
|
120
|
-
<dt><a href="#getLeyningForParshaHaShavua">getLeyningForParshaHaShavua(ev, [il])</a> ⇒ <code><a href="#Leyning">Leyning</a></code></dt>
|
|
121
|
-
<dd><p>Looks up leyning for a regular Shabbat parsha, including any special
|
|
122
|
-
maftir or Haftara.</p>
|
|
123
|
-
</dd>
|
|
124
|
-
<dt><a href="#lookupParsha">lookupParsha(parsha)</a> ⇒ <code><a href="#ParshaMeta">ParshaMeta</a></code></dt>
|
|
125
|
-
<dd><p>Returns the parsha metadata</p>
|
|
126
|
-
</dd>
|
|
127
|
-
<dt><a href="#getLeyningOnDate">getLeyningOnDate(hdate, il, [wantarray])</a> ⇒ <code><a href="#Leyning">Leyning</a></code> | <code><a href="#Leyning">Array.<Leyning></a></code></dt>
|
|
128
|
-
<dd><p>Looks up leyning for a regular Shabbat, Monday/Thursday weekday or holiday.</p>
|
|
129
|
-
<p>If <code>hdate</code> coincides with a holiday that has Torah reading, returns the
|
|
130
|
-
reading for that day (see <a href="#getLeyningForHoliday">getLeyningForHoliday</a>)</p>
|
|
131
|
-
<p>Otherwise, if <code>hdate</code> is a Saturday, returns <a href="#getLeyningForParshaHaShavua">getLeyningForParshaHaShavua</a></p>
|
|
132
|
-
<p>Otherwise, if <code>hdate</code> is a Monday or Thursday, returns <a href="#Leyning">Leyning</a> for the
|
|
133
|
-
Parashat haShavua, containing only the <code>weekday</code> aliyot (no <code>fullkriyah</code>).</p>
|
|
134
|
-
<p>Otherwise, returns <code>undefined</code>.</p>
|
|
135
|
-
</dd>
|
|
136
|
-
<dt><a href="#writeCsvLines">writeCsvLines(stream, ev, reading, il, isParsha)</a></dt>
|
|
137
|
-
<dd><p>Formats reading for CSV</p>
|
|
138
|
-
</dd>
|
|
139
|
-
</dl>
|
|
140
|
-
|
|
141
|
-
## Typedefs
|
|
142
|
-
|
|
143
|
-
<dl>
|
|
144
|
-
<dt><a href="#Aliyah">Aliyah</a> : <code>Object</code></dt>
|
|
145
|
-
<dd><p>Represents an aliyah</p>
|
|
146
|
-
</dd>
|
|
147
|
-
<dt><a href="#SpecialReading">SpecialReading</a> : <code>Object</code></dt>
|
|
148
|
-
<dd><p>Leyning for a parsha hashavua or holiday</p>
|
|
149
|
-
</dd>
|
|
150
|
-
<dt><a href="#LeyningNames">LeyningNames</a> : <code>Object</code></dt>
|
|
151
|
-
<dd><p>Name of the parsha hashavua or holiday</p>
|
|
152
|
-
</dd>
|
|
153
|
-
<dt><a href="#Leyning">Leyning</a> : <code>Object</code></dt>
|
|
154
|
-
<dd><p>Leyning for a parsha hashavua or holiday</p>
|
|
155
|
-
</dd>
|
|
156
|
-
<dt><a href="#ParshaMeta">ParshaMeta</a> : <code>Object</code></dt>
|
|
157
|
-
<dd><p>Parsha metadata</p>
|
|
158
|
-
</dd>
|
|
159
|
-
</dl>
|
|
160
|
-
|
|
161
|
-
<a name="BOOK"></a>
|
|
162
|
-
|
|
163
|
-
## BOOK : <code>Array.<string></code>
|
|
164
|
-
Names of the books of the Torah. BOOK[1] === 'Genesis'
|
|
165
|
-
|
|
166
|
-
**Kind**: global constant
|
|
167
|
-
**Read only**: true
|
|
168
|
-
<a name="parshaToString"></a>
|
|
169
|
-
|
|
170
|
-
## parshaToString(parsha) ⇒ <code>string</code>
|
|
171
|
-
Formats parsha as a string
|
|
172
|
-
|
|
173
|
-
**Kind**: global function
|
|
174
|
-
|
|
175
|
-
| Param | Type | Description |
|
|
176
|
-
| --- | --- | --- |
|
|
177
|
-
| parsha | <code>string</code> \| <code>Array.<string></code> | untranslated name like 'Pinchas' or ['Pinchas'] or ['Matot','Masei'] |
|
|
178
|
-
|
|
179
|
-
<a name="clone"></a>
|
|
180
|
-
|
|
181
|
-
## clone(src) ⇒ <code>any</code>
|
|
182
|
-
Makes a deep copy of the src object using JSON stringify and parse
|
|
183
|
-
|
|
184
|
-
**Kind**: global function
|
|
185
|
-
|
|
186
|
-
| Param | Type |
|
|
187
|
-
| --- | --- |
|
|
188
|
-
| src | <code>any</code> |
|
|
189
|
-
|
|
190
|
-
<a name="calculateNumVerses"></a>
|
|
191
|
-
|
|
192
|
-
## calculateNumVerses(aliyah) ⇒ <code>number</code>
|
|
193
|
-
Calculates the number of verses in an aliyah or haftara based on
|
|
194
|
-
the `b` (begin verse), `e` (end verse) and `k` (book).
|
|
195
|
-
Modifies `aliyah` by setting the `v` field.
|
|
196
|
-
|
|
197
|
-
**Kind**: global function
|
|
198
|
-
|
|
199
|
-
| Param | Type |
|
|
200
|
-
| --- | --- |
|
|
201
|
-
| aliyah | [<code>Aliyah</code>](#Aliyah) |
|
|
202
|
-
|
|
203
|
-
<a name="formatAliyahWithBook"></a>
|
|
204
|
-
|
|
205
|
-
## formatAliyahWithBook(a) ⇒ <code>string</code>
|
|
206
|
-
Formats an aliyah object like "Numbers 28:9-28:15"
|
|
207
|
-
|
|
208
|
-
**Kind**: global function
|
|
209
|
-
|
|
210
|
-
| Param | Type | Description |
|
|
211
|
-
| --- | --- | --- |
|
|
212
|
-
| a | [<code>Aliyah</code>](#Aliyah) | aliyah |
|
|
213
|
-
|
|
214
|
-
<a name="formatAliyahShort"></a>
|
|
215
|
-
|
|
216
|
-
## formatAliyahShort(aliyah, showBook) ⇒ <code>string</code>
|
|
217
|
-
Formats an aliyah object like "Numbers 28:9-15"
|
|
218
|
-
|
|
219
|
-
**Kind**: global function
|
|
220
|
-
|
|
221
|
-
| Param | Type |
|
|
222
|
-
| --- | --- |
|
|
223
|
-
| aliyah | [<code>Aliyah</code>](#Aliyah) |
|
|
224
|
-
| showBook | <code>boolean</code> |
|
|
225
|
-
|
|
226
|
-
<a name="sumVerses"></a>
|
|
227
|
-
|
|
228
|
-
## sumVerses(aliyot) ⇒ <code>number</code>
|
|
229
|
-
Returns the total number of verses in an array of Aliyah (or haftarah) objects
|
|
230
|
-
|
|
231
|
-
**Kind**: global function
|
|
232
|
-
|
|
233
|
-
| Param | Type |
|
|
234
|
-
| --- | --- |
|
|
235
|
-
| aliyot | [<code>Aliyah</code>](#Aliyah) \| [<code>Array.<Aliyah></code>](#Aliyah) |
|
|
236
|
-
|
|
237
|
-
<a name="makeLeyningParts"></a>
|
|
238
|
-
|
|
239
|
-
## makeLeyningParts(aliyot) ⇒ [<code>Array.<Aliyah></code>](#Aliyah)
|
|
240
|
-
Summarizes an `AliyotMap` by collapsing all adjacent aliyot.
|
|
241
|
-
Finds any non-overlapping parts (e.g. special 7th aliyah or maftir)
|
|
242
|
-
|
|
243
|
-
**Kind**: global function
|
|
244
|
-
|
|
245
|
-
| Param | Type |
|
|
246
|
-
| --- | --- |
|
|
247
|
-
| aliyot | <code>Object.<string, Aliyah></code> |
|
|
248
|
-
|
|
249
|
-
<a name="makeSummaryFromParts"></a>
|
|
250
|
-
|
|
251
|
-
## makeSummaryFromParts(parts) ⇒ <code>string</code>
|
|
252
|
-
Returns a string representation of the leyning parts.
|
|
253
|
-
Separate verse ranges read from the same book are separated
|
|
254
|
-
by commas, e.g. `Isaiah 6:1-7:6, 9:5-6`.
|
|
255
|
-
Verse ranges from different books are separated by semicolons,
|
|
256
|
-
e.g. `Genesis 21:1-34; Numbers 29:1-6`.
|
|
257
|
-
|
|
258
|
-
**Kind**: global function
|
|
259
|
-
|
|
260
|
-
| Param | Type |
|
|
261
|
-
| --- | --- |
|
|
262
|
-
| parts | [<code>Aliyah</code>](#Aliyah) \| [<code>Array.<Aliyah></code>](#Aliyah) |
|
|
263
|
-
|
|
264
|
-
<a name="makeLeyningSummary"></a>
|
|
265
|
-
|
|
266
|
-
## makeLeyningSummary(aliyot) ⇒ <code>string</code>
|
|
267
|
-
Makes a summary of the leyning, like "Genesis 6:9-11:32"
|
|
268
|
-
|
|
269
|
-
**Kind**: global function
|
|
270
|
-
|
|
271
|
-
| Param | Type |
|
|
272
|
-
| --- | --- |
|
|
273
|
-
| aliyot | <code>Object.<string, Aliyah></code> |
|
|
274
|
-
|
|
275
|
-
<a name="hasFestival"></a>
|
|
276
|
-
|
|
277
|
-
## hasFestival(holiday) ⇒ <code>boolean</code>
|
|
278
|
-
Is there a special festival Torah Reading for `holiday`?
|
|
279
|
-
|
|
280
|
-
**Kind**: global function
|
|
281
|
-
|
|
282
|
-
| Param | Type |
|
|
283
|
-
| --- | --- |
|
|
284
|
-
| holiday | <code>string</code> |
|
|
285
|
-
|
|
286
|
-
<a name="lookupFestival"></a>
|
|
287
|
-
|
|
288
|
-
## lookupFestival(holiday) ⇒ <code>any</code>
|
|
289
|
-
Returns the raw metadata for festival reading for `holiday`
|
|
290
|
-
|
|
291
|
-
**Kind**: global function
|
|
292
|
-
|
|
293
|
-
| Param | Type |
|
|
294
|
-
| --- | --- |
|
|
295
|
-
| holiday | <code>string</code> |
|
|
296
|
-
|
|
297
|
-
<a name="getLeyningKeyForEvent"></a>
|
|
298
|
-
|
|
299
|
-
## getLeyningKeyForEvent(ev, [il]) ⇒ <code>string</code>
|
|
300
|
-
Based on the event date, type and title, finds the relevant leyning key
|
|
301
|
-
|
|
302
|
-
**Kind**: global function
|
|
303
|
-
**Returns**: <code>string</code> - key to look up in holiday-reading.json
|
|
304
|
-
|
|
305
|
-
| Param | Type | Default | Description |
|
|
306
|
-
| --- | --- | --- | --- |
|
|
307
|
-
| ev | <code>Event</code> | | event |
|
|
308
|
-
| [il] | <code>boolean</code> | <code>false</code> | true if Israel holiday scheme |
|
|
309
|
-
|
|
310
|
-
<a name="specialReadings2"></a>
|
|
311
|
-
|
|
312
|
-
## specialReadings2(parsha, hd, il, aliyot) ⇒ [<code>SpecialReading</code>](#SpecialReading)
|
|
313
|
-
Determines if the regular parashat haShavua coincides with an event that requires
|
|
314
|
-
a special maftir or Haftara (for example Shabbat HaGadol, Shabbat Chanukah, Rosh
|
|
315
|
-
Chodesh or Machar Chodesh, etc.).
|
|
316
|
-
|
|
317
|
-
This function does not modify `aliyot`. Instead, it returns a deep copy
|
|
318
|
-
with `aliyot['M']` replaced and sets `reason.M`
|
|
319
|
-
(and in some cases the 6th and 7th aliyah, setting `reason['7']`).
|
|
320
|
-
|
|
321
|
-
If a special Haftarah applies, the result will have a `haft` property
|
|
322
|
-
pointing to Haftarah object and sets `reason.haftara`.
|
|
323
|
-
|
|
324
|
-
**Kind**: global function
|
|
325
|
-
|
|
326
|
-
| Param | Type |
|
|
327
|
-
| --- | --- |
|
|
328
|
-
| parsha | <code>Array.<string></code> |
|
|
329
|
-
| hd | <code>HDate</code> |
|
|
330
|
-
| il | <code>boolean</code> |
|
|
331
|
-
| aliyot | <code>Object.<string, Aliyah></code> |
|
|
332
|
-
|
|
333
|
-
<a name="getLeyningForHolidayKey"></a>
|
|
334
|
-
|
|
335
|
-
## getLeyningForHolidayKey(key, [cholHaMoedDay], [il]) ⇒ [<code>Leyning</code>](#Leyning)
|
|
336
|
-
Looks up leyning for a given holiday key. Key should be an
|
|
337
|
-
(untranslated) string used in holiday-readings.json. Returns some
|
|
338
|
-
of full kriyah aliyot, special Maftir, special Haftarah
|
|
339
|
-
|
|
340
|
-
**Kind**: global function
|
|
341
|
-
**Returns**: [<code>Leyning</code>](#Leyning) - map of aliyot
|
|
342
|
-
|
|
343
|
-
| Param | Type | Description |
|
|
344
|
-
| --- | --- | --- |
|
|
345
|
-
| key | <code>string</code> | name from `holiday-readings.json` to find |
|
|
346
|
-
| [cholHaMoedDay] | <code>number</code> | |
|
|
347
|
-
| [il] | <code>boolean</code> | |
|
|
348
|
-
|
|
349
|
-
<a name="getLeyningForHoliday"></a>
|
|
350
|
-
|
|
351
|
-
## getLeyningForHoliday(ev, [il]) ⇒ [<code>Leyning</code>](#Leyning)
|
|
352
|
-
Looks up leyning for a given holiday. Returns some
|
|
353
|
-
of full kriyah aliyot, special Maftir, special Haftarah
|
|
354
|
-
|
|
355
|
-
**Kind**: global function
|
|
356
|
-
**Returns**: [<code>Leyning</code>](#Leyning) - map of aliyot
|
|
357
|
-
|
|
358
|
-
| Param | Type | Default | Description |
|
|
359
|
-
| --- | --- | --- | --- |
|
|
360
|
-
| ev | <code>Event</code> | | the Hebcal event associated with this leyning |
|
|
361
|
-
| [il] | <code>boolean</code> | <code>false</code> | true if Israel holiday scheme |
|
|
362
|
-
|
|
363
|
-
<a name="makeLeyningNames"></a>
|
|
364
|
-
|
|
365
|
-
## makeLeyningNames(parsha) ⇒ [<code>LeyningNames</code>](#LeyningNames)
|
|
366
|
-
Transliterated English and Hebrew names of this parsha
|
|
367
|
-
|
|
368
|
-
**Kind**: global function
|
|
369
|
-
|
|
370
|
-
| Param | Type | Description |
|
|
371
|
-
| --- | --- | --- |
|
|
372
|
-
| parsha | <code>string</code> \| <code>Array.<string></code> | untranslated name like 'Pinchas' or ['Pinchas'] or ['Matot','Masei'] |
|
|
373
|
-
|
|
374
|
-
<a name="getWeekdayReading"></a>
|
|
375
|
-
|
|
376
|
-
## getWeekdayReading(parsha) ⇒ <code>Object.<string, Aliyah></code>
|
|
377
|
-
Looks up Monday/Thursday aliyot for a regular parsha
|
|
378
|
-
|
|
379
|
-
**Kind**: global function
|
|
380
|
-
**Returns**: <code>Object.<string, Aliyah></code> - map of aliyot
|
|
381
|
-
|
|
382
|
-
| Param | Type | Description |
|
|
383
|
-
| --- | --- | --- |
|
|
384
|
-
| parsha | <code>string</code> \| <code>Array.<string></code> | untranslated name like 'Pinchas' or ['Pinchas'] or ['Matot','Masei'] |
|
|
385
|
-
|
|
386
|
-
<a name="getLeyningForParsha"></a>
|
|
387
|
-
|
|
388
|
-
## getLeyningForParsha(parsha) ⇒ [<code>Leyning</code>](#Leyning)
|
|
389
|
-
Looks up regular leyning for a weekly parsha with no special readings
|
|
390
|
-
|
|
391
|
-
**Kind**: global function
|
|
392
|
-
**Returns**: [<code>Leyning</code>](#Leyning) - map of aliyot
|
|
393
|
-
|
|
394
|
-
| Param | Type | Description |
|
|
395
|
-
| --- | --- | --- |
|
|
396
|
-
| parsha | <code>string</code> \| <code>Array.<string></code> | untranslated name like 'Pinchas' or ['Pinchas'] or ['Matot','Masei'] |
|
|
397
|
-
|
|
398
|
-
<a name="getLeyningForParshaHaShavua"></a>
|
|
399
|
-
|
|
400
|
-
## getLeyningForParshaHaShavua(ev, [il]) ⇒ [<code>Leyning</code>](#Leyning)
|
|
401
|
-
Looks up leyning for a regular Shabbat parsha, including any special
|
|
402
|
-
maftir or Haftara.
|
|
403
|
-
|
|
404
|
-
**Kind**: global function
|
|
405
|
-
**Returns**: [<code>Leyning</code>](#Leyning) - map of aliyot
|
|
406
|
-
|
|
407
|
-
| Param | Type | Default | Description |
|
|
408
|
-
| --- | --- | --- | --- |
|
|
409
|
-
| ev | <code>Event</code> | | the Hebcal event associated with this leyning |
|
|
410
|
-
| [il] | <code>boolean</code> | <code>false</code> | in Israel |
|
|
411
|
-
|
|
412
|
-
<a name="lookupParsha"></a>
|
|
413
|
-
|
|
414
|
-
## lookupParsha(parsha) ⇒ [<code>ParshaMeta</code>](#ParshaMeta)
|
|
415
|
-
Returns the parsha metadata
|
|
416
|
-
|
|
417
|
-
**Kind**: global function
|
|
418
|
-
|
|
419
|
-
| Param | Type | Description |
|
|
420
|
-
| --- | --- | --- |
|
|
421
|
-
| parsha | <code>string</code> \| <code>Array.<string></code> | untranslated name like 'Pinchas' or ['Pinchas'] or ['Matot','Masei'] |
|
|
422
|
-
|
|
423
|
-
<a name="getLeyningOnDate"></a>
|
|
424
|
-
|
|
425
|
-
## getLeyningOnDate(hdate, il, [wantarray]) ⇒ [<code>Leyning</code>](#Leyning) \| [<code>Array.<Leyning></code>](#Leyning)
|
|
426
|
-
Looks up leyning for a regular Shabbat, Monday/Thursday weekday or holiday.
|
|
427
|
-
|
|
428
|
-
If `hdate` coincides with a holiday that has Torah reading, returns the
|
|
429
|
-
reading for that day (see [getLeyningForHoliday](#getLeyningForHoliday))
|
|
430
|
-
|
|
431
|
-
Otherwise, if `hdate` is a Saturday, returns [getLeyningForParshaHaShavua](#getLeyningForParshaHaShavua)
|
|
432
|
-
|
|
433
|
-
Otherwise, if `hdate` is a Monday or Thursday, returns [Leyning](#Leyning) for the
|
|
434
|
-
Parashat haShavua, containing only the `weekday` aliyot (no `fullkriyah`).
|
|
435
|
-
|
|
436
|
-
Otherwise, returns `undefined`.
|
|
437
|
-
|
|
438
|
-
**Kind**: global function
|
|
439
|
-
**Returns**: [<code>Leyning</code>](#Leyning) \| [<code>Array.<Leyning></code>](#Leyning) - map of aliyot
|
|
440
|
-
|
|
441
|
-
| Param | Type | Default | Description |
|
|
442
|
-
| --- | --- | --- | --- |
|
|
443
|
-
| hdate | <code>HDate</code> | | Hebrew Date |
|
|
444
|
-
| il | <code>boolean</code> | | in Israel |
|
|
445
|
-
| [wantarray] | <code>boolean</code> | <code>false</code> | to return an array of 0 or more readings |
|
|
446
|
-
|
|
447
|
-
<a name="writeCsvLines"></a>
|
|
448
|
-
|
|
449
|
-
## writeCsvLines(stream, ev, reading, il, isParsha)
|
|
450
|
-
Formats reading for CSV
|
|
451
|
-
|
|
452
|
-
**Kind**: global function
|
|
453
|
-
|
|
454
|
-
| Param | Type |
|
|
455
|
-
| --- | --- |
|
|
456
|
-
| stream | <code>fs.WriteStream</code> |
|
|
457
|
-
| ev | <code>Event</code> |
|
|
458
|
-
| reading | [<code>Leyning</code>](#Leyning) |
|
|
459
|
-
| il | <code>boolean</code> |
|
|
460
|
-
| isParsha | <code>boolean</code> |
|
|
461
|
-
|
|
462
|
-
<a name="Aliyah"></a>
|
|
463
|
-
|
|
464
|
-
## Aliyah : <code>Object</code>
|
|
465
|
-
Represents an aliyah
|
|
466
|
-
|
|
467
|
-
**Kind**: global typedef
|
|
468
|
-
**Properties**
|
|
469
|
-
|
|
470
|
-
| Name | Type | Description |
|
|
471
|
-
| --- | --- | --- |
|
|
472
|
-
| k | <code>string</code> | Book (e.g. "Numbers") |
|
|
473
|
-
| b | <code>string</code> | beginning verse (e.g. "28:9") |
|
|
474
|
-
| e | <code>string</code> | ending verse (e.g. "28:15") |
|
|
475
|
-
| [v] | <code>number</code> | number of verses |
|
|
476
|
-
| [p] | <code>number</code> | parsha number (1=Bereshit, 54=Vezot HaBracha) |
|
|
477
|
-
|
|
478
|
-
<a name="SpecialReading"></a>
|
|
479
|
-
|
|
480
|
-
## SpecialReading : <code>Object</code>
|
|
481
|
-
Leyning for a parsha hashavua or holiday
|
|
482
|
-
|
|
483
|
-
**Kind**: global typedef
|
|
484
|
-
**Properties**
|
|
485
|
-
|
|
486
|
-
| Name | Type | Description |
|
|
487
|
-
| --- | --- | --- |
|
|
488
|
-
| aliyot | <code>Object.<string, Aliyah></code> | Map of aliyot `1` through `7` plus `M` for maftir |
|
|
489
|
-
| [reason] | <code>Object.<string, string></code> | Explanations for special readings, keyed by aliyah number, `M` for maftir or `haftara` for Haftarah |
|
|
490
|
-
| haft | [<code>Aliyah</code>](#Aliyah) \| [<code>Array.<Aliyah></code>](#Aliyah) | Haftarah object(s) |
|
|
491
|
-
| seph | [<code>Aliyah</code>](#Aliyah) \| [<code>Array.<Aliyah></code>](#Aliyah) | Haftarah object(s) |
|
|
492
|
-
|
|
493
|
-
<a name="LeyningNames"></a>
|
|
494
|
-
|
|
495
|
-
## LeyningNames : <code>Object</code>
|
|
496
|
-
Name of the parsha hashavua or holiday
|
|
497
|
-
|
|
498
|
-
**Kind**: global typedef
|
|
499
|
-
**Properties**
|
|
500
|
-
|
|
501
|
-
| Name | Type | Description |
|
|
502
|
-
| --- | --- | --- |
|
|
503
|
-
| en | <code>string</code> | English |
|
|
504
|
-
| he | <code>string</code> | Hebrew (with nikud) |
|
|
505
|
-
|
|
506
|
-
<a name="Leyning"></a>
|
|
507
|
-
|
|
508
|
-
## Leyning : <code>Object</code>
|
|
509
|
-
Leyning for a parsha hashavua or holiday
|
|
510
|
-
|
|
511
|
-
**Kind**: global typedef
|
|
512
|
-
**Properties**
|
|
513
|
-
|
|
514
|
-
| Name | Type | Description |
|
|
515
|
-
| --- | --- | --- |
|
|
516
|
-
| name | [<code>LeyningNames</code>](#LeyningNames) | |
|
|
517
|
-
| [parsha] | <code>Array.<string></code> | An array of either 1 (regular) or 2 (doubled parsha). `undefined` for holiday readings |
|
|
518
|
-
| [parshaNum] | <code>number</code> \| <code>Array.<number></code> | 1 for Bereshit, 2 for Noach, etc. `undefined` for holiday readings |
|
|
519
|
-
| summary | <code>string</code> | Such as `Genesis 1:1 - 6:8` |
|
|
520
|
-
| haft | [<code>Aliyah</code>](#Aliyah) \| [<code>Array.<Aliyah></code>](#Aliyah) | Haftarah object(s) |
|
|
521
|
-
| haftara | <code>string</code> | Haftarah, such as `Isaiah 42:5 – 43:11` |
|
|
522
|
-
| [haftaraNumV] | <code>number</code> | Number of verses in the Haftarah |
|
|
523
|
-
| [seph] | [<code>Aliyah</code>](#Aliyah) \| [<code>Array.<Aliyah></code>](#Aliyah) | Haftarah object(s) for Sephardim |
|
|
524
|
-
| [sephardic] | <code>string</code> | Haftarah for Sephardim, such as `Isaiah 42:5 - 42:21` |
|
|
525
|
-
| [sephardicNumV] | <code>number</code> | Number of verses in the Haftarah for Sephardim |
|
|
526
|
-
| fullkriyah | <code>Object.<string, Aliyah></code> | Map of aliyot `1` through `7` plus `M` for maftir |
|
|
527
|
-
| [weekday] | <code>Object.<string, Aliyah></code> | Optional map of weekday Torah Readings aliyot `1` through `3` for Monday and Thursday |
|
|
528
|
-
| [reason] | <code>Object.<string, string></code> | Explanations for special readings, keyed by aliyah number, `M` for maftir or `haftara` for Haftarah |
|
|
529
|
-
| [megillah] | <code>Object.<string, Aliyah></code> | Optional map of megillah reading. Song of Songs is read on the sabbath of Passover week, the Book of Ruth on Shavuot, Lamentations on Tisha be-Av, Ecclesiastes on the sabbath of the week of Sukkoth, and the Book of Esther on Purim. |
|
|
530
|
-
|
|
531
|
-
<a name="ParshaMeta"></a>
|
|
532
|
-
|
|
533
|
-
## ParshaMeta : <code>Object</code>
|
|
534
|
-
Parsha metadata
|
|
535
|
-
|
|
536
|
-
**Kind**: global typedef
|
|
537
|
-
**Properties**
|
|
538
|
-
|
|
539
|
-
| Name | Type | Description |
|
|
540
|
-
| --- | --- | --- |
|
|
541
|
-
| num | <code>number</code> | 1 for Bereshit, 2 for Noach, etc. `undefined` for holiday readings |
|
|
542
|
-
| hebrew | <code>string</code> | parsha name in Hebrew with niqud |
|
|
543
|
-
| book | <code>number</code> | 1 for Genesis, 2 for Exodus, 5 for Deuteronomy |
|
|
544
|
-
| haft | [<code>Aliyah</code>](#Aliyah) \| [<code>Array.<Aliyah></code>](#Aliyah) | Haftarah object(s) |
|
|
545
|
-
| [seph] | [<code>Aliyah</code>](#Aliyah) \| [<code>Array.<Aliyah></code>](#Aliyah) | Haftarah object(s) for Sephardim |
|
|
546
|
-
| fullkriyah | <code>Object.<string, Array.<string>></code> | Map of aliyot `1` through `7` plus `M` for maftir |
|
|
547
|
-
| weekday | <code>Object.<string, Array.<string>></code> | Map of weekday Torah Readings aliyot `1` through `3` for Monday and Thursday |
|
|
37
|
+
## [API Documentation](https://hebcal.github.io/api/leyning/index.html)
|
package/dist/bundle.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @hebcal/leyning v8.2.
|
|
1
|
+
/*! @hebcal/leyning v8.2.3 */
|
|
2
2
|
var hebcal__leyning = (function (exports, core) {
|
|
3
3
|
'use strict';
|
|
4
4
|
|
|
@@ -460,7 +460,10 @@ var festivals0 = { "Pesach I": {
|
|
|
460
460
|
"M": { "p": 41, "k": 4, "b": "29:1", "e": "29:6" } }
|
|
461
461
|
},
|
|
462
462
|
"Rosh Hashana II": {
|
|
463
|
-
"haft": {
|
|
463
|
+
"haft": {
|
|
464
|
+
"k": "Jeremiah", "b": "31:2", "e": "31:20",
|
|
465
|
+
"note": "labeled 31:1–19 in some books"
|
|
466
|
+
},
|
|
464
467
|
"fullkriyah": { "1": { "p": 4, "k": 1, "b": "22:1", "e": "22:3" },
|
|
465
468
|
"2": { "p": 4, "k": 1, "b": "22:4", "e": "22:8" },
|
|
466
469
|
"3": { "p": 4, "k": 1, "b": "22:9", "e": "22:14" },
|
|
@@ -883,9 +886,9 @@ const HOLIDAY_IGNORE_MASK = core.flags.DAF_YOMI | core.flags.OMER_COUNT | core.f
|
|
|
883
886
|
core.flags.MODERN_HOLIDAY | core.flags.YERUSHALMI_YOMI;
|
|
884
887
|
/**
|
|
885
888
|
* Based on the event date, type and title, finds the relevant leyning key
|
|
886
|
-
* @param
|
|
887
|
-
* @param
|
|
888
|
-
* @
|
|
889
|
+
* @param ev event
|
|
890
|
+
* @param [il] true if Israel holiday scheme
|
|
891
|
+
* @returns key to look up in holiday-reading.json
|
|
889
892
|
*/
|
|
890
893
|
function getLeyningKeyForEvent(ev, il = false) {
|
|
891
894
|
if (typeof ev.eventTime !== 'undefined') {
|
|
@@ -1204,9 +1207,9 @@ function getLeyningForHolidayKey(key, cholHaMoedDay, il) {
|
|
|
1204
1207
|
/**
|
|
1205
1208
|
* Looks up leyning for a given holiday. Returns some
|
|
1206
1209
|
* of full kriyah aliyot, special Maftir, special Haftarah
|
|
1207
|
-
* @param
|
|
1208
|
-
* @param
|
|
1209
|
-
* @
|
|
1210
|
+
* @param ev the Hebcal event associated with this leyning
|
|
1211
|
+
* @param [il] true if Israel holiday scheme
|
|
1212
|
+
* @returns map of aliyot
|
|
1210
1213
|
*/
|
|
1211
1214
|
function getLeyningForHoliday(ev, il = false) {
|
|
1212
1215
|
if (typeof ev !== 'object' || typeof ev.getFlags !== 'function') {
|
|
@@ -2517,8 +2520,6 @@ const parshiyotObj = parshiyotObj0;
|
|
|
2517
2520
|
* on doubled parshiot, read only the second Haftarah
|
|
2518
2521
|
* except for Nitzavim-Vayelech and Achrei Mot-Kedoshim
|
|
2519
2522
|
* @private
|
|
2520
|
-
* @param {string[]} parsha
|
|
2521
|
-
* @return {string}
|
|
2522
2523
|
*/
|
|
2523
2524
|
function getHaftaraKey(parsha) {
|
|
2524
2525
|
const first = parsha[0];
|
|
@@ -2546,8 +2547,8 @@ function makeLeyningNames(parsha) {
|
|
|
2546
2547
|
/**
|
|
2547
2548
|
* Looks up regular leyning for a weekly parsha with no special readings
|
|
2548
2549
|
* @private
|
|
2549
|
-
* @param
|
|
2550
|
-
* @
|
|
2550
|
+
* @param parsha untranslated name like 'Pinchas' or ['Pinchas'] or ['Matot','Masei']
|
|
2551
|
+
* @returns map of aliyot
|
|
2551
2552
|
*/
|
|
2552
2553
|
function getLeyningForParshaShabbatOnly(parsha) {
|
|
2553
2554
|
const raw = lookupParsha(parsha);
|
|
@@ -2562,7 +2563,6 @@ function getLeyningForParshaShabbatOnly(parsha) {
|
|
|
2562
2563
|
const parshaNameArray = raw.combined ? [raw.p1, raw.p2] : [name];
|
|
2563
2564
|
const parts = makeLeyningParts(fullkriyah);
|
|
2564
2565
|
const summary = makeSummaryFromParts(parts);
|
|
2565
|
-
/** @type {Leyning} */
|
|
2566
2566
|
const result = {
|
|
2567
2567
|
name: makeLeyningNames(parshaNameArray),
|
|
2568
2568
|
parsha: parshaNameArray,
|
|
@@ -2624,9 +2624,9 @@ function getLeyningForParsha(parsha) {
|
|
|
2624
2624
|
/**
|
|
2625
2625
|
* Looks up leyning for a regular Shabbat parsha, including any special
|
|
2626
2626
|
* maftir or Haftara.
|
|
2627
|
-
* @param
|
|
2628
|
-
* @param
|
|
2629
|
-
* @
|
|
2627
|
+
* @param ev the Hebcal event associated with this leyning
|
|
2628
|
+
* @param [il] in Israel
|
|
2629
|
+
* @returns map of aliyot
|
|
2630
2630
|
*/
|
|
2631
2631
|
function getLeyningForParshaHaShavua(ev, il = false) {
|
|
2632
2632
|
if (typeof ev !== 'object' || typeof ev.getFlags !== 'function') {
|
|
@@ -2686,8 +2686,7 @@ function getLeyningForParshaHaShavua(ev, il = false) {
|
|
|
2686
2686
|
}
|
|
2687
2687
|
/**
|
|
2688
2688
|
* Returns the parsha metadata
|
|
2689
|
-
* @param
|
|
2690
|
-
* @return {ParshaMeta}
|
|
2689
|
+
* @param parsha untranslated name like 'Pinchas' or ['Pinchas'] or ['Matot','Masei']
|
|
2691
2690
|
*/
|
|
2692
2691
|
function lookupParsha(parsha) {
|
|
2693
2692
|
const name = parshaToString(parsha);
|