@hebcal/leyning 9.3.0 → 9.4.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.
@@ -1,4 +1,4 @@
1
- /*! @hebcal/leyning v9.3.0 */
1
+ /*! @hebcal/leyning v9.4.1 */
2
2
  const Shavuot={note:"Israel only",il:true,megillah:"Ruth",haft:[{k:"Ezekiel",b:"1:1",e:"1:28"},{k:"Ezekiel",b:"3:12",e:"3:12"}],fullkriyah:{"1":{p:17,k:2,b:"19:1",e:"19:6"},"2":{p:17,k:2,b:"19:7",e:"19:13"},"3":{p:17,k:2,b:"19:14",e:"19:19"},"4":{p:17,k:2,b:"19:20",e:"20:14"},"5":{p:17,k:2,b:"20:15",e:"20:23"},M:{p:41,k:4,b:"28:26",e:"28:31"}}};const Purim={megillah:"Esther",fullkriyah:{"1":{p:16,k:2,b:"17:8",e:"17:10"},"2":{p:16,k:2,b:"17:11",e:"17:13"},"3":{p:16,k:2,b:"17:14",e:"17:16"}}};var festivals0 = {"Pesach I":{haft:[{k:"Joshua",b:"3:5",e:"3:7"},{k:"Joshua",b:"5:2",e:"6:1"},{k:"Joshua",b:"6:27",e:"6:27"}],seph:[{k:"Joshua",b:"5:2",e:"6:1"},{k:"Joshua",b:"6:27",e:"6:27"}],fullkriyah:{"1":{p:15,k:2,b:"12:21",e:"12:24"},"2":{p:15,k:2,b:"12:25",e:"12:28"},"3":{p:15,k:2,b:"12:29",e:"12:36"},"4":{p:15,k:2,b:"12:37",e:"12:42"},"5":{p:15,k:2,b:"12:43",e:"12:51"},M:{p:41,k:4,b:"28:16",e:"28:25"}}},"Pesach I (on Shabbat)":{haft:[{k:"Joshua",b:"3:5",e:"3:7"},{k:"Joshua",b:"5:2",e:"6:1"},{k:"Joshua",b:"6:27",e:"6:27"}],seph:[{k:"Joshua",b:"5:2",e:"6:1"},{k:"Joshua",b:"6:27",e:"6:27"}],fullkriyah:{"1":{p:15,k:2,b:"12:21",e:"12:24"},"2":{p:15,k:2,b:"12:25",e:"12:28"},"3":{p:15,k:2,b:"12:29",e:"12:32"},"4":{p:15,k:2,b:"12:33",e:"12:36"},"5":{p:15,k:2,b:"12:37",e:"12:42"},"6":{p:15,k:2,b:"12:43",e:"12:47"},"7":{p:15,k:2,b:"12:48",e:"12:51"},M:{p:41,k:4,b:"28:16",e:"28:25"}}},"Pesach II":{haft:[{k:"II Kings",b:"23:1",e:"23:9"},{k:"II Kings",b:"23:21",e:"23:25"}],fullkriyah:{"1":{p:31,k:3,b:"22:26",e:"23:3"},"2":{p:31,k:3,b:"23:4",e:"23:14"},"3":{p:31,k:3,b:"23:15",e:"23:22"},"4":{p:31,k:3,b:"23:23",e:"23:32"},"5":{p:31,k:3,b:"23:33",e:"23:44"},M:{p:41,k:4,b:"28:16",e:"28:25"}}},"Pesach II (CH''M)":{note:"Israel only - according to Vaani T'fillati Siddur Yisraeli",il:true,fullkriyah:{"1":{p:31,k:3,b:"22:26",e:"23:8"},"2":{p:31,k:3,b:"23:9",e:"23:14"},"3":{p:31,k:3,b:"23:15",e:"23:44"},"4":{p:41,k:4,b:"28:19",e:"28:25"}}},"Pesach Chol ha-Moed Day 1":{fullkriyah:{"1":{p:15,k:2,b:"13:1",e:"13:4"},"2":{p:15,k:2,b:"13:5",e:"13:10"},"3":{p:15,k:2,b:"13:11",e:"13:16"},"4":{p:41,k:4,b:"28:19",e:"28:25"}}},"Pesach Chol ha-Moed Day 2":{fullkriyah:{"1":{p:18,k:2,b:"22:24",e:"22:26"},"2":{p:18,k:2,b:"22:27",e:"23:5"},"3":{p:18,k:2,b:"23:6",e:"23:19"},"4":{p:41,k:4,b:"28:19",e:"28:25"}}},"Pesach Chol ha-Moed Day 3":{fullkriyah:{"1":{p:21,k:2,b:"34:1",e:"34:10"},"2":{p:21,k:2,b:"34:11",e:"34:17"},"3":{p:21,k:2,b:"34:18",e:"34:26"},"4":{p:41,k:4,b:"28:19",e:"28:25"}}},"Pesach Chol ha-Moed Day 4":{fullkriyah:{"1":{p:36,k:4,b:"9:1",e:"9:5"},"2":{p:36,k:4,b:"9:6",e:"9:8"},"3":{p:36,k:4,b:"9:9",e:"9:14"},"4":{p:41,k:4,b:"28:19",e:"28:25"}}},"Pesach Shabbat Chol ha-Moed":{megillah:"Song of Songs",haft:{k:"Ezekiel",b:"37:1",e:"37:14"},fullkriyah:{"1":{p:21,k:2,b:"33:12",e:"33:16"},"2":{p:21,k:2,b:"33:17",e:"33:19"},"3":{p:21,k:2,b:"33:20",e:"33:23"},"4":{p:21,k:2,b:"34:1",e:"34:3"},"5":{p:21,k:2,b:"34:4",e:"34:10"},"6":{p:21,k:2,b:"34:11",e:"34:17"},"7":{p:21,k:2,b:"34:18",e:"34:26"},M:{p:41,k:4,b:"28:19",e:"28:25"}}},"Pesach VII":{haft:{k:"II Samuel",b:"22:1",e:"22:51"},fullkriyah:{"1":{p:16,k:2,b:"13:17",e:"13:22"},"2":{p:16,k:2,b:"14:1",e:"14:8"},"3":{p:16,k:2,b:"14:9",e:"14:14"},"4":{p:16,k:2,b:"14:15",e:"14:25"},"5":{p:16,k:2,b:"14:26",e:"15:26"},M:{p:41,k:4,b:"28:19",e:"28:25"}}},"Pesach VII (on Shabbat)":{megillah:"Song of Songs",haft:{k:"II Samuel",b:"22:1",e:"22:51"},fullkriyah:{"1":{p:16,k:2,b:"13:17",e:"13:19"},"2":{p:16,k:2,b:"13:20",e:"13:22"},"3":{p:16,k:2,b:"14:1",e:"14:4"},"4":{p:16,k:2,b:"14:5",e:"14:8"},"5":{p:16,k:2,b:"14:9",e:"14:14"},"6":{p:16,k:2,b:"14:15",e:"14:25"},"7":{p:16,k:2,b:"14:26",e:"15:26"},M:{p:41,k:4,b:"28:19",e:"28:25"}}},"Pesach VIII":{haft:{k:"Isaiah",b:"10:32",e:"12:6"},fullkriyah:{"1":{p:47,k:5,b:"15:19",e:"15:23"},"2":{p:47,k:5,b:"16:1",e:"16:3"},"3":{p:47,k:5,b:"16:4",e:"16:8"},"4":{p:47,k:5,b:"16:9",e:"16:12"},"5":{p:47,k:5,b:"16:13",e:"16:17"},M:{p:41,k:4,b:"28:19",e:"28:25"}}},"Pesach VIII (on Shabbat)":{megillah:"Song of Songs",haft:{k:"Isaiah",b:"10:32",e:"12:6"},fullkriyah:{"1":{p:47,k:5,b:"14:22",e:"14:29"},"2":{p:47,k:5,b:"15:1",e:"15:18"},"3":{p:47,k:5,b:"15:19",e:"15:23"},"4":{p:47,k:5,b:"16:1",e:"16:3"},"5":{p:47,k:5,b:"16:4",e:"16:8"},"6":{p:47,k:5,b:"16:9",e:"16:12"},"7":{p:47,k:5,b:"16:13",e:"16:17"},M:{p:41,k:4,b:"28:19",e:"28:25"}}},"Pesach III (CH''M)":{alias:true,il:true,key:"Pesach Chol ha-Moed Day 1"},"Pesach IV (CH''M)":{alias:true,il:true,key:"Pesach Chol ha-Moed Day 2"},"Pesach V (CH''M)":{alias:true,il:true,key:"Pesach Chol ha-Moed Day 3"},"Pesach VI (CH''M)":{alias:true,il:true,key:"Pesach Chol ha-Moed Day 4"},"Pesach Chol ha-Moed Day 2 on Sunday":{alias:true,il:false,key:"Pesach Chol ha-Moed Day 1"},"Pesach Chol ha-Moed Day 3 on Monday":{alias:true,il:false,key:"Pesach Chol ha-Moed Day 2"},Shavuot:Shavuot,"Shavuot I":{haft:[{k:"Ezekiel",b:"1:1",e:"1:28"},{k:"Ezekiel",b:"3:12",e:"3:12"}],fullkriyah:{"1":{p:17,k:2,b:"19:1",e:"19:6"},"2":{p:17,k:2,b:"19:7",e:"19:13"},"3":{p:17,k:2,b:"19:14",e:"19:19"},"4":{p:17,k:2,b:"19:20",e:"20:14"},"5":{p:17,k:2,b:"20:15",e:"20:23"},M:{p:41,k:4,b:"28:26",e:"28:31"}}},"Shavuot II":{megillah:"Ruth",haft:{k:"Habakkuk",b:"3:1",e:"3:19"},seph:{k:"Habakkuk",b:"2:20",e:"3:19"},fullkriyah:{"1":{p:47,k:5,b:"15:19",e:"15:23"},"2":{p:47,k:5,b:"16:1",e:"16:3"},"3":{p:47,k:5,b:"16:4",e:"16:8"},"4":{p:47,k:5,b:"16:9",e:"16:12"},"5":{p:47,k:5,b:"16:13",e:"16:17"},M:{p:41,k:4,b:"28:26",e:"28:31"}}},"Shavuot II (on Shabbat)":{megillah:"Ruth",haft:{k:"Habakkuk",b:"3:1",e:"3:19"},seph:{k:"Habakkuk",b:"2:20",e:"3:19"},fullkriyah:{"1":{p:47,k:5,b:"14:22",e:"14:29"},"2":{p:47,k:5,b:"15:1",e:"15:18"},"3":{p:47,k:5,b:"15:19",e:"15:23"},"4":{p:47,k:5,b:"16:1",e:"16:3"},"5":{p:47,k:5,b:"16:4",e:"16:8"},"6":{p:47,k:5,b:"16:9",e:"16:12"},"7":{p:47,k:5,b:"16:13",e:"16:17"},M:{p:41,k:4,b:"28:26",e:"28:31"}}},"Fast Day (Morning)":{fullkriyah:{"1":{p:21,k:2,b:"32:11",e:"32:14"},"2":{p:21,k:2,b:"34:1",e:"34:3"},"3":{p:21,k:2,b:"34:4",e:"34:10"}}},"Fast Day (Afternoon)":{haft:{k:"Isaiah",b:"55:6",e:"56:8"},fullkriyah:{"1":{p:21,k:2,b:"32:11",e:"32:14"},"2":{p:21,k:2,b:"34:1",e:"34:3"},M:{p:21,k:2,b:"34:4",e:"34:10"}}},"Asara B'Tevet":{alias:true,key:"Fast Day (Morning)"},"Ta'anit Esther":{alias:true,key:"Fast Day (Morning)"},"Tzom Gedaliah":{alias:true,key:"Fast Day (Morning)"},"Tzom Tammuz":{alias:true,key:"Fast Day (Morning)"},"Asara B'Tevet (Mincha)":{alias:true,key:"Fast Day (Afternoon)"},"Ta'anit Esther (Mincha)":{alias:true,key:"Fast Day (Afternoon)"},"Tzom Gedaliah (Mincha)":{alias:true,key:"Fast Day (Afternoon)"},"Tzom Tammuz (Mincha)":{alias:true,key:"Fast Day (Afternoon)"},"Erev Tish'a B'Av":{megillah:"Lamentations"},"Tish'a B'Av":{haft:{k:"Jeremiah",b:"8:13",e:"9:23"},fullkriyah:{"1":{p:45,k:5,b:"4:25",e:"4:29"},"2":{p:45,k:5,b:"4:30",e:"4:35"},"3":{p:45,k:5,b:"4:36",e:"4:40"}},megillah:"Lamentations"},"Tish'a B'Av (Mincha)":{alias:true,key:"Fast Day (Afternoon)"},"Rosh Hashana I":{haft:{k:"I Samuel",b:"1:1",e:"2:10"},fullkriyah:{"1":{p:4,k:1,b:"21:1",e:"21:4"},"2":{p:4,k:1,b:"21:5",e:"21:12"},"3":{p:4,k:1,b:"21:13",e:"21:21"},"4":{p:4,k:1,b:"21:22",e:"21:27"},"5":{p:4,k:1,b:"21:28",e:"21:34"},M:{p:41,k:4,b:"29:1",e:"29:6"}}},"Rosh Hashana I (on Shabbat)":{haft:{k:"I Samuel",b:"1:1",e:"2:10"},fullkriyah:{"1":{p:4,k:1,b:"21:1",e:"21:4"},"2":{p:4,k:1,b:"21:5",e:"21:8"},"3":{p:4,k:1,b:"21:9",e:"21:12"},"4":{p:4,k:1,b:"21:13",e:"21:17"},"5":{p:4,k:1,b:"21:18",e:"21:21"},"6":{p:4,k:1,b:"21:22",e:"21:27"},"7":{p:4,k:1,b:"21:28",e:"21:34"},M:{p:41,k:4,b:"29:1",e:"29:6"}}},"Rosh Hashana II":{haft:{k:"Jeremiah",b:"31:2",e:"31:20",note:"labeled 31:1–19 in some books"},fullkriyah:{"1":{p:4,k:1,b:"22:1",e:"22:3"},"2":{p:4,k:1,b:"22:4",e:"22:8"},"3":{p:4,k:1,b:"22:9",e:"22:14"},"4":{p:4,k:1,b:"22:15",e:"22:19"},"5":{p:4,k:1,b:"22:20",e:"22:24"},M:{p:41,k:4,b:"29:1",e:"29:6"}}},"Yom Kippur":{haft:{k:"Isaiah",b:"57:14",e:"58:14"},fullkriyah:{"1":{p:29,k:3,b:"16:1",e:"16:6"},"2":{p:29,k:3,b:"16:7",e:"16:11"},"3":{p:29,k:3,b:"16:12",e:"16:17"},"4":{p:29,k:3,b:"16:18",e:"16:24"},"5":{p:29,k:3,b:"16:25",e:"16:30"},"6":{p:29,k:3,b:"16:31",e:"16:34"},M:{p:41,k:4,b:"29:7",e:"29:11"}}},"Yom Kippur (on Shabbat)":{haft:{k:"Isaiah",b:"57:14",e:"58:14"},fullkriyah:{"1":{p:29,k:3,b:"16:1",e:"16:3"},"2":{p:29,k:3,b:"16:4",e:"16:6"},"3":{p:29,k:3,b:"16:7",e:"16:11"},"4":{p:29,k:3,b:"16:12",e:"16:17"},"5":{p:29,k:3,b:"16:18",e:"16:24"},"6":{p:29,k:3,b:"16:25",e:"16:30"},"7":{p:29,k:3,b:"16:31",e:"16:34"},M:{p:41,k:4,b:"29:7",e:"29:11"}}},"Yom Kippur (Mincha)":{alias:true,key:"Yom Kippur (Mincha, Traditional)"},"Yom Kippur (Mincha, Traditional)":{haft:[{k:"Jonah",b:"1:1",e:"4:11"},{k:"Micah",b:"7:18",e:"7:20"}],fullkriyah:{"1":{p:29,k:3,b:"18:1",e:"18:5"},"2":{p:29,k:3,b:"18:6",e:"18:21"},M:{p:29,k:3,b:"18:22",e:"18:30"}}},"Yom Kippur (Mincha, Alternate)":{haft:[{k:"Jonah",b:"1:1",e:"4:11"},{k:"Micah",b:"7:18",e:"7:20"}],fullkriyah:{"1":{p:30,k:3,b:"19:1",e:"19:4"},"2":{p:30,k:3,b:"19:5",e:"19:10"},M:{p:30,k:3,b:"19:11",e:"19:18"}}},"Sukkot I":{haft:{k:"Zechariah",b:"14:1",e:"14:21"},fullkriyah:{"1":{p:31,k:3,b:"22:26",e:"23:3"},"2":{p:31,k:3,b:"23:4",e:"23:14"},"3":{p:31,k:3,b:"23:15",e:"23:22"},"4":{p:31,k:3,b:"23:23",e:"23:32"},"5":{p:31,k:3,b:"23:33",e:"23:44"},M:{p:41,k:4,b:"29:12",e:"29:16"}}},"Sukkot I (on Shabbat)":{haft:{k:"Zechariah",b:"14:1",e:"14:21"},fullkriyah:{"1":{p:31,k:3,b:"22:26",e:"22:33"},"2":{p:31,k:3,b:"23:1",e:"23:3"},"3":{p:31,k:3,b:"23:4",e:"23:8"},"4":{p:31,k:3,b:"23:9",e:"23:14"},"5":{p:31,k:3,b:"23:15",e:"23:22"},"6":{p:31,k:3,b:"23:23",e:"23:32"},"7":{p:31,k:3,b:"23:33",e:"23:44"},M:{p:41,k:4,b:"29:12",e:"29:16"}}},"Sukkot II":{haft:{k:"I Kings",b:"8:2",e:"8:21"},fullkriyah:{"1":{p:31,k:3,b:"22:26",e:"23:3"},"2":{p:31,k:3,b:"23:4",e:"23:14"},"3":{p:31,k:3,b:"23:15",e:"23:22"},"4":{p:31,k:3,b:"23:23",e:"23:32"},"5":{p:31,k:3,b:"23:33",e:"23:44"},M:{p:41,k:4,b:"29:12",e:"29:16"}}},"Sukkot Chol ha-Moed Day 1":{fullkriyah:{"1":{p:41,k:4,b:"29:17",e:"29:19"},"2":{p:41,k:4,b:"29:20",e:"29:22"},"3":{p:41,k:4,b:"29:23",e:"29:25"},"4":{p:41,k:4,b:"29:17",e:"29:22"}}},"Sukkot Chol ha-Moed Day 2":{fullkriyah:{"1":{p:41,k:4,b:"29:20",e:"29:22"},"2":{p:41,k:4,b:"29:23",e:"29:25"},"3":{p:41,k:4,b:"29:26",e:"29:28"},"4":{p:41,k:4,b:"29:20",e:"29:25"}}},"Sukkot Chol ha-Moed Day 3":{fullkriyah:{"1":{p:41,k:4,b:"29:23",e:"29:25"},"2":{p:41,k:4,b:"29:26",e:"29:28"},"3":{p:41,k:4,b:"29:29",e:"29:31"},"4":{p:41,k:4,b:"29:23",e:"29:28"}}},"Sukkot Chol ha-Moed Day 4":{fullkriyah:{"1":{p:41,k:4,b:"29:26",e:"29:28"},"2":{p:41,k:4,b:"29:29",e:"29:31"},"3":{p:41,k:4,b:"29:32",e:"29:34"},"4":{p:41,k:4,b:"29:26",e:"29:31"}}},"Sukkot Chol ha-Moed Day 5":{fullkriyah:{"1":{p:41,k:4,b:"29:29",e:"29:31"},"2":{p:41,k:4,b:"29:32",e:"29:34"},"3":{p:41,k:4,b:"29:35",e:"29:37"},"4":{p:41,k:4,b:"29:29",e:"29:34"}}},"Sukkot Shabbat Chol ha-Moed":{megillah:"Ecclesiastes",haft:{k:"Ezekiel",b:"38:18",e:"39:16"},fullkriyah:{"1":{p:21,k:2,b:"33:12",e:"33:16"},"2":{p:21,k:2,b:"33:17",e:"33:19"},"3":{p:21,k:2,b:"33:20",e:"33:23"},"4":{p:21,k:2,b:"34:1",e:"34:3"},"5":{p:21,k:2,b:"34:4",e:"34:10"},"6":{p:21,k:2,b:"34:11",e:"34:17"},"7":{p:21,k:2,b:"34:18",e:"34:26"},"M-day1":{p:41,k:4,b:"29:17",e:"29:22"},"M-day2":{p:41,k:4,b:"29:20",e:"29:25"},"M-day3":{p:41,k:4,b:"29:23",e:"29:28"},"M-day4":{p:41,k:4,b:"29:26",e:"29:31"},"M-day5":{p:41,k:4,b:"29:29",e:"29:34"}}},"Sukkot Final Day (Hoshana Raba)":{fullkriyah:{"1":{p:41,k:4,b:"29:26",e:"29:28"},"2":{p:41,k:4,b:"29:29",e:"29:31"},"3":{p:41,k:4,b:"29:32",e:"29:34"},"4":{p:41,k:4,b:"29:29",e:"29:34"}}},"Shmini Atzeret":{haft:{k:"I Kings",b:"8:54",e:"8:66"},fullkriyah:{"1":{p:47,k:5,b:"14:22",e:"14:29"},"2":{p:47,k:5,b:"15:1",e:"15:18"},"3":{p:47,k:5,b:"15:19",e:"16:3"},"4":{p:47,k:5,b:"16:4",e:"16:8"},"5":{p:47,k:5,b:"16:9",e:"16:17"},M:{p:41,k:4,b:"29:35",e:"30:1"}},alt:{"1":{p:47,k:5,b:"14:22",e:"15:23"},"2":{p:47,k:5,b:"16:1",e:"16:3"},"3":{p:47,k:5,b:"16:4",e:"16:8"},"4":{p:47,k:5,b:"16:9",e:"16:12"},"5":{p:47,k:5,b:"16:13",e:"16:17"},M:{p:41,k:4,b:"29:35",e:"30:1"}}},"Shmini Atzeret (on Shabbat)":{megillah:"Ecclesiastes",haft:{k:"I Kings",b:"8:54",e:"8:66"},fullkriyah:{"1":{p:47,k:5,b:"14:22",e:"14:29"},"2":{p:47,k:5,b:"15:1",e:"15:18"},"3":{p:47,k:5,b:"15:19",e:"15:23"},"4":{p:47,k:5,b:"16:1",e:"16:3"},"5":{p:47,k:5,b:"16:4",e:"16:8"},"6":{p:47,k:5,b:"16:9",e:"16:12"},"7":{p:47,k:5,b:"16:13",e:"16:17"},M:{p:41,k:4,b:"29:35",e:"30:1"}}},"Erev Simchat Torah":{fullkriyah:{"1":{p:54,k:5,b:"33:1",e:"33:7"},"2":{p:54,k:5,b:"33:8",e:"33:12"},"3":{p:54,k:5,b:"33:13",e:"33:17"}}},"Simchat Torah":{haft:{k:"Joshua",b:"1:1",e:"1:18"},fullkriyah:{"1":{p:54,k:5,b:"33:1",e:"33:7"},"2":{p:54,k:5,b:"33:8",e:"33:12"},"3":{p:54,k:5,b:"33:13",e:"33:17"},"4":{p:54,k:5,b:"33:18",e:"33:21"},"5":{p:54,k:5,b:"33:22",e:"33:26"},"6":{p:54,k:5,b:"33:27",e:"34:12"},"7":{p:1,k:1,b:"1:1",e:"2:3"},M:{p:41,k:4,b:"29:35",e:"30:1"}}},"Simchat Torah (on Shabbat)":{megillah:"Ecclesiastes",haft:{k:"Joshua",b:"1:1",e:"1:18"},fullkriyah:{"1":{p:54,k:5,b:"33:1",e:"33:7"},"2":{p:54,k:5,b:"33:8",e:"33:12"},"3":{p:54,k:5,b:"33:13",e:"33:17"},"4":{p:54,k:5,b:"33:18",e:"33:21"},"5":{p:54,k:5,b:"33:22",e:"33:26"},"6":{p:54,k:5,b:"33:27",e:"33:29"},"7":{p:54,k:5,b:"34:1",e:"34:12"},"8":{p:1,k:1,b:"1:1",e:"2:3"},M:{p:41,k:4,b:"29:35",e:"30:1"}}},"Shabbat Rosh Chodesh Chanukah":{haft:{k:"Zechariah",b:"2:14",e:"4:7"},fullkriyah:{"7":{p:41,k:4,b:"28:9",e:"28:15"},M:{p:35,k:4,b:"7:42",e:"7:47"}}},"Chanukah Day 1":{fullkriyah:{"1":{p:35,k:4,b:"7:1",e:"7:11"},"2":{p:35,k:4,b:"7:12",e:"7:14"},"3":{p:35,k:4,b:"7:15",e:"7:17"}},alt:{"1":{p:35,k:4,b:"7:1",e:"7:3"},"2":{p:35,k:4,b:"7:4",e:"7:11"},"3":{p:35,k:4,b:"7:12",e:"7:17"}}},"Chanukah Day 1 (on Shabbat)":{haft:{k:"Zechariah",b:"2:14",e:"4:7"},fullkriyah:{M:{p:35,k:4,b:"7:1",e:"7:17"}}},"Chanukah Day 2":{fullkriyah:{"1":{p:35,k:4,b:"7:18",e:"7:20"},"2":{p:35,k:4,b:"7:21",e:"7:23"},"3":{p:35,k:4,b:"7:24",e:"7:29"}},alt:{"1":{p:35,k:4,b:"7:18",e:"7:20"},"2":{p:35,k:4,b:"7:21",e:"7:23"},"3":{p:35,k:4,b:"7:18",e:"7:23"}}},"Chanukah Day 2 (on Shabbat)":{haft:{k:"Zechariah",b:"2:14",e:"4:7"},fullkriyah:{M:{p:35,k:4,b:"7:18",e:"7:23"}}},"Chanukah Day 3":{fullkriyah:{"1":{p:35,k:4,b:"7:24",e:"7:26"},"2":{p:35,k:4,b:"7:27",e:"7:29"},"3":{p:35,k:4,b:"7:30",e:"7:35"}},alt:{"1":{p:35,k:4,b:"7:24",e:"7:26"},"2":{p:35,k:4,b:"7:27",e:"7:29"},"3":{p:35,k:4,b:"7:24",e:"7:29"}}},"Chanukah Day 3 (on Shabbat)":{haft:{k:"Zechariah",b:"2:14",e:"4:7"},fullkriyah:{M:{p:35,k:4,b:"7:24",e:"7:29"}}},"Chanukah Day 4":{fullkriyah:{"1":{p:35,k:4,b:"7:30",e:"7:32"},"2":{p:35,k:4,b:"7:33",e:"7:35"},"3":{p:35,k:4,b:"7:36",e:"7:41"}},alt:{"1":{p:35,k:4,b:"7:30",e:"7:32"},"2":{p:35,k:4,b:"7:33",e:"7:35"},"3":{p:35,k:4,b:"7:30",e:"7:35"}}},"Chanukah Day 4 (on Shabbat)":{haft:{k:"Zechariah",b:"2:14",e:"4:7"},fullkriyah:{M:{p:35,k:4,b:"7:30",e:"7:35"}}},"Chanukah Day 5":{fullkriyah:{"1":{p:35,k:4,b:"7:36",e:"7:38"},"2":{p:35,k:4,b:"7:39",e:"7:41"},"3":{p:35,k:4,b:"7:42",e:"7:47"}},alt:{"1":{p:35,k:4,b:"7:36",e:"7:38"},"2":{p:35,k:4,b:"7:39",e:"7:41"},"3":{p:35,k:4,b:"7:36",e:"7:41"}}},"Chanukah Day 5 (on Shabbat)":{haft:{k:"Zechariah",b:"2:14",e:"4:7"},fullkriyah:{M:{p:35,k:4,b:"7:36",e:"7:41"}}},"Chanukah Day 6":{fullkriyah:{"1":{p:41,k:4,b:"28:1",e:"28:5"},"2":{p:41,k:4,b:"28:6",e:"28:10"},"3":{p:41,k:4,b:"28:11",e:"28:15"},"4":{p:35,k:4,b:"7:42",e:"7:47"}}},"Chanukah Day 7":{fullkriyah:{"1":{p:35,k:4,b:"7:48",e:"7:50"},"2":{p:35,k:4,b:"7:51",e:"7:53"},"3":{p:35,k:4,b:"7:54",e:"7:59"}},alt:{"1":{p:35,k:4,b:"7:48",e:"7:50"},"2":{p:35,k:4,b:"7:51",e:"7:53"},"3":{p:35,k:4,b:"7:48",e:"7:53"}}},"Chanukah Day 7 (on Rosh Chodesh)":{fullkriyah:{"1":{p:41,k:4,b:"28:1",e:"28:5"},"2":{p:41,k:4,b:"28:6",e:"28:10"},"3":{p:41,k:4,b:"28:11",e:"28:15"},"4":{p:35,k:4,b:"7:48",e:"7:53"}}},"Chanukah Day 7 (on Shabbat)":{haft:{k:"Zechariah",b:"2:14",e:"4:7"},fullkriyah:{M:{p:35,k:4,b:"7:48",e:"7:53"}}},"Chanukah Day 8":{fullkriyah:{"1":{p:35,k:4,b:"7:54",e:"7:56"},"2":{p:35,k:4,b:"7:57",e:"7:59"},"3":{p:35,k:4,b:"7:60",e:"8:4"}}},"Chanukah Day 8 (on Shabbat)":{haft:{k:"I Kings",b:"7:40",e:"7:50"},fullkriyah:{M:{p:35,k:4,b:"7:54",e:"8:4"}}},"Erev Purim":{megillah:"Esther"},Purim:Purim,"Shushan Purim":{note:"Jerusalem & walled cities only",il:true,megillah:"Esther",fullkriyah:{"1":{p:16,k:2,b:"17:8",e:"17:10"},"2":{p:16,k:2,b:"17:11",e:"17:13"},"3":{p:16,k:2,b:"17:14",e:"17:16"}}},"Shushan Purim (on Shabbat)":{il:true,note:"Jerusalem & walled cities only: special maftir Exodus 17:8-16, same Haftara as Shabbat Zachor"},"Shabbat HaChodesh":{haft:{k:"Ezekiel",b:"45:16",e:"46:18"},seph:{k:"Ezekiel",b:"45:18",e:"46:15"},fullkriyah:{M:{p:15,k:2,b:"12:1",e:"12:20"}}},"Shabbat HaChodesh (on Rosh Chodesh)":{haft:{k:"Ezekiel",b:"45:16",e:"46:18"},seph:{k:"Ezekiel",b:"45:18",e:"46:15"},fullkriyah:{"7":{p:41,k:4,b:"28:9",e:"28:15"},M:{p:15,k:2,b:"12:1",e:"12:20"}}},"Shabbat HaGadol":{haft:{k:"Malachi",b:"3:4",e:"3:24"}},"Shabbat Parah":{haft:{k:"Ezekiel",b:"36:16",e:"36:38"},seph:{k:"Ezekiel",b:"36:16",e:"36:36"},fullkriyah:{M:{p:39,k:4,b:"19:1",e:"19:22"}}},"Shabbat Shekalim":{haft:{k:"II Kings",b:"12:1",e:"12:17"},seph:{k:"II Kings",b:"11:17",e:"12:17"},fullkriyah:{M:{p:21,k:2,b:"30:11",e:"30:16"}}},"Shabbat Shekalim (on Rosh Chodesh)":{haft:{k:"II Kings",b:"12:1",e:"12:17"},seph:{k:"II Kings",b:"11:17",e:"12:17"},fullkriyah:{"7":{p:41,k:4,b:"28:9",e:"28:15"},M:{p:21,k:2,b:"30:11",e:"30:16"}}},"Shabbat Shuva (with Vayeilech)":{haft:[{k:"Hosea",b:"14:2",e:"14:10"},{k:"Micah",b:"7:18",e:"7:20"}]},"Shabbat Shuva (with Ha'azinu)":{haft:[{k:"Hosea",b:"14:2",e:"14:10"},{k:"Joel",b:"2:15",e:"2:27"}],seph:[{k:"Hosea",b:"14:2",e:"14:10"},{k:"Micah",b:"7:18",e:"7:20"}]},"Shabbat Shuva":{haft:[{k:"Hosea",b:"14:2",e:"14:10"},{k:"Micah",b:"7:18",e:"7:20"},{k:"Joel",b:"2:15",e:"2:27"}]},"Shabbat Zachor":{haft:{k:"I Samuel",b:"15:2",e:"15:34"},seph:{k:"I Samuel",b:"15:1",e:"15:34"},fullkriyah:{M:{p:49,k:5,b:"25:17",e:"25:19"}}},"Pinchas occurring after 17 Tammuz":{haft:{k:"Jeremiah",b:"1:1",e:"2:3"}},"Kedoshim following Special Shabbat":{haft:{k:"Amos",b:"9:7",e:"9:15"},seph:{k:"Ezekiel",b:"20:2",e:"20:20"}},"Masei on Shabbat Rosh Chodesh":{haft:[{k:"Jeremiah",b:"2:4",e:"2:28"},{k:"Jeremiah",b:"3:4",e:"3:4"}],seph:[{k:"Jeremiah",b:"2:4",e:"2:28"},{k:"Jeremiah",b:"4:1",e:"4:2"},{k:"Isaiah",b:"66:1",e:"66:1"},{k:"Isaiah",b:"66:23",e:"66:23"}],fullkriyah:{M:{p:41,k:4,b:"28:9",e:"28:15"}}},"Matot-Masei on Shabbat Rosh Chodesh":{alias:true,key:"Masei on Shabbat Rosh Chodesh"},"Ki Teitzei with 3rd Haftarah of Consolation":{haft:[{k:"Isaiah",b:"54:1",e:"54:10"},{k:"Isaiah",b:"54:11",e:"55:5"}]},"Rosh Chodesh":{fullkriyah:{"1":{p:41,k:4,b:"28:1",e:"28:3"},"2":{p:41,k:4,b:"28:3",e:"28:5"},"3":{p:41,k:4,b:"28:6",e:"28:10"},"4":{p:41,k:4,b:"28:11",e:"28:15"}}},"Rosh Chodesh Nisan":{alias:true,key:"Rosh Chodesh"},"Rosh Chodesh Iyyar":{alias:true,key:"Rosh Chodesh"},"Rosh Chodesh Sivan":{alias:true,key:"Rosh Chodesh"},"Rosh Chodesh Tamuz":{alias:true,key:"Rosh Chodesh"},"Rosh Chodesh Av":{alias:true,key:"Rosh Chodesh"},"Rosh Chodesh Elul":{alias:true,key:"Rosh Chodesh"},"Rosh Chodesh Tishrei":{alias:true,key:"Rosh Chodesh"},"Rosh Chodesh Cheshvan":{alias:true,key:"Rosh Chodesh"},"Rosh Chodesh Kislev":{alias:true,key:"Rosh Chodesh"},"Rosh Chodesh Sh'vat":{alias:true,key:"Rosh Chodesh"},"Rosh Chodesh Adar":{alias:true,key:"Rosh Chodesh"},"Rosh Chodesh Adar I":{alias:true,key:"Rosh Chodesh"},"Rosh Chodesh Adar II":{alias:true,key:"Rosh Chodesh"},"Shabbat Rosh Chodesh":{haft:{k:"Isaiah",b:"66:1",e:"66:24"},fullkriyah:{M:{p:41,k:4,b:"28:9",e:"28:15"}}},"Shabbat Machar Chodesh":{haft:{k:"I Samuel",b:"20:18",e:"20:42"}}};
