Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

date-holidays-parser

Package Overview
Dependencies
Maintainers
1
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

date-holidays-parser - npm Package Compare versions

Comparing version 1.5.0 to 1.6.0

es/utils.js

110

CHANGELOG.md

@@ -1,31 +0,99 @@

# CHANGELOG
# Changelog
v1.2.3
- fix: holidays types not correctly filtered (date-holidays#56)
## [1.6.0](https://github.com/commenthol/date-holidays-parser/compare/1.5.0...1.6.0) (2021-01-04)
v1.2.2
- refactor: keep bundle sizes small
- fix: Fix collision in PostRule with Array prototype overrides [7f69163](https://github.com/commenthol/date-holidays-parser/commit/7f6916332a427bed1f4b4c78da703158453d8e11)
- feat: replace lodash function to reduce bundle size [516966a](https://github.com/commenthol/date-holidays-parser/commit/516966ad052cb7ab1fbb2b32a9392aa1974d02a3)
v1.2.1
- remove es5 `module`, `jsnext:main` from package.json to ease integration with
tools like `create-react-app`
## [1.5.0](https://github.com/commenthol/date-holidays-parser/compare/1.4.3...1.5.0)
v1.2.0
- parser moved to own repo `date-holidays-parser`
- fix: sort by rule length [45f4bcf](https://github.com/commenthol/date-holidays-parser/commit/45f4bcfb837ae72f2ab6867d4ca4aa22821a070b)
- fix: add sort by rule [280729a](https://github.com/commenthol/date-holidays-parser/commit/280729aa98fd695f82c2c3be3a3d6bc807b9cce8)
- chore: update fixtures [732ff84](https://github.com/commenthol/date-holidays-parser/commit/732ff847933f686c68fb012a08a391718510c670)
- chore: remove node@8 from travis [9c38d33](https://github.com/commenthol/date-holidays-parser/commit/9c38d33689070abd44eea3dd20073e6f8d7779d9)
- fix: sort order by date and type [db70108](https://github.com/commenthol/date-holidays-parser/commit/db70108ac32983f14b7d028882d20a254b5e6c22)
- docs: clarify substitute, if, then rule [463c3e6](https://github.com/commenthol/date-holidays-parser/commit/463c3e6e68e5cbe627aa1e81db99b5e2d60e5762)
- test: fix tests [c74a7ce](https://github.com/commenthol/date-holidays-parser/commit/c74a7ce8238d481f62ab412a5aba66537436ac4f)
- feat: return rule in getHolidays [b146eb3](https://github.com/commenthol/date-holidays-parser/commit/b146eb35da5ad4e262937889be610324d1ad2a82)
v1.1.0
- refactor `active` property for rules to en-/ disable rule in time periods
## [1.4.3](https://github.com/commenthol/date-holidays-parser/compare/1.4.2...1.4.3)
v1.0.0
- major refactoring
- Using ISO 8601 format for time spans
- feat: return rule in getHolidays [31b6b48](https://github.com/commenthol/date-holidays-parser/commit/31b6b4828470ad2590b27f10db7d1596530b5614)
v0.1.10
- new rule for optional Christmas Eve in US
## [1.4.2](https://github.com/commenthol/date-holidays-parser/compare/1.4.1...1.4.2)
v0.1.9
- custom builds with holidays2json
- fix: shift timezone for isHolidays [c337ec1](https://github.com/commenthol/date-holidays-parser/commit/c337ec18e702aeaf3d062ea6d657549a836d7257)
v0.1.4
* New general query function used in `date-holidays-ical`
## [1.4.1](https://github.com/commenthol/date-holidays-parser/compare/1.4.0...1.4.1)
- Update specification.md [67d0f01](https://github.com/commenthol/date-holidays-parser/commit/67d0f01b1207aa20e0d1038eb6a1c00bc050e9f3)
- Update Holidays.md [8562936](https://github.com/commenthol/date-holidays-parser/commit/85629360b6f47794e6fff2c019b9896b5d51d16b)
## [1.4.0](https://github.com/commenthol/date-holidays-parser/compare/1.3.2...1.4.0)
- docu: add specification [e273030](https://github.com/commenthol/date-holidays-parser/commit/e273030f2cb6559c440108f1d256b8ec322e6530)
- chore: update to babel7 [332c410](https://github.com/commenthol/date-holidays-parser/commit/332c4105dd999273aa386183e9628a134cf820e7)
- feat: add bengali-revised date [dc74d55](https://github.com/commenthol/date-holidays-parser/commit/dc74d55abbded892a0dc6e2daaec87cab1cf0b3f)
## [1.3.2](https://github.com/commenthol/date-holidays-parser/compare/1.3.1...1.3.2)
- fix: set country, state as object [bcb427e](https://github.com/commenthol/date-holidays-parser/commit/bcb427eb260da0ca78b71943e7b233e329041d32)
- refactor: make isActive static [58c98d9](https://github.com/commenthol/date-holidays-parser/commit/58c98d93fa9f4b0c7b04dfcd1bb2921bb562f8ec)
## [1.3.1](https://github.com/commenthol/date-holidays-parser/compare/1.3.0...1.3.1)
- deprecate node 4 [318b175](https://github.com/commenthol/date-holidays-parser/commit/318b175ff890a4d8bff2bfc7a39da8686d74b79e)
- fix: country name translation issue [bf27ab7](https://github.com/commenthol/date-holidays-parser/commit/bf27ab7f0adab638adee914ffa07e4ccc3d209f6)
- fix: spray debugger statement [7265b68](https://github.com/commenthol/date-holidays-parser/commit/7265b688b60137053d1ecaca0305b0e1e0c89b7b)
- fix: translation issue [14f0c36](https://github.com/commenthol/date-holidays-parser/commit/14f0c36ab30e8cd54eb652481d19900a8034f76a)
- update: tests [332c623](https://github.com/commenthol/date-holidays-parser/commit/332c623c01f29f53ffdf93336f2401d4ef672e0c)
## [1.3.0](https://github.com/commenthol/date-holidays-parser/compare/1.2.3...1.3.0)
- regenerate hebrew hijra calendar [0443a0f](https://github.com/commenthol/date-holidays-parser/commit/0443a0fa9b31858b2e3decb06b4d69e8defd7812)
- bump deps [109cbb8](https://github.com/commenthol/date-holidays-parser/commit/109cbb8be9220c34eb07b9b2f984b68c708b786d)
- new rule weekday [130733a](https://github.com/commenthol/date-holidays-parser/commit/130733a5786fa095a636df41cea97936b7252470)
## [1.2.3](https://github.com/commenthol/date-holidays-parser/compare/1.2.2...1.2.3)
- remove node 4 from travis [3eb8411](https://github.com/commenthol/date-holidays-parser/commit/3eb84115bfedb06a3b119f12bd6c2494849d60ac)
- fix issue multiple types [1153d9d](https://github.com/commenthol/date-holidays-parser/commit/1153d9dc4885a13290e9b9f55e5248d987513588)
- add testcase for state name translations [b500227](https://github.com/commenthol/date-holidays-parser/commit/b500227492f8a13ca0f1d908e65a54067b491ffe)
## [1.2.2](https://github.com/commenthol/date-holidays-parser/compare/1.2.1...1.2.2)
- keep bundle sizes small [a5ad9a3](https://github.com/commenthol/date-holidays-parser/commit/a5ad9a3ba5b75256a4b2ba5f2bbef038d1347403)
## [1.2.1](https://github.com/commenthol/date-holidays-parser/compare/1.2.0...1.2.1)
- remove es5 export [44b6c05](https://github.com/commenthol/date-holidays-parser/commit/44b6c0599c3b7a1b017a5c27c09329ef55e318fd)
- babel transpile to es5 [acd8c4e](https://github.com/commenthol/date-holidays-parser/commit/acd8c4eabd82c3568865ad3ca8390ff0b4fb72d3)
## [1.2.0](https://github.com/commenthol/date-holidays-parser/compare/1.1.1...1.2.0)
- moving to own repo [620670f](https://github.com/commenthol/date-holidays-parser/commit/620670f91c759adf4662f0aef208cc3ec286e3b2)
- deleting data files [d6fe195](https://github.com/commenthol/date-holidays-parser/commit/d6fe1953d39a2b241f5e2f436a441cde38a39f25)
- fix: babelify is devDependency [f5ab799](https://github.com/commenthol/date-holidays-parser/commit/f5ab799ea118d634971d50f00b68bef593600d4f)
## [1.1.1](https://github.com/commenthol/date-holidays-parser/compare/1.1.0...1.1.1)
- bump devDependencies [6583ffe](https://github.com/commenthol/date-holidays-parser/commit/6583ffe50b55e3019272d90cd03e2629be590272)
- linting [1c3c805](https://github.com/commenthol/date-holidays-parser/commit/1c3c805cc69cd4ff7c59bfc48494230e4b7e11cb)
- add ES-AR [6aade6d](https://github.com/commenthol/date-holidays-parser/commit/6aade6d40e0c8ae90d22c2f1319323914c6f8e63)
## [1.1.0](https://github.com/commenthol/date-holidays-parser/compare/1.0.1...1.1.0)
- refactor .active filter [c306889](https://github.com/commenthol/date-holidays-parser/commit/c3068898cbb4e9cfe7fcd2ba6cb58ce74552af8e)
- update [0b1f180](https://github.com/commenthol/date-holidays-parser/commit/0b1f180dd2619acc140ccefd4dc01fe3595c6869)
- linting [7fead79](https://github.com/commenthol/date-holidays-parser/commit/7fead7903a8b6634474820e336166902cc31fe9d)
- rewrite tests with _weekday included [59e1fec](https://github.com/commenthol/date-holidays-parser/commit/59e1fecd703a68ed18aeac440c858d6af1093577)
- change attribution marker [a3ab0bb](https://github.com/commenthol/date-holidays-parser/commit/a3ab0bb608a48047624af41628deb34f25cf036d)
- country CC added [87a576c](https://github.com/commenthol/date-holidays-parser/commit/87a576c654694c4b1677402ba00fcb6180a4358e)
- Country Albania added [05f91eb](https://github.com/commenthol/date-holidays-parser/commit/05f91eb46cb323b313088fe4832e50361cfd7a8f)
- fix DE: add Berlin holidays [ee4964b](https://github.com/commenthol/date-holidays-parser/commit/ee4964befb0a6bdd1497587ffdd2fd1d629313c9)
- browser tests [eff2c8a](https://github.com/commenthol/date-holidays-parser/commit/eff2c8a4800ca55651ed4b3a141b96ff50b2323e)
- example for browser [3117a5e](https://github.com/commenthol/date-holidays-parser/commit/3117a5e6199b6f9aaed3fe5db9efd0553e500448)
## [1.0.1](https://github.com/commenthol/date-holidays-parser/compare/1.0.0...1.0.1)
- fix Boxing Day [fd5cf00](https://github.com/commenthol/date-holidays-parser/commit/fd5cf008ef8b42afb255cc0ffef0ee5b1ef32413)

6

es/Data.js
'use strict';
var _ = {
get: require('lodash.get'),
merge: require('lodash.merge')
};
var _ = require('./utils');
/**

@@ -16,2 +13,3 @@ * Handler for holiday data provided in the Json file

var Data = /*#__PURE__*/function () {

@@ -18,0 +16,0 @@ function Data(data, country, state, region) {

@@ -11,7 +11,3 @@ /**

var _ = {
merge: require('lodash.merge'),
omit: require('lodash.omit'),
set: require('lodash.set')
};
var _ = require('./utils');

@@ -18,0 +14,0 @@ var _require = require('./internal/utils'),

'use strict';
var _get = require('lodash.get');
function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } it = o[Symbol.iterator](); return it.next.bind(it); }
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
var _get = require('./utils').get;
var CalEvent = require('./CalEvent');

@@ -102,4 +108,5 @@

for (var i in arr) {
var p = parser.parse(arr[i]);
for (var _iterator = _createForOfIteratorHelperLoose(arr), _step; !(_step = _iterator()).done;) {
var item = _step.value;
var p = parser.parse(item);

@@ -106,0 +113,0 @@ if (p && p[0] && p[0].year && p[0].year === year) {

@@ -11,6 +11,3 @@ 'use strict';

var _ = {
get: require('lodash.get'),
merge: require('lodash.merge')
};
var _ = require('./utils');
/**

@@ -25,2 +22,3 @@ * Handler for holiday data provided in the Json file

var Data = /*#__PURE__*/function () {

@@ -27,0 +25,0 @@ function Data(data, country, state, region) {

@@ -29,7 +29,3 @@ /**

var _ = {
merge: require('lodash.merge'),
omit: require('lodash.omit'),
set: require('lodash.set')
};
var _ = require('./utils');

@@ -36,0 +32,0 @@ var _require = require('./internal/utils'),

'use strict';
function _createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

@@ -9,3 +15,3 @@

var _get = require('lodash.get');
var _get = require('./utils').get;

@@ -116,8 +122,18 @@ var CalEvent = require('./CalEvent');

for (var i in arr) {
var p = parser.parse(arr[i]);
var _iterator = _createForOfIteratorHelper(arr),
_step;
if (p && p[0] && p[0].year && p[0].year === year) {
return new CalEvent(p[0]).inYear(p[0].year);
try {
for (_iterator.s(); !(_step = _iterator.n()).done;) {
var item = _step.value;
var p = parser.parse(item);
if (p && p[0] && p[0].year && p[0].year === year) {
return new CalEvent(p[0]).inYear(p[0].year);
}
}
} catch (err) {
_iterator.e(err);
} finally {
_iterator.f();
}

@@ -124,0 +140,0 @@ }

{
"name": "date-holidays-parser",
"version": "1.5.0",
"version": "1.6.0",
"description": "parser for worldwide holidays",

@@ -20,2 +20,5 @@ "keywords": [

"author": "commenthol <commenthol@gmail.com>",
"maintainers": [
"commenthol <commenthol@gmail.com>"
],
"contributors": [],

@@ -32,2 +35,3 @@ "main": "lib",

"build:es5": "BABEL_ENV=es5 babel -d es src",
"changelog": "node scripts/gitlog.js",
"clean": "rimraf lib es coverage .nyc_output",

@@ -72,3 +76,3 @@ "clean:all": "npm-run-all clean:node_modules clean",

"dependencies": {
"astronomia": "^2.1.3",
"astronomia": "^2.2.0",
"caldate": "^1.1.0",

@@ -78,33 +82,30 @@ "date-bengali-revised": "^1.0.2",

"date-easter": "^0.2.5",
"lodash.get": "^4.4.2",
"lodash.merge": "^4.6.2",
"lodash.omit": "^4.5.0",
"lodash.set": "^4.3.2",
"moment-timezone": "^0.5.31"
"deepmerge": "^4.2.2",
"moment-timezone": "^0.5.32"
},
"devDependencies": {
"@babel/cli": "^7.8.4",
"@babel/core": "^7.9.6",
"@babel/plugin-proposal-class-properties": "^7.8.3",
"@babel/plugin-proposal-decorators": "^7.8.3",
"@babel/plugin-proposal-export-namespace-from": "^7.8.3",
"@babel/plugin-proposal-function-sent": "^7.8.3",
"@babel/plugin-proposal-json-strings": "^7.8.3",
"@babel/plugin-proposal-numeric-separator": "^7.8.3",
"@babel/plugin-proposal-throw-expressions": "^7.8.3",
"@babel/cli": "^7.12.10",
"@babel/core": "^7.12.10",
"@babel/plugin-proposal-class-properties": "^7.12.1",
"@babel/plugin-proposal-decorators": "^7.12.12",
"@babel/plugin-proposal-export-namespace-from": "^7.12.1",
"@babel/plugin-proposal-function-sent": "^7.12.1",
"@babel/plugin-proposal-json-strings": "^7.12.1",
"@babel/plugin-proposal-numeric-separator": "^7.12.7",
"@babel/plugin-proposal-throw-expressions": "^7.12.1",
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
"@babel/plugin-syntax-import-meta": "^7.8.3",
"@babel/preset-env": "^7.9.6",
"@babel/register": "^7.9.0",
"core-js": "^2.6.10",
"eslint": "^7.1.0",
"eslint-config-standard": "^14.1.1",
"eslint-plugin-import": "^2.20.2",
"@babel/plugin-syntax-import-meta": "^7.10.4",
"@babel/preset-env": "^7.12.11",
"@babel/register": "^7.12.10",
"core-js": "^2.6.12",
"eslint": "^7.16.0",
"eslint-config-standard": "^16.0.2",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-standard": "^4.0.1",
"eslint-plugin-standard": "^5.0.0",
"hashtree": "^0.7.0",
"mocha": "^7.2.0",
"mocha": "^8.2.1",
"npm-run-all": "^4.1.5",
"nyc": "^15.0.1",
"nyc": "^15.1.0",
"rimraf": "^3.0.2",

@@ -115,6 +116,3 @@ "serialize-to-js": "^3.1.1"

"node": ">=6.0.0"
},
"maintainers": [
"commenthol <commenthol@gmail.com>"
]
}
}
'use strict'
const _ = {
get: require('lodash.get'),
merge: require('lodash.merge')
}
const _ = require('./utils')

@@ -8,0 +5,0 @@ /**

@@ -9,7 +9,3 @@ /**

const CalDate = require('caldate')
const _ = {
merge: require('lodash.merge'),
omit: require('lodash.omit'),
set: require('lodash.set')
}
const _ = require('./utils')
const { toYear, toDate } = require('./internal/utils')

@@ -16,0 +12,0 @@ const Data = require('./Data')

@@ -10,3 +10,3 @@ 'use strict'

exports.DAYS = (function () {
var o = {}
const o = {}
'sunday|monday|tuesday|wednesday|thursday|friday|saturday'

@@ -25,3 +25,3 @@ .split('|')

var isObject = exports.isObject = function isObject (arg) {
const isObject = exports.isObject = function isObject (arg) {
return typeof arg === 'object' && arg !== null

@@ -52,4 +52,4 @@ }

*/
var toNumber = exports.toNumber = function toNumber (str) {
var num = parseInt(str, 10)
const toNumber = exports.toNumber = function toNumber (str) {
const num = parseInt(str, 10)
if (!isNaN(num)) {

@@ -56,0 +56,0 @@ return num

'use strict'
const _get = require('lodash.get')
const _get = require('./utils').get
const CalEvent = require('./CalEvent')

@@ -89,4 +89,4 @@ const Parser = require('./Parser')

const parser = new Parser()
for (const i in arr) {
const p = parser.parse(arr[i])
for (const item of arr) {
const p = parser.parse(item)
if (p && p[0] && p[0].year && p[0].year === year) {

@@ -93,0 +93,0 @@ return new CalEvent(p[0]).inYear(p[0].year)

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