UNPKG

date-holidays

Version:
40 lines (31 loc) • 1.16 kB
'use strict'; var HolidaysParser = require('date-holidays-parser'); var data = require('./data.cjs'); function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; } var HolidaysParser__default = /*#__PURE__*/_interopDefault(HolidaysParser); /** * @copyright 2015-present (c) commenthol * @license ISC */ /** @typedef {import('date-holidays-parser').Location} Location */ /** @typedef {import('date-holidays-parser').HolidayOptions} HolidayOptions */ /** * @class * @param {object} data - holiday data object - see data/holidays.json * @param {string|Location} [country] - country code or location object * @param {string} [state] - specifies state * @param {string} [region] - specifies region * @param {HolidayOptions} [opts] - options * @example * ```js * new Holiday('US', 'la', 'no') // is the same as * new Holiday('us.la.no') // is the same as * new Holiday({ country: 'us', state: 'la', region: 'no'}) * ``` */ class Holidays extends HolidaysParser__default.default { constructor (country, state, region, opts) { super(data.data, country, state, region, opts); } } exports.Holidays = Holidays;