3
3
 
4
4
  export { Purim, Shavuot, festivals0 as default };
@@ -1,9 +1,10 @@
1
1
  export * from './types';
2
2
  export * from './internalTypes';
3
3
  export * from './locale';
4
+ export { formatAliyahShort } from './format';
4
5
  export * from './common';
5
- export * from './summary';
6
6
  export * from './festival';
7
+ export * from './summary';
7
8
  export { getLeyningKeyForEvent } from './getLeyningKeyForEvent';
8
9
  export * from './specialReadings';
9
10
  export * from './getLeyningForHoliday';
package/dist/esm/index.js CHANGED
@@ -1,8 +1,9 @@
1
- /*! @hebcal/leyning v9.3.0 */
1
+ /*! @hebcal/leyning v9.4.1 */
2
2
  import './locale.js';
3
- export { BOOK, NUM_VERSES, addVerses, calculateNumVerses, formatAliyahShort, formatAliyahWithBook, parshaToString, subtractVerses } from './common.js';
4
- export { makeLeyningParts, makeLeyningSummary, makeSummaryFromParts } from './summary.js';
3
+ export { formatAliyahShort } from './format.js';
4
+ export { BOOK, NUM_VERSES, addVerses, calculateNumVerses, formatAliyahWithBook, parshaToString, subtractVerses } from './common.js';
5
5
  export { hasFestival, lookupFestival } from './festival.js';
