UNPKG

colombian-holidays

Version:
29 lines 1.1 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.getHolidaysForYear = void 0; const __1 = __importDefault(require("..")); const holidaysWithNativeDateCache = new Map(); const holidaysCache = new Map(); function getHolidaysForYear(year, { valueAsDate = false } = {}) { if (valueAsDate) { const cachedHolidays = holidaysWithNativeDateCache.get(year); if (cachedHolidays) { return cachedHolidays; } const holidays = (0, __1.default)({ year, valueAsDate }); holidaysWithNativeDateCache.set(year, holidays); return holidays; } const cachedHolidays = holidaysCache.get(year); if (cachedHolidays) { return cachedHolidays; } const holidays = (0, __1.default)({ year, valueAsDate }); holidaysCache.set(year, holidays); return holidays; } exports.getHolidaysForYear = getHolidaysForYear; //# sourceMappingURL=getHolidaysByYear.js.map