jewish-holidays
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -6,2 +6,6 @@ "use strict"; | ||
var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
var __export = (target, all) => { | ||
for (var name in all) | ||
__defProp(target, name, { get: all[name], enumerable: true }); | ||
}; | ||
var __copyProps = (to, from, except, desc) => { | ||
@@ -15,17 +19,83 @@ if (from && typeof from === "object" || typeof from === "function") { | ||
}; | ||
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default")); | ||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | ||
// src/index.ts | ||
var src_exports = {}; | ||
__export(src_exports, { | ||
isHoliday: () => isHoliday, | ||
isShabbat: () => isShabbat, | ||
isYomTov: () => isYomTov | ||
}); | ||
module.exports = __toCommonJS(src_exports); | ||
__reExport(src_exports, require("./holiday"), module.exports); | ||
__reExport(src_exports, require("./shabbat"), module.exports); | ||
__reExport(src_exports, require("./yomTov"), module.exports); | ||
__reExport(src_exports, require("./interfaces"), module.exports); | ||
// src/holiday/holiday.ts | ||
var import_jewish_date = require("jewish-date"); | ||
var isHoliday = (jewishDate, holidayList) => { | ||
if (!jewishDate) { | ||
const date = /* @__PURE__ */ new Date(); | ||
jewishDate = (0, import_jewish_date.toJewishDate)(date); | ||
} | ||
return holidayList.some((i) => i.day == jewishDate.day && i.monthName == jewishDate.monthName); | ||
}; | ||
// src/shabbat/shabbat.ts | ||
var import_jewish_date2 = require("jewish-date"); | ||
// src/jewishDateUtils/jewishDateUtils.ts | ||
var isBasicJewishDate = (object) => { | ||
return "monthName" in object; | ||
}; | ||
// src/shabbat/shabbat.ts | ||
var isShabbat = (date) => { | ||
let gregorianDate; | ||
if (isBasicJewishDate(date)) { | ||
gregorianDate = (0, import_jewish_date2.toGregorianDate)(date); | ||
} else { | ||
gregorianDate = date; | ||
} | ||
return gregorianDate.getDay() === 6; | ||
}; | ||
// src/yomTov/yomTov.ts | ||
var import_jewish_date3 = require("jewish-date"); | ||
var getYomTovListIsrael = () => { | ||
const result = [ | ||
{ day: 1, monthName: "Tishri", name: "Rosh Hashanah" }, | ||
{ day: 2, monthName: "Tishri", name: "Rosh Hashanah" }, | ||
{ day: 10, monthName: "Tishri", name: "Yom Kippur" }, | ||
{ day: 15, monthName: "Tishri", name: "Sukkot" }, | ||
{ day: 24, monthName: "Tishri", name: "Sukkot" }, | ||
{ day: 15, monthName: "Nisan", name: "Pesach" }, | ||
{ day: 21, monthName: "Nisan", name: "Shevii Shel Pesach" }, | ||
{ day: 6, monthName: "Sivan", name: "Shavuot" } | ||
]; | ||
return result; | ||
}; | ||
var getYomTovListChutzLaaretzOnly = () => { | ||
const result = [ | ||
{ day: 16, monthName: "Tishri", name: "Sukkot" }, | ||
{ day: 23, monthName: "Tishri", name: "Simchat Torah" }, | ||
{ day: 16, monthName: "Nisan", name: "Pesach" }, | ||
{ day: 22, monthName: "Nisan", name: "Pesach Shel Pesach" }, | ||
{ day: 7, monthName: "Sivan", name: "Shavuot" } | ||
]; | ||
return result; | ||
}; | ||
var isYomTov = (date, isChutzLaaretz = false) => { | ||
let jewishDate; | ||
if (isBasicJewishDate(date)) { | ||
jewishDate = date; | ||
} else { | ||
jewishDate = (0, import_jewish_date3.toJewishDate)(date); | ||
} | ||
const yomTovList = [...getYomTovListIsrael(), ...isChutzLaaretz ? getYomTovListChutzLaaretzOnly() : []]; | ||
return isHoliday(jewishDate, yomTovList); | ||
}; | ||
// Annotate the CommonJS export names for ESM import in node: | ||
0 && (module.exports = { | ||
...require("./holiday"), | ||
...require("./shabbat"), | ||
...require("./yomTov"), | ||
...require("./interfaces") | ||
isHoliday, | ||
isShabbat, | ||
isYomTov | ||
}); | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "jewish-holidays", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "Jewish holidays", | ||
@@ -48,3 +48,14 @@ "license": "MIT", | ||
} | ||
} | ||
}, | ||
"files": [ | ||
"dist" | ||
], | ||
"keywords": [ | ||
"jewish", | ||
"holidays", | ||
"hebrew", | ||
"date", | ||
"luach", | ||
"calendar" | ||
] | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
0
29577
9
246
1