6
+ export { makeLeyningParts, makeLeyningSummary, makeSummaryFromParts } from './summary.js';
6
7
  export { getLeyningKeyForEvent } from './getLeyningKeyForEvent.js';
7
8
  export { specialReadings2 } from './specialReadings.js';
8
9
  export { getLeyningForHoliday, getLeyningForHolidayKey } from './getLeyningForHoliday.js';
@@ -9,12 +9,12 @@ export declare function makeLeyningNames(parsha: string[]): LeyningNames;
9
9
  * Looks up Monday/Thursday aliyot for a regular parsha
10
10
  * @param parsha untranslated name like 'Pinchas' or ['Pinchas'] or ['Matot','Masei']
11
11
  */
12
- export declare function getWeekdayReading(parsha: string | string[]): AliyotMap;
12
+ export declare function getWeekdayReading(parsha: string | string[], language?: string): AliyotMap;
13
13
  /**
14
14
  * Looks up regular leyning for a weekly parsha with no special readings
15
15
  * @param parsha untranslated name like 'Pinchas' or ['Pinchas'] or ['Matot','Masei']
16
16
  */
17
- export declare function getLeyningForParsha(parsha: string | string[]): Leyning;
17
+ export declare function getLeyningForParsha(parsha: string | string[], language?: string): Leyning;
18
18
  /**
19
19
  * Looks up leyning for a regular Shabbat parsha, including any special
20
20
  * maftir or Haftara.
@@ -22,9 +22,9 @@ export declare function getLeyningForParsha(parsha: string | string[]): Leyning;
22
22
  * @param [il] in Israel
23
23
  * @returns map of aliyot
24
24
  */
