New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

jewish-holidays

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jewish-holidays - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

88

dist/index.js

@@ -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"
]
}
__test__/holiday/holiday.test.ts

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc