@hebcal/leyning 8.2.8 → 9.0.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/dist/bundle.js +1671 -2132
- package/dist/bundle.min.js +2 -2
- package/dist/esm/aliyot.json.js +4 -0
- package/dist/esm/calculateHaftarahNumVerses.d.ts +1 -0
- package/dist/esm/clone.d.ts +12 -0
- package/dist/esm/clone.js +32 -0
- package/dist/esm/common.d.ts +33 -0
- package/dist/esm/common.js +94 -0
- package/dist/esm/csv.d.ts +14 -0
- package/dist/esm/festival.d.ts +9 -0
- package/dist/esm/festival.js +42 -0
- package/dist/esm/getLeyningForHoliday.d.ts +17 -0
- package/dist/esm/getLeyningForHoliday.js +106 -0
- package/dist/esm/getLeyningKeyForEvent.d.ts +9 -0
- package/dist/esm/getLeyningKeyForEvent.js +141 -0
- package/dist/esm/getLeyningOnDate.d.ts +21 -0
- package/dist/esm/getLeyningOnDate.js +134 -0
- package/dist/esm/he.po.d.ts +61 -0
- package/dist/esm/he.po.js +4 -0
- package/dist/esm/holiday-readings.json.js +4 -0
- package/dist/esm/index.d.ts +11 -0
- package/dist/esm/index.js +12 -0
- package/dist/esm/internalTypes.d.ts +20 -0
- package/dist/esm/leyning.d.ts +30 -0
- package/dist/esm/leyning.js +203 -0
- package/dist/esm/locale.d.ts +2 -0
- package/dist/esm/locale.js +17 -0
- package/dist/esm/numverses.json.js +4 -0
- package/dist/esm/specialReadings.d.ts +15 -0
- package/dist/esm/specialReadings.js +142 -0
- package/dist/esm/summary.d.ts +18 -0
- package/dist/esm/summary.js +83 -0
- package/dist/esm/types.d.ts +130 -0
- package/dist/getLeyningForHoliday.d.ts +1 -1
- package/dist/getLeyningKeyForEvent.d.ts +1 -1
- package/dist/getLeyningOnDate.d.ts +1 -1
- package/dist/he.po.d.ts +61 -0
- package/dist/index.cjs +65 -2131
- package/dist/index.d.ts +1 -1
- package/dist/leyning.d.ts +1 -1
- package/dist/locale.d.ts +2 -0
- package/dist/specialReadings.d.ts +1 -1
- package/package.json +30 -15
- package/dist/aliyot.json.d.ts +0 -1570
- package/dist/holiday-readings.json.d.ts +0 -2636
- package/dist/index.mjs +0 -3005
- package/dist/module.d.ts +0 -325
- package/dist/numverses.json.d.ts +0 -36
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/*! @hebcal/leyning v9.0.0 */
|
|
2
|
+
import { formatAliyahShort } from './common.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @private
|
|
6
|
+
*/
|
|
7
|
+
function isChapVerseBefore(a, b) {
|
|
8
|
+
const cv1 = a.split(':').map(x => +x);
|
|
9
|
+
const cv2 = b.split(':').map(x => +x);
|
|
10
|
+
return cv1[0] * 100 + cv1[1] < cv2[0] * 100 + cv2[1];
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Summarizes an `AliyotMap` by collapsing all adjacent aliyot.
|
|
14
|
+
* Finds any non-overlapping parts (e.g. special 7th aliyah or maftir)
|
|
15
|
+
*/
|
|
16
|
+
function makeLeyningParts(aliyot) {
|
|
17
|
+
const nums = Object.keys(aliyot).filter(x => {
|
|
18
|
+
if (x.length === 1) {
|
|
19
|
+
return true;
|
|
20
|
+
}
|
|
21
|
+
const code = x.charCodeAt(0);
|
|
22
|
+
return code >= 48 && code <= 57;
|
|
23
|
+
});
|
|
24
|
+
let start = aliyot[nums[0]];
|
|
25
|
+
let end = start;
|
|
26
|
+
const parts = [];
|
|
27
|
+
for (let i = 0; i < nums.length; i++) {
|
|
28
|
+
const num = nums[i];
|
|
29
|
+
const aliyah = aliyot[num];
|
|
30
|
+
if (i === nums.length - 1 && aliyah.k === end.k && aliyah.e === end.e) {
|
|
31
|
+
// short-circuit when final aliyah is within the previous (e.g. M inside of 7)
|
|
32
|
+
continue;
|
|
33
|
+
}
|
|
34
|
+
const prevEndChap = +end.e.split(':')[0];
|
|
35
|
+
const curStartChap = +aliyah.b.split(':')[0];
|
|
36
|
+
const sameOrNextChap = curStartChap === prevEndChap || curStartChap === prevEndChap + 1;
|
|
37
|
+
if (i !== 0 &&
|
|
38
|
+
(aliyah.k !== start.k ||
|
|
39
|
+
isChapVerseBefore(aliyah.b, start.e) ||
|
|
40
|
+
!sameOrNextChap)) {
|
|
41
|
+
parts.push({ k: start.k, b: start.b, e: end.e });
|
|
42
|
+
start = aliyah;
|
|
43
|
+
}
|
|
44
|
+
end = aliyah;
|
|
45
|
+
}
|
|
46
|
+
parts.push({ k: start.k, b: start.b, e: end.e });
|
|
47
|
+
return parts;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Returns a string representation of the leyning parts.
|
|
51
|
+
* Separate verse ranges read from the same book are separated
|
|
52
|
+
* by commas, e.g. `Isaiah 6:1-7:6, 9:5-6`.
|
|
53
|
+
* Verse ranges from different books are separated by semicolons,
|
|
54
|
+
* e.g. `Genesis 21:1-34; Numbers 29:1-6`.
|
|
55
|
+
*/
|
|
56
|
+
function makeSummaryFromParts(parts) {
|
|
57
|
+
if (!Array.isArray(parts)) {
|
|
58
|
+
parts = [parts];
|
|
59
|
+
}
|
|
60
|
+
let prev = parts[0];
|
|
61
|
+
let summary = formatAliyahShort(prev, true);
|
|
62
|
+
for (let i = 1; i < parts.length; i++) {
|
|
63
|
+
const part = parts[i];
|
|
64
|
+
if (part.k === prev.k) {
|
|
65
|
+
summary += ', ';
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
summary += `; ${part.k} `;
|
|
69
|
+
}
|
|
70
|
+
summary += formatAliyahShort(part, false);
|
|
71
|
+
prev = part;
|
|
72
|
+
}
|
|
73
|
+
return summary;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Makes a summary of the leyning, like "Genesis 6:9-11:32"
|
|
77
|
+
*/
|
|
78
|
+
function makeLeyningSummary(aliyot) {
|
|
79
|
+
const parts = makeLeyningParts(aliyot);
|
|
80
|
+
return makeSummaryFromParts(parts);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export { makeLeyningParts, makeLeyningSummary, makeSummaryFromParts };
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents an aliyah
|
|
3
|
+
*/
|
|
4
|
+
export type Aliyah = {
|
|
5
|
+
/** Book (e.g. "Numbers") */
|
|
6
|
+
k: string;
|
|
7
|
+
/** beginning verse (e.g. "28:9") */
|
|
8
|
+
b: string;
|
|
9
|
+
/** ending verse (e.g. "28:15") */
|
|
10
|
+
e: string;
|
|
11
|
+
/** number of verses */
|
|
12
|
+
v?: number;
|
|
13
|
+
/** parsha number (1=Bereshit, 54=Vezot HaBracha) */
|
|
14
|
+
p?: number;
|
|
15
|
+
reason?: string;
|
|
16
|
+
};
|
|
17
|
+
export type StringMap = {
|
|
18
|
+
[key: string]: string;
|
|
19
|
+
};
|
|
20
|
+
export type AliyotMap = {
|
|
21
|
+
[key: string]: Aliyah;
|
|
22
|
+
};
|
|
23
|
+
/** Name of the parsha hashavua or holiday */
|
|
24
|
+
export type LeyningNames = {
|
|
25
|
+
/** English */
|
|
26
|
+
en: string;
|
|
27
|
+
/** Hebrew (with nikud) */
|
|
28
|
+
he: string;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Parsha metadata (underlying JSON object)
|
|
32
|
+
*/
|
|
33
|
+
export type ParshaMeta = {
|
|
34
|
+
/** 1 for Bereshit, 2 for Noach, etc. `undefined` for holiday readings */
|
|
35
|
+
num: number | number[];
|
|
36
|
+
/** parsha name in Hebrew with niqud */
|
|
37
|
+
hebrew: string;
|
|
38
|
+
/** 1 for Genesis, 2 for Exodus, 5 for Deuteronomy */
|
|
39
|
+
book: number;
|
|
40
|
+
/** Haftarah object(s) */
|
|
41
|
+
haft: Aliyah | Aliyah[];
|
|
42
|
+
/** Haftarah object(s) for Sephardim */
|
|
43
|
+
seph?: Aliyah | Aliyah[];
|
|
44
|
+
/** Map of Shabbat aliyot `1` through `7` plus `M` for maftir */
|
|
45
|
+
fullkriyah: {
|
|
46
|
+
[key: string]: string[];
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* Map of weekday Torah Readings
|
|
50
|
+
* aliyot `1` through `3` for Monday and Thursday
|
|
51
|
+
*/
|
|
52
|
+
weekday?: {
|
|
53
|
+
[key: string]: string[];
|
|
54
|
+
};
|
|
55
|
+
combined?: boolean;
|
|
56
|
+
p1?: string;
|
|
57
|
+
p2?: string;
|
|
58
|
+
num1?: number;
|
|
59
|
+
num2?: number;
|
|
60
|
+
};
|
|
61
|
+
export type SpecialReading = {
|
|
62
|
+
/** Map of aliyot `1` through `7` plus `M` for maftir */
|
|
63
|
+
aliyot: AliyotMap;
|
|
64
|
+
/**
|
|
65
|
+
* Explanations for special readings,
|
|
66
|
+
* keyed by aliyah number, `M` for maftir or `haftara` for Haftarah
|
|
67
|
+
*/
|
|
68
|
+
reason: StringMap;
|
|
69
|
+
/** Haftarah object(s) */
|
|
70
|
+
haft?: Aliyah | Aliyah[];
|
|
71
|
+
/** Haftarah object(s) for Sephardim */
|
|
72
|
+
seph?: Aliyah | Aliyah[];
|
|
73
|
+
};
|
|
74
|
+
/**
|
|
75
|
+
* Leyning base - weekday, parsha hashavua or holiday
|
|
76
|
+
*/
|
|
77
|
+
export type LeyningBase = {
|
|
78
|
+
/** Name of the parsha hashavua or holiday */
|
|
79
|
+
name: LeyningNames;
|
|
80
|
+
/** Such as `Genesis 1:1 - 6:8` */
|
|
81
|
+
summary: string;
|
|
82
|
+
summaryParts?: Aliyah[];
|
|
83
|
+
note?: string;
|
|
84
|
+
};
|
|
85
|
+
/**
|
|
86
|
+
* Parashat haShavua - weekday or Shabbat
|
|
87
|
+
*/
|
|
88
|
+
export type LeyningParshaHaShavua = LeyningBase & {
|
|
89
|
+
/** An array of either 1 (regular) or 2 (doubled parsha). `undefined` for holiday readings */
|
|
90
|
+
parsha?: string[];
|
|
91
|
+
/** 1 for Bereshit, 2 for Noach, etc. `undefined` for holiday readings */
|
|
92
|
+
parshaNum?: number | number[];
|
|
93
|
+
};
|
|
94
|
+
/**
|
|
95
|
+
* Parashat haShavua - weekday
|
|
96
|
+
*/
|
|
97
|
+
export type LeyningWeekday = LeyningParshaHaShavua & {
|
|
98
|
+
/** Optional map of weekday Torah Readings aliyot `1` through `3` for Monday and Thursday */
|
|
99
|
+
weekday?: AliyotMap;
|
|
100
|
+
};
|
|
101
|
+
export type HaftarahProps = {
|
|
102
|
+
/** Haftarah object */
|
|
103
|
+
haft: Aliyah | Aliyah[];
|
|
104
|
+
/** Haftarah, such as `Isaiah 42:5 – 43:11` */
|
|
105
|
+
haftara: string;
|
|
106
|
+
/** Number of verses in the Haftarah */
|
|
107
|
+
haftaraNumV?: number;
|
|
108
|
+
};
|
|
109
|
+
/**
|
|
110
|
+
* Shabbat and holiday leyning always has full kriyah and haftarah
|
|
111
|
+
*/
|
|
112
|
+
export type LeyningShabbatHoliday = LeyningBase & HaftarahProps & {
|
|
113
|
+
/** Map of aliyot `1` through `7` plus `M` for maftir */
|
|
114
|
+
fullkriyah: AliyotMap;
|
|
115
|
+
/** Haftarah object for Sephardim */
|
|
116
|
+
seph?: Aliyah | Aliyah[];
|
|
117
|
+
/** Haftarah for Sephardim, such as `Isaiah 42:5 - 42:21` */
|
|
118
|
+
sephardic?: string;
|
|
119
|
+
/** Number of verses in the Haftarah for Sephardim */
|
|
120
|
+
sephardicNumV?: number;
|
|
121
|
+
/** Explanations for special readings, keyed by aliyah number, `M` for maftir or `haftara` for Haftarah */
|
|
122
|
+
reason?: StringMap;
|
|
123
|
+
/** 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 */
|
|
124
|
+
megillah?: AliyotMap;
|
|
125
|
+
/** Triennial alternate Haftara */
|
|
126
|
+
triHaftara?: string;
|
|
127
|
+
/** Triennial alternate Haftara number of verses */
|
|
128
|
+
triHaftaraNumV?: number;
|
|
129
|
+
};
|
|
130
|
+
export type Leyning = LeyningBase & LeyningParshaHaShavua & LeyningShabbatHoliday & LeyningWeekday;
|
package/dist/he.po.d.ts
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
headers: {
|
|
3
|
+
"plural-forms": string;
|
|
4
|
+
};
|
|
5
|
+
contexts: {
|
|
6
|
+
"": {
|
|
7
|
+
"Shabbat Machar Chodesh": string[];
|
|
8
|
+
"Shabbat Rosh Chodesh": string[];
|
|
9
|
+
"Pesach I (on Shabbat)": string[];
|
|
10
|
+
"Pesach Chol ha-Moed Day 1": string[];
|
|
11
|
+
"Pesach Chol ha-Moed Day 2": string[];
|
|
12
|
+
"Pesach Chol ha-Moed Day 2 on Sunday": string[];
|
|
13
|
+
"Pesach Chol ha-Moed Day 3": string[];
|
|
14
|
+
"Pesach Chol ha-Moed Day 3 on Monday": string[];
|
|
15
|
+
"Pesach Chol ha-Moed Day 4": string[];
|
|
16
|
+
"Pesach Chol ha-Moed Day 5": string[];
|
|
17
|
+
"Pesach Shabbat Chol ha-Moed": string[];
|
|
18
|
+
"Pesach VII (on Shabbat)": string[];
|
|
19
|
+
"Pesach VIII (on Shabbat)": string[];
|
|
20
|
+
"Shavuot II (on Shabbat)": string[];
|
|
21
|
+
"Rosh Hashana I (on Shabbat)": string[];
|
|
22
|
+
"Yom Kippur (on Shabbat)": string[];
|
|
23
|
+
"Yom Kippur (Mincha, Traditional)": string[];
|
|
24
|
+
"Yom Kippur (Mincha, Alternate)": string[];
|
|
25
|
+
"Sukkot I (on Shabbat)": string[];
|
|
26
|
+
"Sukkot Chol ha-Moed Day 1": string[];
|
|
27
|
+
"Sukkot Chol ha-Moed Day 2": string[];
|
|
28
|
+
"Sukkot Chol ha-Moed Day 3": string[];
|
|
29
|
+
"Sukkot Chol ha-Moed Day 4": string[];
|
|
30
|
+
"Sukkot Chol ha-Moed Day 5": string[];
|
|
31
|
+
"Sukkot Shabbat Chol ha-Moed": string[];
|
|
32
|
+
"Sukkot Final Day (Hoshana Raba)": string[];
|
|
33
|
+
"Shmini Atzeret (on Shabbat)": string[];
|
|
34
|
+
"Chanukah Day 1": string[];
|
|
35
|
+
"Chanukah Day 2": string[];
|
|
36
|
+
"Chanukah Day 3": string[];
|
|
37
|
+
"Chanukah Day 4": string[];
|
|
38
|
+
"Chanukah Day 5": string[];
|
|
39
|
+
"Chanukah Day 6": string[];
|
|
40
|
+
"Chanukah Day 7": string[];
|
|
41
|
+
"Chanukah Day 7 (on Rosh Chodesh)": string[];
|
|
42
|
+
"Chanukah Day 8": string[];
|
|
43
|
+
"Chanukah Day 1 (on Shabbat)": string[];
|
|
44
|
+
"Chanukah Day 2 (on Shabbat)": string[];
|
|
45
|
+
"Chanukah Day 3 (on Shabbat)": string[];
|
|
46
|
+
"Chanukah Day 4 (on Shabbat)": string[];
|
|
47
|
+
"Chanukah Day 5 (on Shabbat)": string[];
|
|
48
|
+
"Chanukah Day 7 (on Shabbat)": string[];
|
|
49
|
+
"Chanukah Day 8 (on Shabbat)": string[];
|
|
50
|
+
"Shabbat Rosh Chodesh Chanukah": string[];
|
|
51
|
+
"Yom Kippur (Mincha)": string[];
|
|
52
|
+
"Tish'a B'Av (Mincha)": string[];
|
|
53
|
+
"Asara B'Tevet (Mincha)": string[];
|
|
54
|
+
"Ta'anit Bechorot (Mincha)": string[];
|
|
55
|
+
"Ta'anit Esther (Mincha)": string[];
|
|
56
|
+
"Tzom Gedaliah (Mincha)": string[];
|
|
57
|
+
"Tzom Tammuz (Mincha)": string[];
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
export default _default;
|