25
- export declare function getLeyningForParshaHaShavua(ev: Event, il?: boolean): Leyning;
25
+ export declare function getLeyningForParshaHaShavua(ev: Event, il?: boolean, language?: string): Leyning;
26
26
  /**
27
27
  * Returns the parsha metadata
28
28
  * @param parsha untranslated name like 'Pinchas' or ['Pinchas'] or ['Matot','Masei']
29
29
  */
30
- export declare function lookupParsha(parsha: string | string[]): ParshaMeta;
30
+ export declare function lookupParsha(parsha: string | string[], language?: string): ParshaMeta;
@@ -1,11 +1,12 @@
1
- /*! @hebcal/leyning v9.3.0 */
1
+ /*! @hebcal/leyning v9.4.1 */
2
2
  import { flags } from '@hebcal/core/dist/esm/event';
3
3
  import './locale.js';
4
4
  import parshiyotObj0 from './aliyot.json.js';
5
- import { parshaToString, BOOK, calculateNumVerses } from './common.js';
5
+ import { BOOK, calculateNumVerses, parshaToString } from './common.js';
6
+ import { translateLeyning, translateAliyahOrArray } from './translate.js';
7
+ import { makeSummaryFromParts, makeLeyningParts } from './summary.js';
6
8
  import { cloneHaftara, sumVerses } from './clone.js';
7
9
  import { specialReadings2 } from './specialReadings.js';
8
- import { makeSummaryFromParts, makeLeyningParts } from './summary.js';
9
10
  import { Locale } from '@hebcal/core/dist/esm/locale';
10
11
 
11
12
  const parshiyotObj = parshiyotObj0;
@@ -43,7 +44,7 @@ function makeLeyningNames(parsha) {
43
44
  * @param parsha untranslated name like 'Pinchas' or ['Pinchas'] or ['Matot','Masei']
44
45
  * @returns map of aliyot
45
46
  */
46
- function getLeyningForParshaShabbatOnly(parsha) {
47
+ function getLeyningForParshaShabbatOnly(parsha, language = 'en') {
47
48
  const raw = lookupParsha(parsha);
48
49
  const fullkriyah = {};
49
50
  const book = BOOK[raw.book];
@@ -85,13 +86,13 @@ function getLeyningForParshaShabbatOnly(parsha) {
85
86
  result.sephardic = makeSummaryFromParts(seph);
86
87
  result.sephardicNumV = sumVerses(seph);
87
88
  }
88
- return result;
89
+ return translateLeyning(result, language);
89
90
  }
90
91
  /**
91
92
  * Looks up Monday/Thursday aliyot for a regular parsha
92
93
  * @param parsha untranslated name like 'Pinchas' or ['Pinchas'] or ['Matot','Masei']
93
94
  */
94
- function getWeekdayReading(parsha) {
95
+ function getWeekdayReading(parsha, language = 'en') {
95
96
  const raw = lookupParsha(parsha);
96
97
  const parshaMeta = raw.combined ? lookupParsha(raw.p1) : raw;
97
98
  const aliyot = parshaMeta.weekday;
@@ -107,14 +108,14 @@ function getWeekdayReading(parsha) {
107
108
  calculateNumVerses(aliyah);
108
109
  weekday[num] = aliyah;
109
110
  }
110
- return weekday;
111
+ return translateAliyahOrArray(weekday, language);
111
112
  }
112
113
  /**
113
114
  * Looks up regular leyning for a weekly parsha with no special readings
114
115
  * @param parsha untranslated name like 'Pinchas' or ['Pinchas'] or ['Matot','Masei']
115
116
  */
116
- function getLeyningForParsha(parsha) {
117
- const result = getLeyningForParshaShabbatOnly(parsha);
117
+ function getLeyningForParsha(parsha, language = 'en') {
118
+ const result = getLeyningForParshaShabbatOnly(parsha, language);
118
119
  result.weekday = getWeekdayReading(parsha);
119
120
  return result;
120
121
  }
@@ -125,7 +126,7 @@ function getLeyningForParsha(parsha) {
125
126
  * @param [il] in Israel
126
127
  * @returns map of aliyot
127
128
  */
128
- function getLeyningForParshaHaShavua(ev, il = false) {
129
+ function getLeyningForParshaHaShavua(ev, il = false, language = 'en') {
129
130
  if (typeof ev !== 'object' || typeof ev.getFlags !== 'function') {
130
131
  throw new TypeError(`Bad event argument: ${ev}`);
131
132
  }
@@ -162,30 +163,35 @@ function getLeyningForParshaHaShavua(ev, il = false) {
162
163
  }
163
164
  const reasons = Object.keys(reason);
164
165
  if (reasons.length !== 0) {
165
- result.reason = reason;
166
+ // Translate reason strings to target language if not English
167
+ const translatedReason = {};
168
+ for (const [key, val] of Object.entries(reason)) {
169
+ translatedReason[key] = Locale.gettext(val, language);
170
+ }
171
+ result.reason = translatedReason;
166
172
  for (const num of reasons) {
167
173
  if (num === 'haftara' || num === 'sephardic') {
168
174
  const haftObj = result[num === 'haftara' ? 'haft' : 'seph'];
169
175
  const hafts = Array.isArray(haftObj) ? haftObj : [haftObj];
170
176
  for (const haft of hafts) {
171
- haft.reason = reason[num];
177
+ haft.reason = translatedReason[num];
172
178
  }
173
179
  }
174
180
  else {
175
181
  const aliyah = result.fullkriyah[num];
176
182
  if (typeof aliyah === 'object') {
177
- aliyah.reason = reason[num];
183
+ aliyah.reason = translatedReason[num];
178
184
  }
179
185
  }
180
186
  }
181
187
  }
182
- return result;
188
+ return translateLeyning(result, language);
183
189
  }
184
190
  /**
185
191
  * Returns the parsha metadata
186
192
  * @param parsha untranslated name like 'Pinchas' or ['Pinchas'] or ['Matot','Masei']
187
193
  */
188
- function lookupParsha(parsha) {
194
+ function lookupParsha(parsha, language = 'en') {
189
195
  const name = parshaToString(parsha);
190
196
  const raw = parshiyotObj[name];
191
197
  if (typeof raw !== 'object') {
@@ -198,12 +204,16 @@ function lookupParsha(parsha) {
198
204
  }
199
205
  if (!raw.haft) {
200
206
  const haftKey = p1 === 'Nitzavim' ? p1 : p2;
201
- raw.haft = lookupParsha(haftKey).haft;
207
+ raw.haft = lookupParsha(haftKey, language).haft;
202
208
  }
203
209
  }
204
210
  else {
205
211
  raw.hebrew = Locale.gettext(name, 'he');
206
212
  }
213
+ raw.haft = translateAliyahOrArray(raw.haft, language);
214
+ if (raw.seph) {
215
+ raw.seph = translateAliyahOrArray(raw.seph, language);
216
+ }
207
217
  return raw;
208
218
  }
209
219
 
@@ -1,4 +1,4 @@
1
- /*! @hebcal/leyning v9.3.0 */
1
+ /*! @hebcal/leyning v9.4.1 */
2
2
  import { Locale } from '@hebcal/core/dist/esm/locale';
3
3
  export { Locale } from '@hebcal/core/dist/esm/locale';
4
4
  import poHe from './he.po.js';
@@ -1,4 +1,4 @@
1
- /*! @hebcal/leyning v9.3.0 */
1
+ /*! @hebcal/leyning v9.4.1 */
2
2
  const Genesis=[0,31,25,24,26,32,22,24,22,29,32,32,20,18,24,21,16,27,33,38,18,34,24,20,67,34,35,46,22,35,43,54,33,20,31,29,43,36,30,23,23,57,38,34,34,28,34,31,22,33,26];const Exodus=[0,22,25,22,31,23,30,29,28,35,29,10,51,22,31,27,36,16,27,25,23,37,30,33,18,40,37,21,43,46,38,18,35,23,35,35,38,29,31,43,38];const Leviticus=[0,17,16,17,35,26,23,38,36,24,20,47,8,59,57,33,34,16,30,37,27,24,33,44,23,55,46,34];const Numbers=[0,54,34,51,49,31,27,89,26,23,36,35,16,33,45,41,35,28,32,22,29,35,41,30,25,19,65,23,31,39,17,54,42,56,29,34,13];const Deuteronomy=[0,46,37,29,49,30,25,26,20,29,22,32,31,19,29,23,22,20,22,21,20,23,29,26,22,19,19,26,69,28,20,30,52,29,12];const Joshua=[0,18,24,17,24,15,27,26,35,27,43,23,24,33,15,63,10,18,28,51,9,45,34,16,33];const Judges=[0,36,23,31,24,31,40,25,35,57,18,40,15,25,20,20,31,13,31,30,48,25];const Ruth=[0,22,23,18,22];const Isaiah=[0,31,22,26,6,30,13,25,23,20,34,16,6,22,32,9,14,14,7,25,6,17,25,18,23,12,21,13,29,24,33,9,20,24,17,10,22,38,22,8,31,29,25,28,28,25,13,15,22,26,11,23,15,12,17,13,12,21,14,21,22,11,12,19,11,25,24];const Jeremiah=[0,19,37,25,31,31,30,34,23,25,25,23,17,27,22,21,21,27,23,15,18,14,30,40,10,38,24,22,17,32,24,40,44,26,22,19,32,21,28,18,16,18,22,13,30,5,28,7,47,39,46,64,34];const Lamentations=[0,22,22,66,22,22];const Esther=[0,22,23,15,17,14,14,10,17,32,3];const Ecclesiastes=[0,18,26,22,17,19,12,29,17,18,20,10,14];const Ezekiel=[0,28,10,27,17,17,14,27,18,11,22,25,28,23,23,8,63,24,32,14,44,37,31,49,27,17,21,36,26,21,26,18,32,33,31,15,38,28,23,29,49,26,20,27,31,25,24,23,35];const Daniel=[0,21,49,100,34,30,29,28,27,27,21,45,13,64,42];const Hosea=[0,9,25,5,19,15,11,16,14,17,15,11,15,15,10];const Joel=[0,20,27,5,21];const Amos=[0,15,16,15,13,27,14,17,14,15];const Obadiah=[0,21];const Jonah=[0,16,11,10,11];const Micah=[0,16,13,12,14,14,16,20];const Nachum=[0,14,14,19];const Habakkuk=[0,17,20,19];const Zephaniah=[0,18,15,20];const Haggai=[0,15,23];const Zechariah=[0,17,17,10,14,11,15,14,23,17,12,17,14,9,21];const Malachi=[0,14,17,24];var numverses = {Genesis:Genesis,Exodus:Exodus,Leviticus:Leviticus,Numbers:Numbers,Deuteronomy:Deuteronomy,Joshua:Joshua,Judges:Judges,Ruth:Ruth,"I Samuel":[0,28,36,21,22,12,21,17,22,27,27,15,25,23,52,35,23,58,30,24,42,16,23,28,23,43,25,12,25,11,31,13],"II Samuel":[0,27,32,39,12,25,23,29,18,13,19,27,31,39,33,37,23,29,32,44,26,22,51,39,25],"I Kings":[0,53,46,28,20,32,38,51,66,28,29,43,33,34,31,34,34,24,46,21,43,29,54],"II Kings":[0,18,25,27,44,27,33,20,29,37,36,20,22,25,29,38,20,41,37,37,21,26,20,37,20,30],Isaiah:Isaiah,Jeremiah:Jeremiah,Lamentations:Lamentations,Esther:Esther,Ecclesiastes:Ecclesiastes,"Song of Songs":[0,17,17,11,16,16,12,14,14],Ezekiel:Ezekiel,Daniel:Daniel,Hosea:Hosea,Joel:Joel,Amos:Amos,Obadiah:Obadiah,Jonah:Jonah,Micah:Micah,Nachum:Nachum,Habakkuk:Habakkuk,Zephaniah:Zephaniah,Haggai:Haggai,Zechariah:Zechariah,Malachi:Malachi};
3
3
 
4
4
  export { Amos, Daniel, Deuteronomy, Ecclesiastes, Esther, Exodus, Ezekiel, Genesis, Habakkuk, Haggai, Hosea, Isaiah, Jeremiah, Joel, Jonah, Joshua, Judges, Lamentations, Leviticus, Malachi, Micah, Nachum, Numbers, Obadiah, Ruth, Zechariah, Zephaniah, numverses as default };
@@ -1,14 +1,14 @@
1
- /*! @hebcal/leyning v9.3.0 */
1
+ /*! @hebcal/leyning v9.4.1 */
2
2
  import { months } from '@hebcal/hdate';
3
3
  import { flags } from '@hebcal/core/dist/esm/event';
4
- import { cloneHaftara, clone } from './clone.js';
4
+ import { cloneHaftara } from './clone.js';
5
5
  import { parshaToString, calculateNumVerses } from './common.js';
6
6
  import { lookupFestival } from './festival.js';
7
7
  import { getLeyningKeyForEvent } from './getLeyningKeyForEvent.js';
8
8
  import { getHolidaysOnDate } from '@hebcal/core/dist/esm/holidays';
9
9
 
10
10
  function aliyotCombine67(aliyot) {
11
- const a6 = clone(aliyot['6']);
11
+ const a6 = structuredClone(aliyot['6']);
12
12
  const a7 = aliyot['7'];
13
13
  if (a6.k !== a7.k) {
14
14
  throw new Error('Impossible to combine aliyot 6 & 7: ' + JSON.stringify(aliyot));
@@ -26,11 +26,11 @@ function aliyotCombine67(aliyot) {
26
26
  function mergeAliyotWithSpecial(aliyot, special) {
27
27
  if (special['7']) {
28
28
  aliyotCombine67(aliyot);
29
- aliyot['7'] = clone(special['7']);
29
+ aliyot['7'] = structuredClone(special['7']);
30
30
  calculateNumVerses(aliyot['7']);
31
31
  }
32
32
  if (special['M']) {
33
- aliyot['M'] = clone(special['M']);
33
+ aliyot['M'] = structuredClone(special['M']);
34
34
  calculateNumVerses(aliyot['M']);
35
35
  }
36
36
  }
@@ -69,7 +69,7 @@ function specialReadings2(parsha, hd, il, aliyot) {
69
69
  }
70
70
  }
71
71
  if (special.fullkriyah) {
72
- const aliyotMap = clone(aliyot);
72
+ const aliyotMap = structuredClone(aliyot);
73
73
  mergeAliyotWithSpecial(aliyotMap, special.fullkriyah);
74
74
  for (const num of Object.keys(special.fullkriyah)) {
75
75
  reason[num] = key;
@@ -1,9 +1,4 @@
1
- import { Aliyah, AliyotMap } from './types';
2
- /**
3
- * Summarizes an `AliyotMap` by collapsing all adjacent aliyot.
4
- * Finds any non-overlapping parts (e.g. special 7th aliyah or maftir)
5
- */
6
- export declare function makeLeyningParts(aliyot: AliyotMap): Aliyah[];
1
+ import { AliyotMap, Aliyah } from './types';
7
2
  /**
8
3
  * Returns a string representation of the leyning parts.
9
4
  * Separate verse ranges read from the same book are separated
@@ -11,7 +6,12 @@ export declare function makeLeyningParts(aliyot: AliyotMap): Aliyah[];
11
6
  * Verse ranges from different books are separated by semicolons,
12
7
  * e.g. `Genesis 21:1-34; Numbers 29:1-6`.
13
8
  */
14
- export declare function makeSummaryFromParts(parts: Aliyah | Aliyah[]): string;
9
+ export declare function makeSummaryFromParts(parts: Aliyah | Aliyah[], language?: string): string;
10
+ /**
11
+ * Summarizes an `AliyotMap` by collapsing all adjacent aliyot.
12
+ * Finds any non-overlapping parts (e.g. special 7th aliyah or maftir)
13
+ */
14
+ export declare function makeLeyningParts(aliyot: AliyotMap): Aliyah[];
15
15
  /**
16
16
  * Makes a summary of the leyning, like "Genesis 6:9-11:32"
17
17
  */
@@ -1,5 +1,7 @@
1
- /*! @hebcal/leyning v9.3.0 */
2
- import { formatAliyahShort } from './common.js';
1
+ /*! @hebcal/leyning v9.4.1 */
2
+ import './locale.js';
3
+ import { formatAliyahShort } from './format.js';
4
+ import { Locale } from '@hebcal/core/dist/esm/locale';
3
5
 
4
6
  /**
5
7
  * @private
@@ -9,6 +11,32 @@ function isChapVerseBefore(a, b) {
9
11
  const cv2 = b.split(':').map(x => +x);
10
12
  return cv1[0] * 100 + cv1[1] < cv2[0] * 100 + cv2[1];
11
13
  }
14
+ /**
15
+ * Returns a string representation of the leyning parts.
16
+ * Separate verse ranges read from the same book are separated
17
+ * by commas, e.g. `Isaiah 6:1-7:6, 9:5-6`.
18
+ * Verse ranges from different books are separated by semicolons,
19
+ * e.g. `Genesis 21:1-34; Numbers 29:1-6`.
20
+ */
21
+ function makeSummaryFromParts(parts, language = 'en') {
22
+ if (!Array.isArray(parts)) {
23
+ parts = [parts];
24
+ }
25
+ let prev = parts[0];
26
+ let summary = formatAliyahShort(prev, true, language);
27
+ for (let i = 1; i < parts.length; i++) {
28
+ const part = parts[i];
29
+ if (part.k === prev.k) {
30
+ summary += ', ';
31
+ }
32
+ else {
33
+ summary += `; ${Locale.gettext(part.k, language)} `;
34
+ }
35
+ summary += formatAliyahShort(part, false, language);
36
+ prev = part;
37
+ }
38
+ return summary;
39
+ }
12
40
  /**
13
41
  * Summarizes an `AliyotMap` by collapsing all adjacent aliyot.
14
42
  * Finds any non-overlapping parts (e.g. special 7th aliyah or maftir)
@@ -46,32 +74,6 @@ function makeLeyningParts(aliyot) {
46
74
  parts.push({ k: start.k, b: start.b, e: end.e });
47
75
  return parts;
48
76
  }
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
77
  /**
76
78
  * Makes a summary of the leyning, like "Genesis 6:9-11:32"
77
79
  */
@@ -0,0 +1,35 @@
1
+ import { Aliyah, AliyotMap, Leyning } from './types';
2
+ /**
3
+ * Translates an aliyah's book name and verse numbers to the target language.
4
+ * Modifies the aliyah object in place.
5
+ * @param aliyah - The aliyah object to translate
6
+ * @param language - The target language code (e.g., 'he' for Hebrew)
7
+ * @param translateBook - Whether to translate the book name (default true)
8
+ */
9
+ export declare function translateAliyah(aliyah: Aliyah, language: string): Aliyah;
10
+ /**
11
+ * Translates aliyah(s) - handles single Aliyah, arrays, and AliyotMap.
12
+ * For non-English languages, translates book names and converts verse numbers to Hebrew numerals.
13
+ * Returns a new translated copy, leaving the original unchanged.
14
+ * @param aliyahOrArray - Single Aliyah, array of Aliyah objects, AliyotMap, or undefined
15
+ * @param language - The target language code (e.g., 'he' for Hebrew)
16
+ * @param translateBook - Whether to translate the book name (default true)
17
+ * @returns Translated copy of the input, or undefined if input was undefined
18
+ */
19
+ export declare function translateAliyahOrArray<T extends Aliyah | Aliyah[] | AliyotMap>(aliyahOrArray: T, language?: string): T;
20
+ /**
21
+ * Translates a Leyning object to the target language.
22
+ * @param leyning - The Leyning object to translate
23
+ * @param language - The target language code (e.g., 'he' for Hebrew)
24
+ * @returns The translated Leyning object
25
+ * @example
26
+ * const leyning: Leyning = {
27
+ * seph: [{k: 'Genesis', b: '1:1', e: '1:5'}],
28
+ * haft: [{k: 'Genesis', b: '1:6', e: '1:10'}],
29
+ * megillah: [{k: 'Genesis', b: '1:11', e: '1:15'}],
30
+ * fullkriyah: [{k: 'Genesis', b: '1:16', e: '1:20'}],
31
+ * };
32
+ * const translatedLeyning = translateLeyning(leyning, 'he');
33
+ * @todo add reason translation
34
+ */
35
+ export declare function translateLeyning(leyning: Leyning, language: string): Leyning;
@@ -0,0 +1,106 @@
1
+ /*! @hebcal/leyning v9.4.1 */
2
+ import { makeSummaryFromParts, makeLeyningParts } from './summary.js';
3
+ import './locale.js';
4
+ import { formatVerseToHebrew } from './format.js';
5
+ import { Locale } from '@hebcal/core/dist/esm/locale';
6
+
7
+ /**
8
+ * Translates an aliyah's book name and verse numbers to the target language.
9
+ * Modifies the aliyah object in place.
10
+ * @param aliyah - The aliyah object to translate
11
+ * @param language - The target language code (e.g., 'he' for Hebrew)
12
+ * @param translateBook - Whether to translate the book name (default true)
13
+ */
14
+ function translateAliyah(aliyah, language) {
15
+ if (language === 'he') {
16
+ aliyah.k = Locale.gettext(aliyah.k, language);
17
+ aliyah.b = formatVerseToHebrew(aliyah.b);
18
+ aliyah.e = formatVerseToHebrew(aliyah.e);
19
+ }
20
+ return aliyah;
21
+ }
22
+ /**
23
+ * Translates aliyah(s) - handles single Aliyah, arrays, and AliyotMap.
24
+ * For non-English languages, translates book names and converts verse numbers to Hebrew numerals.
25
+ * Returns a new translated copy, leaving the original unchanged.
26
+ * @param aliyahOrArray - Single Aliyah, array of Aliyah objects, AliyotMap, or undefined
27
+ * @param language - The target language code (e.g., 'he' for Hebrew)
28
+ * @param translateBook - Whether to translate the book name (default true)
29
+ * @returns Translated copy of the input, or undefined if input was undefined
30
+ */
31
+ function translateAliyahOrArray(aliyahOrArray, language = 'en') {
32
+ // Handle array of Aliyah objects
33
+ if (Array.isArray(aliyahOrArray)) {
34
+ const result = aliyahOrArray.map(aliyah => {
35
+ const copy = Object.assign({}, aliyah);
36
+ return translateAliyah(copy, language);
37
+ });
38
+ return result;
39
+ }
40
+ // Handle single Aliyah object (has 'k' or 'b' property)
41
+ if ('k' in aliyahOrArray || 'b' in aliyahOrArray) {
42
+ const copy = Object.assign({}, aliyahOrArray);
43
+ return translateAliyah(copy, language);
44
+ }
45
+ // Handle AliyotMap (Record<string, Aliyah>)
46
+ const result = {};
47
+ for (const [key, aliyah] of Object.entries(aliyahOrArray)) {
48
+ const copy = Object.assign({}, aliyah);
49
+ result[key] = translateAliyah(copy, language);
50
+ }
51
+ return result;
52
+ }
53
+ /**
54
+ * Translates a Leyning object to the target language.
55
+ * @param leyning - The Leyning object to translate
56
+ * @param language - The target language code (e.g., 'he' for Hebrew)
57
+ * @returns The translated Leyning object
58
+ * @example
59
+ * const leyning: Leyning = {
60
+ * seph: [{k: 'Genesis', b: '1:1', e: '1:5'}],
61
+ * haft: [{k: 'Genesis', b: '1:6', e: '1:10'}],
62
+ * megillah: [{k: 'Genesis', b: '1:11', e: '1:15'}],
63
+ * fullkriyah: [{k: 'Genesis', b: '1:16', e: '1:20'}],
64
+ * };
65
+ * const translatedLeyning = translateLeyning(leyning, 'he');
66
+ * @todo add reason translation
67
+ */
68
+ function translateLeyning(leyning, language) {
69
+ if (language === 'en') {
70
+ return leyning;
71
+ }
72
+ if (leyning.seph) {
73
+ leyning.sephardic = makeSummaryFromParts(leyning.seph, language);
74
+ leyning.seph = translateAliyahOrArray(leyning.seph, language);
75
+ }
76
+ if (leyning.haft) {
77
+ leyning.haftara = makeSummaryFromParts(leyning.haft, language);
78
+ leyning.haft = translateAliyahOrArray(leyning.haft, language);
79
+ }
80
+ if (leyning.megillah) {
81
+ const parts = makeLeyningParts(leyning.megillah);
82
+ const megillahSummary = makeSummaryFromParts(parts, language);
83
+ leyning.megillah = translateAliyahOrArray(leyning.megillah, language);
84
+ leyning.summary = megillahSummary;
85
+ }
86
+ if (leyning.fullkriyah) {
87
+ const parts = makeLeyningParts(leyning.fullkriyah);
88
+ // TODO: add check for summary in those cases getLeyningForHolidayKey
89
+ if (typeof leyning.fullkriyah['1'] === 'object') {
90
+ leyning.summary = makeSummaryFromParts(parts, language);
91
+ }
92
+ leyning.fullkriyah = translateAliyahOrArray(leyning.fullkriyah, language);
93
+ if (leyning.summaryParts) {
94
+ leyning.summaryParts = translateAliyahOrArray(leyning.summaryParts, language);
95
+ leyning.summary = makeSummaryFromParts(leyning.summaryParts, language);
96
+ }
97
+ }
98
+ if (leyning.weekday) {
99
+ const parts = makeLeyningParts(leyning.weekday);
100
+ leyning.weekday = translateAliyahOrArray(leyning.weekday, language);
101
+ leyning.summary = makeSummaryFromParts(parts, language);
102
+ }
103
+ return leyning;
104
+ }
105
+
106
+ export { translateAliyah, translateAliyahOrArray, translateLeyning };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hebcal/leyning",
3
- "version": "9.3.0",
3
+ "version": "9.4.1",
4
4
  "author": "Michael J. Radwin (https://github.com/mjradwin)",
5
5
  "keywords": [
6
6
  "hebcal",
@@ -40,9 +40,8 @@
40
40
  "node": ">=18"
41
41
  },
42
42
  "dependencies": {
43
- "@hebcal/core": "^6.0.0",
44
- "@hebcal/hdate": "^0.21.0",
45
- "tslib": "^2.8.1"
43
+ "@hebcal/core": "^6.0.8",
44
+ "@hebcal/hdate": "^0.21.1"
46
45
  },
47
46
  "scripts": {
48
47
  "po2json": "node ./po2json.js po/he.po po/ashkenazi.po",
@@ -55,6 +54,7 @@
55
54
  "pretest": "npm run build",
56
55
  "lint": "gts lint",
57
56
  "test": "vitest",
57
+ "coverage": "vitest run --coverage",
58
58
  "clean": "gts clean",
59
59
  "fix": "gts fix"
60
60
  },
@@ -62,17 +62,18 @@
62
62
  "devDependencies": {
63
63
  "@rollup/plugin-json": "^6.1.0",
64
64
  "@rollup/plugin-node-resolve": "^16.0.3",
65
- "@rollup/plugin-terser": "^0.4.4",
65
+ "@rollup/plugin-terser": "^1.0.0",
66
66
  "@rollup/plugin-typescript": "^12.3.0",
67
- "@types/node": "^24.9.1",
68
- "gettext-parser": "^8.0.0",
69
- "gts": "^5.3.1",
67
+ "@types/node": "^25.3.5",
68
+ "@vitest/coverage-v8": "^4.0.18",
69
+ "gettext-parser": "^9.0.1",
70
+ "gts": "^7.0.0",
70
71
  "pretty-bytes": "^7.1.0",
71
- "rollup": "^4.52.5",
72
+ "rollup": "^4.59.0",
72
73
  "rollup-plugin-bundle-size": "^1.0.3",
73
- "rollup-plugin-visualizer": "^6.0.5",
74
- "typedoc": "^0.28.14",
74
+ "rollup-plugin-visualizer": "^7.0.1",
75
+ "typedoc": "^0.28.17",
75
76
  "typescript": "^5.9.3",
76
- "vitest": "^4.0.3"
77
+ "vitest": "^4.0.18"
77
78
  }
78
79
  }