From 9c73f38ceb6608ec21c1570fb6ffb6ee76a5c349 Mon Sep 17 00:00:00 2001 From: Gordon Sun Date: Sun, 5 Jun 2022 21:38:37 -0700 Subject: [PATCH] Simplified gh-pages #499 --- .github/FUNDING.yml | 1 - .github/issue_template.md | 15 - .github/pull_request_template.md | 10 - .github/workflows/nodejs.yml | 21 - CHANGELOG.md | 119 - LICENCE | 65 - README.md | 836 +- bower.json | 29 - codecov.yml | 7 - demo/demo.css => demo.css | 0 demo/demo.ts => demo.ts | 4 +- demo/index.html | 586 - dist/demo.d.ts.map | 2 +- dist/demo.js | 53 +- dist/demo.js.map | 2 +- dist/es5/dist/esm/demo/demo.d.ts | 2 - dist/es5/dist/esm/src/cache.d.ts | 23 - dist/es5/dist/esm/src/callbackiterresult.d.ts | 13 - dist/es5/dist/esm/src/datetime.d.ts | 35 - dist/es5/dist/esm/src/dateutil.d.ts | 74 - dist/es5/dist/esm/src/datewithzone.d.ts | 10 - dist/es5/dist/esm/src/helpers.d.ts | 51 - dist/es5/dist/esm/src/index.d.ts | 24 - dist/es5/dist/esm/src/iter/index.d.ts | 4 - dist/es5/dist/esm/src/iter/poslist.d.ts | 4 - dist/es5/dist/esm/src/iterinfo/easter.d.ts | 2 - dist/es5/dist/esm/src/iterinfo/index.d.ts | 36 - dist/es5/dist/esm/src/iterinfo/monthinfo.d.ts | 8 - dist/es5/dist/esm/src/iterinfo/yearinfo.d.ts | 15 - dist/es5/dist/esm/src/iterresult.d.ts | 43 - dist/es5/dist/esm/src/iterset.d.ts | 5 - dist/es5/dist/esm/src/masks.d.ts | 11 - dist/es5/dist/esm/src/nlp/i18n.d.ts | 10 - dist/es5/dist/esm/src/nlp/index.d.ts | 101 - dist/es5/dist/esm/src/nlp/parsetext.d.ts | 4 - dist/es5/dist/esm/src/nlp/totext.d.ts | 56 - dist/es5/dist/esm/src/optionstostring.d.ts | 3 - dist/es5/dist/esm/src/parseoptions.d.ts | 8 - dist/es5/dist/esm/src/parsestring.d.ts | 4 - dist/es5/dist/esm/src/rrule.d.ts | 106 - dist/es5/dist/esm/src/rruleset.d.ts | 56 - dist/es5/dist/esm/src/rrulestr.d.ts | 21 - dist/es5/dist/esm/src/types.d.ts | 56 - dist/es5/dist/esm/src/weekday.d.ts | 11 - dist/es5/rrule-tz.js | 12068 ---------------- dist/es5/rrule-tz.js.map | 1 - dist/es5/rrule-tz.min.js | 40 - dist/es5/rrule.js | 3803 ----- dist/es5/rrule.js.map | 1 - dist/es5/rrule.min.js | 40 - dist/esm/demo/demo.css | 207 - dist/esm/demo/demo.d.ts | 2 - dist/esm/demo/demo.d.ts.map | 1 - dist/esm/demo/demo.js | 51 - dist/esm/demo/demo.js.map | 1 - dist/esm/demo/dist/esm/demo/demo.d.ts | 2 - dist/esm/demo/dist/esm/src/cache.d.ts | 23 - .../demo/dist/esm/src/callbackiterresult.d.ts | 13 - dist/esm/demo/dist/esm/src/datetime.d.ts | 35 - dist/esm/demo/dist/esm/src/dateutil.d.ts | 74 - dist/esm/demo/dist/esm/src/datewithzone.d.ts | 10 - dist/esm/demo/dist/esm/src/helpers.d.ts | 51 - dist/esm/demo/dist/esm/src/index.d.ts | 24 - dist/esm/demo/dist/esm/src/iter/index.d.ts | 4 - dist/esm/demo/dist/esm/src/iter/poslist.d.ts | 4 - .../demo/dist/esm/src/iterinfo/easter.d.ts | 2 - .../esm/demo/dist/esm/src/iterinfo/index.d.ts | 36 - .../demo/dist/esm/src/iterinfo/monthinfo.d.ts | 8 - .../demo/dist/esm/src/iterinfo/yearinfo.d.ts | 15 - dist/esm/demo/dist/esm/src/iterresult.d.ts | 43 - dist/esm/demo/dist/esm/src/iterset.d.ts | 5 - dist/esm/demo/dist/esm/src/masks.d.ts | 11 - dist/esm/demo/dist/esm/src/nlp/i18n.d.ts | 10 - dist/esm/demo/dist/esm/src/nlp/index.d.ts | 101 - dist/esm/demo/dist/esm/src/nlp/parsetext.d.ts | 4 - dist/esm/demo/dist/esm/src/nlp/totext.d.ts | 56 - .../demo/dist/esm/src/optionstostring.d.ts | 3 - dist/esm/demo/dist/esm/src/parseoptions.d.ts | 8 - dist/esm/demo/dist/esm/src/parsestring.d.ts | 4 - dist/esm/demo/dist/esm/src/rrule.d.ts | 106 - dist/esm/demo/dist/esm/src/rruleset.d.ts | 56 - dist/esm/demo/dist/esm/src/rrulestr.d.ts | 21 - dist/esm/demo/dist/esm/src/types.d.ts | 56 - dist/esm/demo/dist/esm/src/weekday.d.ts | 11 - dist/esm/demo/index.html | 586 - dist/esm/src/cache.d.ts | 23 - dist/esm/src/cache.d.ts.map | 1 - dist/esm/src/cache.js | 85 - dist/esm/src/cache.js.map | 1 - dist/esm/src/callbackiterresult.d.ts | 13 - dist/esm/src/callbackiterresult.d.ts.map | 1 - dist/esm/src/callbackiterresult.js | 24 - dist/esm/src/callbackiterresult.js.map | 1 - dist/esm/src/datetime.d.ts | 35 - dist/esm/src/datetime.d.ts.map | 1 - dist/esm/src/datetime.js | 178 - dist/esm/src/datetime.js.map | 1 - dist/esm/src/dateutil.d.ts | 74 - dist/esm/src/dateutil.d.ts.map | 1 - dist/esm/src/dateutil.js | 146 - dist/esm/src/dateutil.js.map | 1 - dist/esm/src/datewithzone.d.ts | 10 - dist/esm/src/datewithzone.d.ts.map | 1 - dist/esm/src/datewithzone.js | 45 - dist/esm/src/datewithzone.js.map | 1 - dist/esm/src/fake-luxon.d.ts | 4 - dist/esm/src/fake-luxon.d.ts.map | 1 - dist/esm/src/fake-luxon.js | 6 - dist/esm/src/fake-luxon.js.map | 1 - dist/esm/src/helpers.d.ts | 53 - dist/esm/src/helpers.d.ts.map | 1 - dist/esm/src/helpers.js | 117 - dist/esm/src/helpers.js.map | 1 - dist/esm/src/index.d.ts | 24 - dist/esm/src/index.d.ts.map | 1 - dist/esm/src/index.js | 23 - dist/esm/src/index.js.map | 1 - dist/esm/src/iter/index.d.ts | 4 - dist/esm/src/iter/index.d.ts.map | 1 - dist/esm/src/iter/index.js | 138 - dist/esm/src/iter/index.js.map | 1 - dist/esm/src/iter/poslist.d.ts | 4 - dist/esm/src/iter/poslist.d.ts.map | 1 - dist/esm/src/iter/poslist.js | 42 - dist/esm/src/iter/poslist.js.map | 1 - dist/esm/src/iterinfo/easter.d.ts | 2 - dist/esm/src/iterinfo/easter.d.ts.map | 1 - dist/esm/src/iterinfo/easter.js | 21 - dist/esm/src/iterinfo/easter.js.map | 1 - dist/esm/src/iterinfo/index.d.ts | 36 - dist/esm/src/iterinfo/index.d.ts.map | 1 - dist/esm/src/iterinfo/index.js | 183 - dist/esm/src/iterinfo/index.js.map | 1 - dist/esm/src/iterinfo/monthinfo.d.ts | 8 - dist/esm/src/iterinfo/monthinfo.d.ts.map | 1 - dist/esm/src/iterinfo/monthinfo.js | 51 - dist/esm/src/iterinfo/monthinfo.js.map | 1 - dist/esm/src/iterinfo/yearinfo.d.ts | 15 - dist/esm/src/iterinfo/yearinfo.d.ts.map | 1 - dist/esm/src/iterinfo/yearinfo.js | 132 - dist/esm/src/iterinfo/yearinfo.js.map | 1 - dist/esm/src/iterresult.d.ts | 43 - dist/esm/src/iterresult.d.ts.map | 1 - dist/esm/src/iterresult.js | 87 - dist/esm/src/iterresult.js.map | 1 - dist/esm/src/iterset.d.ts | 5 - dist/esm/src/iterset.d.ts.map | 1 - dist/esm/src/iterset.js | 63 - dist/esm/src/iterset.js.map | 1 - dist/esm/src/masks.d.ts | 11 - dist/esm/src/masks.d.ts.map | 1 - dist/esm/src/masks.js | 30 - dist/esm/src/masks.js.map | 1 - dist/esm/src/nlp/i18n.d.ts | 10 - dist/esm/src/nlp/i18n.d.ts.map | 1 - dist/esm/src/nlp/i18n.js | 60 - dist/esm/src/nlp/i18n.js.map | 1 - dist/esm/src/nlp/index.d.ts | 101 - dist/esm/src/nlp/index.d.ts.map | 1 - dist/esm/src/nlp/index.js | 121 - dist/esm/src/nlp/index.js.map | 1 - dist/esm/src/nlp/parsetext.d.ts | 4 - dist/esm/src/nlp/parsetext.d.ts.map | 1 - dist/esm/src/nlp/parsetext.js | 406 - dist/esm/src/nlp/parsetext.js.map | 1 - dist/esm/src/nlp/totext.d.ts | 58 - dist/esm/src/nlp/totext.d.ts.map | 1 - dist/esm/src/nlp/totext.js | 387 - dist/esm/src/nlp/totext.js.map | 1 - dist/esm/src/optionstostring.d.ts | 3 - dist/esm/src/optionstostring.d.ts.map | 1 - dist/esm/src/optionstostring.js | 94 - dist/esm/src/optionstostring.js.map | 1 - dist/esm/src/parseoptions.d.ts | 29 - dist/esm/src/parseoptions.d.ts.map | 1 - dist/esm/src/parseoptions.js | 201 - dist/esm/src/parseoptions.js.map | 1 - dist/esm/src/parsestring.d.ts | 4 - dist/esm/src/parsestring.d.ts.map | 1 - dist/esm/src/parsestring.js | 121 - dist/esm/src/parsestring.js.map | 1 - dist/esm/src/rrule.d.ts | 106 - dist/esm/src/rrule.d.ts.map | 1 - dist/esm/src/rrule.js | 231 - dist/esm/src/rrule.js.map | 1 - dist/esm/src/rruleset.d.ts | 82 - dist/esm/src/rruleset.d.ts.map | 1 - dist/esm/src/rruleset.js | 180 - dist/esm/src/rruleset.js.map | 1 - dist/esm/src/rrulestr.d.ts | 21 - dist/esm/src/rrulestr.d.ts.map | 1 - dist/esm/src/rrulestr.js | 188 - dist/esm/src/rrulestr.js.map | 1 - dist/esm/src/types.d.ts | 56 - dist/esm/src/types.d.ts.map | 1 - dist/esm/src/types.js | 14 - dist/esm/src/types.js.map | 1 - dist/esm/src/weekday.d.ts | 13 - dist/esm/src/weekday.d.ts.map | 1 - dist/esm/src/weekday.js | 37 - dist/esm/src/weekday.js.map | 1 - dist/index.html | 2 +- index.html | 587 +- package.json | 61 +- src/cache.ts | 93 - src/callbackiterresult.ts | 29 - src/datetime.ts | 250 - src/dateutil.ts | 198 - src/datewithzone.ts | 49 - src/fake-luxon.ts | 5 - src/helpers.ts | 130 - src/index.ts | 30 - src/iter/index.ts | 206 - src/iter/poslist.ts | 46 - src/iterinfo/easter.ts | 20 - src/iterinfo/index.ts | 173 - src/iterinfo/monthinfo.ts | 67 - src/iterinfo/yearinfo.ts | 165 - src/iterresult.ts | 100 - src/iterset.ts | 78 - src/masks.ts | 134 - src/nlp/i18n.ts | 69 - src/nlp/index.ts | 135 - src/nlp/parsetext.ts | 444 - src/nlp/totext.ts | 479 - src/optionstostring.ts | 101 - src/parseoptions.ts | 212 - src/parsestring.ts | 138 - src/rrule.ts | 273 - src/rruleset.ts | 227 - src/rrulestr.ts | 260 - src/types.ts | 64 - src/weekday.ts | 43 - test/dateutil.test.ts | 9 - test/datewithzone.test.ts | 66 - test/helpers.test.ts | 132 - test/lib/utils.ts | 209 - test/mocha.opts | 2 - test/nlp.test.ts | 113 - test/optionstostring.test.ts | 29 - test/parseoptions.test.ts | 48 - test/parsestring.test.ts | 68 - test/rrule.test.ts | 3735 ----- test/rruleset.test.ts | 788 - test/rrulestr.test.ts | 409 - test/tslint.json | 4 - tsconfig.json | 7 +- tsconfig.test.json | 24 - tslint.json | 144 - webpack.config.js | 62 +- yarn.lock | 1276 +- 251 files changed, 663 insertions(+), 35793 deletions(-) delete mode 100644 .github/FUNDING.yml delete mode 100644 .github/issue_template.md delete mode 100644 .github/pull_request_template.md delete mode 100644 .github/workflows/nodejs.yml delete mode 100644 CHANGELOG.md delete mode 100644 LICENCE delete mode 100644 bower.json delete mode 100644 codecov.yml rename demo/demo.css => demo.css (100%) rename demo/demo.ts => demo.ts (98%) delete mode 100644 demo/index.html delete mode 100644 dist/es5/dist/esm/demo/demo.d.ts delete mode 100644 dist/es5/dist/esm/src/cache.d.ts delete mode 100644 dist/es5/dist/esm/src/callbackiterresult.d.ts delete mode 100644 dist/es5/dist/esm/src/datetime.d.ts delete mode 100644 dist/es5/dist/esm/src/dateutil.d.ts delete mode 100644 dist/es5/dist/esm/src/datewithzone.d.ts delete mode 100644 dist/es5/dist/esm/src/helpers.d.ts delete mode 100644 dist/es5/dist/esm/src/index.d.ts delete mode 100644 dist/es5/dist/esm/src/iter/index.d.ts delete mode 100644 dist/es5/dist/esm/src/iter/poslist.d.ts delete mode 100644 dist/es5/dist/esm/src/iterinfo/easter.d.ts delete mode 100644 dist/es5/dist/esm/src/iterinfo/index.d.ts delete mode 100644 dist/es5/dist/esm/src/iterinfo/monthinfo.d.ts delete mode 100644 dist/es5/dist/esm/src/iterinfo/yearinfo.d.ts delete mode 100644 dist/es5/dist/esm/src/iterresult.d.ts delete mode 100644 dist/es5/dist/esm/src/iterset.d.ts delete mode 100644 dist/es5/dist/esm/src/masks.d.ts delete mode 100644 dist/es5/dist/esm/src/nlp/i18n.d.ts delete mode 100644 dist/es5/dist/esm/src/nlp/index.d.ts delete mode 100644 dist/es5/dist/esm/src/nlp/parsetext.d.ts delete mode 100644 dist/es5/dist/esm/src/nlp/totext.d.ts delete mode 100644 dist/es5/dist/esm/src/optionstostring.d.ts delete mode 100644 dist/es5/dist/esm/src/parseoptions.d.ts delete mode 100644 dist/es5/dist/esm/src/parsestring.d.ts delete mode 100644 dist/es5/dist/esm/src/rrule.d.ts delete mode 100644 dist/es5/dist/esm/src/rruleset.d.ts delete mode 100644 dist/es5/dist/esm/src/rrulestr.d.ts delete mode 100644 dist/es5/dist/esm/src/types.d.ts delete mode 100644 dist/es5/dist/esm/src/weekday.d.ts delete mode 100644 dist/es5/rrule-tz.js delete mode 100644 dist/es5/rrule-tz.js.map delete mode 100644 dist/es5/rrule-tz.min.js delete mode 100644 dist/es5/rrule.js delete mode 100644 dist/es5/rrule.js.map delete mode 100644 dist/es5/rrule.min.js delete mode 100644 dist/esm/demo/demo.css delete mode 100644 dist/esm/demo/demo.d.ts delete mode 100644 dist/esm/demo/demo.d.ts.map delete mode 100644 dist/esm/demo/demo.js delete mode 100644 dist/esm/demo/demo.js.map delete mode 100644 dist/esm/demo/dist/esm/demo/demo.d.ts delete mode 100644 dist/esm/demo/dist/esm/src/cache.d.ts delete mode 100644 dist/esm/demo/dist/esm/src/callbackiterresult.d.ts delete mode 100644 dist/esm/demo/dist/esm/src/datetime.d.ts delete mode 100644 dist/esm/demo/dist/esm/src/dateutil.d.ts delete mode 100644 dist/esm/demo/dist/esm/src/datewithzone.d.ts delete mode 100644 dist/esm/demo/dist/esm/src/helpers.d.ts delete mode 100644 dist/esm/demo/dist/esm/src/index.d.ts delete mode 100644 dist/esm/demo/dist/esm/src/iter/index.d.ts delete mode 100644 dist/esm/demo/dist/esm/src/iter/poslist.d.ts delete mode 100644 dist/esm/demo/dist/esm/src/iterinfo/easter.d.ts delete mode 100644 dist/esm/demo/dist/esm/src/iterinfo/index.d.ts delete mode 100644 dist/esm/demo/dist/esm/src/iterinfo/monthinfo.d.ts delete mode 100644 dist/esm/demo/dist/esm/src/iterinfo/yearinfo.d.ts delete mode 100644 dist/esm/demo/dist/esm/src/iterresult.d.ts delete mode 100644 dist/esm/demo/dist/esm/src/iterset.d.ts delete mode 100644 dist/esm/demo/dist/esm/src/masks.d.ts delete mode 100644 dist/esm/demo/dist/esm/src/nlp/i18n.d.ts delete mode 100644 dist/esm/demo/dist/esm/src/nlp/index.d.ts delete mode 100644 dist/esm/demo/dist/esm/src/nlp/parsetext.d.ts delete mode 100644 dist/esm/demo/dist/esm/src/nlp/totext.d.ts delete mode 100644 dist/esm/demo/dist/esm/src/optionstostring.d.ts delete mode 100644 dist/esm/demo/dist/esm/src/parseoptions.d.ts delete mode 100644 dist/esm/demo/dist/esm/src/parsestring.d.ts delete mode 100644 dist/esm/demo/dist/esm/src/rrule.d.ts delete mode 100644 dist/esm/demo/dist/esm/src/rruleset.d.ts delete mode 100644 dist/esm/demo/dist/esm/src/rrulestr.d.ts delete mode 100644 dist/esm/demo/dist/esm/src/types.d.ts delete mode 100644 dist/esm/demo/dist/esm/src/weekday.d.ts delete mode 100644 dist/esm/demo/index.html delete mode 100644 dist/esm/src/cache.d.ts delete mode 100644 dist/esm/src/cache.d.ts.map delete mode 100644 dist/esm/src/cache.js delete mode 100644 dist/esm/src/cache.js.map delete mode 100644 dist/esm/src/callbackiterresult.d.ts delete mode 100644 dist/esm/src/callbackiterresult.d.ts.map delete mode 100644 dist/esm/src/callbackiterresult.js delete mode 100644 dist/esm/src/callbackiterresult.js.map delete mode 100644 dist/esm/src/datetime.d.ts delete mode 100644 dist/esm/src/datetime.d.ts.map delete mode 100644 dist/esm/src/datetime.js delete mode 100644 dist/esm/src/datetime.js.map delete mode 100644 dist/esm/src/dateutil.d.ts delete mode 100644 dist/esm/src/dateutil.d.ts.map delete mode 100644 dist/esm/src/dateutil.js delete mode 100644 dist/esm/src/dateutil.js.map delete mode 100644 dist/esm/src/datewithzone.d.ts delete mode 100644 dist/esm/src/datewithzone.d.ts.map delete mode 100644 dist/esm/src/datewithzone.js delete mode 100644 dist/esm/src/datewithzone.js.map delete mode 100644 dist/esm/src/fake-luxon.d.ts delete mode 100644 dist/esm/src/fake-luxon.d.ts.map delete mode 100644 dist/esm/src/fake-luxon.js delete mode 100644 dist/esm/src/fake-luxon.js.map delete mode 100644 dist/esm/src/helpers.d.ts delete mode 100644 dist/esm/src/helpers.d.ts.map delete mode 100644 dist/esm/src/helpers.js delete mode 100644 dist/esm/src/helpers.js.map delete mode 100644 dist/esm/src/index.d.ts delete mode 100644 dist/esm/src/index.d.ts.map delete mode 100644 dist/esm/src/index.js delete mode 100644 dist/esm/src/index.js.map delete mode 100644 dist/esm/src/iter/index.d.ts delete mode 100644 dist/esm/src/iter/index.d.ts.map delete mode 100644 dist/esm/src/iter/index.js delete mode 100644 dist/esm/src/iter/index.js.map delete mode 100644 dist/esm/src/iter/poslist.d.ts delete mode 100644 dist/esm/src/iter/poslist.d.ts.map delete mode 100644 dist/esm/src/iter/poslist.js delete mode 100644 dist/esm/src/iter/poslist.js.map delete mode 100644 dist/esm/src/iterinfo/easter.d.ts delete mode 100644 dist/esm/src/iterinfo/easter.d.ts.map delete mode 100644 dist/esm/src/iterinfo/easter.js delete mode 100644 dist/esm/src/iterinfo/easter.js.map delete mode 100644 dist/esm/src/iterinfo/index.d.ts delete mode 100644 dist/esm/src/iterinfo/index.d.ts.map delete mode 100644 dist/esm/src/iterinfo/index.js delete mode 100644 dist/esm/src/iterinfo/index.js.map delete mode 100644 dist/esm/src/iterinfo/monthinfo.d.ts delete mode 100644 dist/esm/src/iterinfo/monthinfo.d.ts.map delete mode 100644 dist/esm/src/iterinfo/monthinfo.js delete mode 100644 dist/esm/src/iterinfo/monthinfo.js.map delete mode 100644 dist/esm/src/iterinfo/yearinfo.d.ts delete mode 100644 dist/esm/src/iterinfo/yearinfo.d.ts.map delete mode 100644 dist/esm/src/iterinfo/yearinfo.js delete mode 100644 dist/esm/src/iterinfo/yearinfo.js.map delete mode 100644 dist/esm/src/iterresult.d.ts delete mode 100644 dist/esm/src/iterresult.d.ts.map delete mode 100644 dist/esm/src/iterresult.js delete mode 100644 dist/esm/src/iterresult.js.map delete mode 100644 dist/esm/src/iterset.d.ts delete mode 100644 dist/esm/src/iterset.d.ts.map delete mode 100644 dist/esm/src/iterset.js delete mode 100644 dist/esm/src/iterset.js.map delete mode 100644 dist/esm/src/masks.d.ts delete mode 100644 dist/esm/src/masks.d.ts.map delete mode 100644 dist/esm/src/masks.js delete mode 100644 dist/esm/src/masks.js.map delete mode 100644 dist/esm/src/nlp/i18n.d.ts delete mode 100644 dist/esm/src/nlp/i18n.d.ts.map delete mode 100644 dist/esm/src/nlp/i18n.js delete mode 100644 dist/esm/src/nlp/i18n.js.map delete mode 100644 dist/esm/src/nlp/index.d.ts delete mode 100644 dist/esm/src/nlp/index.d.ts.map delete mode 100644 dist/esm/src/nlp/index.js delete mode 100644 dist/esm/src/nlp/index.js.map delete mode 100644 dist/esm/src/nlp/parsetext.d.ts delete mode 100644 dist/esm/src/nlp/parsetext.d.ts.map delete mode 100644 dist/esm/src/nlp/parsetext.js delete mode 100644 dist/esm/src/nlp/parsetext.js.map delete mode 100644 dist/esm/src/nlp/totext.d.ts delete mode 100644 dist/esm/src/nlp/totext.d.ts.map delete mode 100644 dist/esm/src/nlp/totext.js delete mode 100644 dist/esm/src/nlp/totext.js.map delete mode 100644 dist/esm/src/optionstostring.d.ts delete mode 100644 dist/esm/src/optionstostring.d.ts.map delete mode 100644 dist/esm/src/optionstostring.js delete mode 100644 dist/esm/src/optionstostring.js.map delete mode 100644 dist/esm/src/parseoptions.d.ts delete mode 100644 dist/esm/src/parseoptions.d.ts.map delete mode 100644 dist/esm/src/parseoptions.js delete mode 100644 dist/esm/src/parseoptions.js.map delete mode 100644 dist/esm/src/parsestring.d.ts delete mode 100644 dist/esm/src/parsestring.d.ts.map delete mode 100644 dist/esm/src/parsestring.js delete mode 100644 dist/esm/src/parsestring.js.map delete mode 100644 dist/esm/src/rrule.d.ts delete mode 100644 dist/esm/src/rrule.d.ts.map delete mode 100644 dist/esm/src/rrule.js delete mode 100644 dist/esm/src/rrule.js.map delete mode 100644 dist/esm/src/rruleset.d.ts delete mode 100644 dist/esm/src/rruleset.d.ts.map delete mode 100644 dist/esm/src/rruleset.js delete mode 100644 dist/esm/src/rruleset.js.map delete mode 100644 dist/esm/src/rrulestr.d.ts delete mode 100644 dist/esm/src/rrulestr.d.ts.map delete mode 100644 dist/esm/src/rrulestr.js delete mode 100644 dist/esm/src/rrulestr.js.map delete mode 100644 dist/esm/src/types.d.ts delete mode 100644 dist/esm/src/types.d.ts.map delete mode 100644 dist/esm/src/types.js delete mode 100644 dist/esm/src/types.js.map delete mode 100644 dist/esm/src/weekday.d.ts delete mode 100644 dist/esm/src/weekday.d.ts.map delete mode 100644 dist/esm/src/weekday.js delete mode 100644 dist/esm/src/weekday.js.map mode change 120000 => 100644 index.html delete mode 100644 src/cache.ts delete mode 100644 src/callbackiterresult.ts delete mode 100644 src/datetime.ts delete mode 100644 src/dateutil.ts delete mode 100644 src/datewithzone.ts delete mode 100644 src/fake-luxon.ts delete mode 100644 src/helpers.ts delete mode 100644 src/index.ts delete mode 100644 src/iter/index.ts delete mode 100644 src/iter/poslist.ts delete mode 100644 src/iterinfo/easter.ts delete mode 100644 src/iterinfo/index.ts delete mode 100644 src/iterinfo/monthinfo.ts delete mode 100644 src/iterinfo/yearinfo.ts delete mode 100644 src/iterresult.ts delete mode 100644 src/iterset.ts delete mode 100644 src/masks.ts delete mode 100644 src/nlp/i18n.ts delete mode 100644 src/nlp/index.ts delete mode 100644 src/nlp/parsetext.ts delete mode 100644 src/nlp/totext.ts delete mode 100644 src/optionstostring.ts delete mode 100644 src/parseoptions.ts delete mode 100644 src/parsestring.ts delete mode 100644 src/rrule.ts delete mode 100644 src/rruleset.ts delete mode 100644 src/rrulestr.ts delete mode 100644 src/types.ts delete mode 100644 src/weekday.ts delete mode 100644 test/dateutil.test.ts delete mode 100644 test/datewithzone.test.ts delete mode 100644 test/helpers.test.ts delete mode 100644 test/lib/utils.ts delete mode 100644 test/mocha.opts delete mode 100644 test/nlp.test.ts delete mode 100644 test/optionstostring.test.ts delete mode 100644 test/parseoptions.test.ts delete mode 100644 test/parsestring.test.ts delete mode 100644 test/rrule.test.ts delete mode 100644 test/rruleset.test.ts delete mode 100644 test/rrulestr.test.ts delete mode 100644 test/tslint.json delete mode 100644 tsconfig.test.json delete mode 100644 tslint.json diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml deleted file mode 100644 index 5fe1a8c6..00000000 --- a/.github/FUNDING.yml +++ /dev/null @@ -1 +0,0 @@ -github: [jakubroztocil, davidgoli] diff --git a/.github/issue_template.md b/.github/issue_template.md deleted file mode 100644 index 01d88ca4..00000000 --- a/.github/issue_template.md +++ /dev/null @@ -1,15 +0,0 @@ -### Reporting an issue - -Thank you for taking an interest in `rrule`! Please include the following in -your report: - -- [ ] Verify that you've looked through existing issues for duplicates before - creating a new one -- [ ] Code sample reproducing the issue. Be sure to include all input values you - are using such as the exact RRule string and dates. -- [ ] Expected output -- [ ] Actual output -- [ ] The version of `rrule` you are using -- [ ] Your operating system -- [ ] Your local timezone (run `$ date` from the command line - of the machine showing the bug) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md deleted file mode 100644 index e3e6cb68..00000000 --- a/.github/pull_request_template.md +++ /dev/null @@ -1,10 +0,0 @@ ---- - -### Thanks for contributing to `rrule`! - -To submit a pull request, please verify that you have done the following: - -- [ ] Merged in or rebased on the latest `master` commit -- [ ] Linked to an existing bug or issue describing the bug or feature you're - addressing -- [ ] Written one or more tests showing that your change works as advertised diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml deleted file mode 100644 index c2254e91..00000000 --- a/.github/workflows/nodejs.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: Node CI -on: [push, pull_request] -jobs: - build: - runs-on: ubuntu-latest - strategy: - matrix: - node-version: [10.x, 12.x] - steps: - - uses: actions/checkout@v1 - - uses: actions/setup-node@v1 - with: - node-version: ${{ matrix.node-version }} - - run: npm install -g codecov nyc - - run: yarn install - - run: yarn build - - run: TZ=America/Vancouver yarn test - - run: TZ=America/Los_Angeles yarn test - - run: TZ=Africa/Nairobi yarn test - - run: TZ=Asia/Tokyo yarn test-ci - - run: nyc report --reporter=json && codecov -t ${{ secrets.CODECOV_REPO_TOKEN }} -f coverage/*.json diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index fc6a82e7..00000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,119 +0,0 @@ -### Changelog - -- 2.6.5 (2020-08-23) - - Bugfixes: - - `luxon`-less binary should not contain any `luxon` imports (#410) - - Fixed `toText` pluralization of “minutes“ (#415) -- 2.6.4 (2019-12-18) - - Bugfixes: - - Calculating series with unknown timezones will produce infinite loop (#320) - - Internal: - - Upgrade build dependencies -- 2.6.3 (2019-11-24) - - Features - - Allow passing `WeekdayStr` to `byweekday` like the types suggest is possible (#371) -- 2.6.2 (2019-06-08) - - Features - - Allow two digits for `BYDAY` (#330) - - Add a quick way to format `until` in `toText` (#313) - - Add support for parsing an rrule string without frequency (#339) - - Add getters for `rrules`, `exrules`, `rdates`, `exdates` (#347) -- 2.6.0 (2019-01-03) - - Bugfixes: - - Fix sourcemap structure (#303) -- 2.5.6 (2018-09-30) - - Bugfixes: - - Validate date inputs (#281) -- 2.5.5 (2018-09-06) - - Bugfixes: - - Don't emit `RDATE;TZID=UTC` for rdates -- 2.5.3 (2018-09-06) - - Bugfixes: - - Prevented emitting `DTSTART;TZID=UTC` when UTC is explicitly set as tzid -- 2.5.2 (2018-09-05) - - Bugfixes: - - Permitted RRuleSets with no rrules to have tzid -- 2.5.1 (2018-09-02) - - Bugfixes: - - Conformed output & parsing to RFC 5545 (#295) -- 2.4.1 (2018-08-16) - - Features: - - Added codecov (#265) - - Bugfixes: - - Fixed RRULE parsing issue (#266) -- 2.4.0 (2018-08-16) - - Features: - - Implement `TZID` support (#38, #261) - - Bugfixes: - - Fixed an error in Typescript output (#264) -- 2.3.6 (2018-08-14) - - Bugfixes: - - Point package.json to es5-compiled bundle (#260) -- 2.3.5 (2018-08-14) - - Features: - - Return text "every day" when all days are selected - - Bugfixes: - - Sort monthdays correctly from toText() (#101) - - Accept 0 as a valid monthday/weekday value (#153) - - Support 3-digit years (#202) -- 2.3.4 (2018-08-10) - - Fixed support for eastern hemisphere timezones (#247) -- 2.3.3 (2018-08-08) - - Fixed typescript error (#244) -- 2.3.2 (2018-08-07) - - Fixed deploy on npm (#239) -- 2.3.0 (2018-08-06) - - Converted to [Typescript](https://www.typescriptlang.org/) (#229) - - Add es5 and es6 distributions - - Fixed a bug where recurrences in DST were 1 hour off if the host system used DST (#233) - - Fixed numeric handling of weekday strings -- 2.2.8 (2018-02-16) - - Added `fromText()` and `toText()` support for rules with `RRule.MINUTELY` frequency. - - Added support for `VALUE=DATE` as a `RDATE` param. - - Added typescript definitions. - - Merged in the now obsolete `arolson101/rrule` fork (many thanks to @arolson101). - - Fixed `RRule` mutating passed-in `options` in some cases. - - Fixed unexpected results with dates lower than 1970. - - Fixed `RRule.DAILY` frequency when only 1 `BYHOUR` is provided. - - Fixed the internal `isLeapYear()` to only accept integers instead of relying on `instanceof` to check the parameter type. -- 2.2.0 (2017-03-11) - - Added support `RRuleSet`, which allows more complex recurrence setups, - mixing multiple rules, dates, exclusion rules, and exclusion dates. - - Added Millisecond precision - - Millisecond offset extracted from `dtstart` (`dtstart.getTime() % 1000`) - - Each recurrence is returned with the same offset - - Added some NLP support for hourly and byhour. - - Fixed export in nlp.js. -- 2.1.0 - - Removed dependency on Underscore.js (thanks, @gsf). - - Various small bugfixes and improvements. -- 2.0.1 - - Added bower.json. -- 2.0.0 (2013-07-16) - - Fixed a February 28-related issue. - - More flexible, backwards-incompatible API: - - `freq` is now `options.freq`. - - `options.cache` is now `noCache`. - - `iterator` has to return `true` - - `dtstart` and `options` arguments removed from `RRule.fromString` - (use `RRule.parseString` and modify `options` manually instead). - - `today` argument removed from `Rule.prototype.toText` - (never actually used). - - `rule.toString()` now includes `DTSTART` (if explicitly specified - in `options`). - - Day constants `.clone` is now `.nth`, eg. `RRule.FR.nth(-1)` - (last Friday). - - Added `RRule.parseString` - - Added `RRule.parseText` - - Added `RRule.optionsToString` -- 1.1.0 (2013-05-21) - - Added a [demo app](http://jakubroztocil.github.io/rrule/). - - Handle dates in `UNTIL` in `RRule.fromString`. - - Added support for RequireJS. - - Added `options` argument to `RRule.fromString`. -- 1.0.1 (2013-02-26) - - Fixed leap years (thanks @jessevogt) -- 1.0.0 (2013-01-24) - - Fixed timezone offset issues related to DST (thanks @evro). -- 1.0.0-beta (2012-08-15) - - Initial public release. diff --git a/LICENCE b/LICENCE deleted file mode 100644 index a68f31d0..00000000 --- a/LICENCE +++ /dev/null @@ -1,65 +0,0 @@ -rrule.js: Library for working with recurrence rules for calendar dates. -======================================================================= - -Copyright 2010, Jakub Roztocil and Lars Schöning - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - 3. Neither the name of The author nor the names of its contributors may - be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE AUTHOR AND CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - - -./rrule.js and ./test/tests.js is based on python-dateutil. LICENCE: - -python-dateutil - Extensions to the standard Python datetime module. -==================================================================== - -Copyright (c) 2003-2011 - Gustavo Niemeyer -Copyright (c) 2012 - Tomi Pieviläinen - -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of the copyright holder nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/README.md b/README.md index df05ca25..1d722161 100644 --- a/README.md +++ b/README.md @@ -1,827 +1,9 @@ -rrule.js -======== - -**Library for working with recurrence rules for calendar dates.** - -[![NPM version][npm-image]][npm-url] -[![Build Status][ci-image]][ci-url] -[![js-standard-style][js-standard-image]][js-standard-url] -[![Downloads][downloads-image]][downloads-url] -[![Gitter][gitter-image]][gitter-url] -[![codecov.io](http://codecov.io/github/jakubroztocil/rrule/coverage.svg?branch=master)](http://codecov.io/github/jakubroztocil/rrule?branch=master) - -rrule.js supports recurrence rules as defined in the [iCalendar -RFC](https://tools.ietf.org/html/rfc5545), with a few important -[differences](#differences-from-icalendar-rfc). It is a partial port of the -`rrule` module from the excellent -[python-dateutil](http://labix.org/python-dateutil/) library. On top of -that, it supports parsing and serialization of recurrence rules from and -to natural language. - -* * * * * - - -### Quick Start - -- [Demo app](http://jakubroztocil.github.io/rrule/) - -#### Client Side - -```bash -$ yarn add rrule -``` - -Alternatively, download manually: - - * [rrule.min.js](https://jakubroztocil.github.io/rrule/dist/es5/rrule.min.js) (bundled, minified) - * [rrule.js](https://jakubroztocil.github.io/rrule/dist/es5/rrule.js) (bundled, not minified) - * [rrule-tz.min.js](https://jakubroztocil.github.io/rrule/dist/es5/rrule-tz.min.js) (with timezone support, bundled, minified) - * [rrule-tz.js](https://jakubroztocil.github.io/rrule/dist/es5/rrule-tz.js) (with timezone support, bundled, not minified) - -```html - -``` - -#### Server Side - -Includes optional TypeScript types - -```bash -$ yarn add rrule -# or -$ npm install rrule -``` - -#### Usage - -**RRule:** -```es6 -import { RRule, RRuleSet, rrulestr } from 'rrule' - -// Create a rule: -const rule = new RRule({ - freq: RRule.WEEKLY, - interval: 5, - byweekday: [RRule.MO, RRule.FR], - dtstart: new Date(Date.UTC(2012, 1, 1, 10, 30)), - until: new Date(Date.UTC(2012, 12, 31)) -}) - -// Get all occurrence dates (Date instances): -rule.all() -[ '2012-02-03T10:30:00.000Z', - '2012-03-05T10:30:00.000Z', - '2012-03-09T10:30:00.000Z', - '2012-04-09T10:30:00.000Z', - '2012-04-13T10:30:00.000Z', - '2012-05-14T10:30:00.000Z', - '2012-05-18T10:30:00.000Z', - - /* … */] - -// Get a slice: -rule.between(new Date(Date.UTC(2012, 7, 1)), new Date(Date.UTC(2012, 8, 1))) -['2012-08-27T10:30:00.000Z', - '2012-08-31T10:30:00.000Z'] - -// Get an iCalendar RRULE string representation: -// The output can be used with RRule.fromString(). -rule.toString() -"DTSTART:20120201T093000Z\nRRULE:FREQ=WEEKLY;INTERVAL=5;UNTIL=20130130T230000Z;BYDAY=MO,FR" - -// Get a human-friendly text representation: -// The output can be used with RRule.fromText(). -rule.toText() -"every 5 weeks on Monday, Friday until January 31, 2013" -``` - -**RRuleSet:** -```js -const rruleSet = new RRuleSet() - -// Add a rrule to rruleSet -rruleSet.rrule(new RRule({ - freq: RRule.MONTHLY, - count: 5, - dtstart: new Date(Date.UTC(2012, 1, 1, 10, 30)) -})) - -// Add a date to rruleSet -rruleSet.rdate(new Date(Date.UTC(2012, 6, 1, 10, 30))) - -// Add another date to rruleSet -rruleSet.rdate(new Date(Date.UTC(2012, 6, 2, 10, 30))) - -// Add a exclusion rrule to rruleSet -rruleSet.exrule(new RRule({ - freq: RRule.MONTHLY, - count: 2, - dtstart: new Date(Date.UTC(2012, 2, 1, 10, 30)) -})) - -// Add a exclusion date to rruleSet -rruleSet.exdate(new Date(Date.UTC(2012, 5, 1, 10, 30))) - -// Get all occurrence dates (Date instances): -rruleSet.all() -[ '2012-02-01T10:30:00.000Z', - '2012-05-01T10:30:00.000Z', - '2012-07-01T10:30:00.000Z', - '2012-07-02T10:30:00.000Z' ] - -// Get a slice: -rruleSet.between(new Date(Date.UTC(2012, 2, 1)), new Date(Date.UTC(2012, 6, 2))) -[ '2012-05-01T10:30:00.000Z', '2012-07-01T10:30:00.000Z' ] - - - // To string -rruleSet.valueOf() -['DTSTART:20120201T023000Z', - 'RRULE:FREQ=MONTHLY;COUNT=5', - 'RDATE:20120701T023000Z,20120702T023000Z', - 'EXRULE:FREQ=MONTHLY;COUNT=2', - 'EXDATE:20120601T023000Z'] - -// To string -rruleSet.toString() -'["DTSTART:20120201T023000Z","RRULE:FREQ=MONTHLY;COUNT=5","RDATE:20120701T023000Z,20120702T023000Z","EXRULE:FREQ=MONTHLY;COUNT=2","EXDATE:20120601T023000Z"]' -``` - -**rrulestr:** -```js -// Parse a RRule string, return a RRule object -rrulestr('DTSTART:20120201T023000Z\nRRULE:FREQ=MONTHLY;COUNT=5') - -// Parse a RRule string, return a RRuleSet object -rrulestr('DTSTART:20120201T023000Z\nRRULE:FREQ=MONTHLY;COUNT=5', {forceset: true}) - -// Parse a RRuleSet string, return a RRuleSet object -rrulestr('DTSTART:20120201T023000Z\nRRULE:FREQ=MONTHLY;COUNT=5\nRDATE:20120701T023000Z,20120702T023000Z\nEXRULE:FREQ=MONTHLY;COUNT=2\nEXDATE:20120601T023000Z') - -``` - -### Important: Use UTC dates - -Dates in JavaScript are tricky. `RRule` tries to support as much flexibility as possible without adding any large required 3rd party dependencies, but that means we also have some special rules. - -By default, `RRule` deals in ["floating" times or UTC timezones](https://tools.ietf.org/html/rfc5545#section-3.2.19). If you want results in a specific timezone, `RRule` also provides [timezone support](#timezone-support). Either way, JavaScript's built-in "timezone" offset tends to just get in the way, so this library simply doesn't use it at all. All times are returned with zero offset, as though it didn't exist in JavaScript. - -**The bottom line is the returned "UTC" dates are always meant to be interpreted as dates in your local timezone. This may mean you have to do additional conversion to get the "correct" local time with offset applied.** - -For this reason, it is highly recommended to use timestamps in UTC eg. `new Date(Date.UTC(...))`. Returned dates will likewise be in UTC (except on Chrome, which always returns dates with a timezone offset). - -For example: - -```ts -// local machine zone is America/Los_Angeles -const rule = RRule.fromString( - "DTSTART;TZID=America/Denver:20181101T190000;\n" - + "RRULE:FREQ=WEEKLY;BYDAY=MO,WE,TH;INTERVAL=1;COUNT=3" -) -rule.all() - -[ 2018-11-01T18:00:00.000Z, - 2018-11-05T18:00:00.000Z, - 2018-11-07T18:00:00.000Z ] -// Even though the given offset is `Z` (UTC), these are local times, not UTC times. -// Each of these this is the correct local Pacific time of each recurrence in -// America/Los_Angeles when it is 19:00 in America/Denver, including the DST shift. - -// You can get the local components by using the getUTC* methods eg: -date.getUTCDate() // --> 1 -date.getUTCHours() // --> 18 -``` - -If you want to get the same times in true UTC, you may do so eg. using Luxon: - -```ts -rule.all().map(date => -DateTime.fromJSDate(date) - .toUTC() - .setZone('local', { keepLocalTime: true }) - .toJSDate() -) - -[ 2018-11-02T01:00:00.000Z, - 2018-11-06T02:00:00.000Z, - 2018-11-08T02:00:00.000Z ] -// These times are in true UTC; you can see the hours shift -``` - -For more examples see -[python-dateutil](http://labix.org/python-dateutil/) documentation. - -* * * * * - -### Timezone Support - -Optionally, it also supports use of the `TZID` parameter in the -[RFC](https://tools.ietf.org/html/rfc5545#section-3.2.19) -when the [Luxon](https://github.com/moment/luxon) library is provided. The -[specification](https://moment.github.io/luxon/docs/manual/zones.html#specifying-a-zone) -and [support matrix](https://moment.github.io/luxon/docs/manual/matrix.html) for Luxon apply. - -Example with `TZID`: - -```js -new RRule({ - dtstart: new Date(Date.UTC(2018, 1, 1, 10, 30)), - count: 1, - tzid: 'Asia/Tokyo' -}).all() - -// assuming the system timezone is set to America/Los_Angeles, you get: -[ '2018-01-31T17:30:00.000Z' ] -// which is the time in Los Angeles when it's 2018-02-01T10:30:00 in Tokyo. -``` - -Whether or not you use the `TZID` param, make sure to only use JS `Date` objects that are -represented in UTC to avoid unexpected timezone offsets being applied, for example: - -```js -// WRONG: Will produce dates with TZ offsets added -new RRule({ - freq: RRule.MONTHLY, - dtstart: new Date(2018, 1, 1, 10, 30), - until: new Date(2018, 2, 31) -}).all() - -[ '2018-02-01T18:30:00.000Z', '2018-03-01T18:30:00.000Z' ] - -// RIGHT: Will produce dates with recurrences at the correct time -new RRule({ - freq: RRule.MONTHLY, - dtstart: new Date(Date.UTC(2018, 1, 1, 10, 30)), - until: new Date(Date.UTC(2018, 2, 31)) -}).all() - -[ '2018-02-01T10:30:00.000Z', '2018-03-01T10:30:00.000Z' ] -``` - -### API - -#### `RRule` Constructor - -```javascript -new RRule(options[, noCache=false]) -``` - -The `options` argument mostly corresponds to the properties defined for `RRULE` in the -iCalendar RFC. Only `freq` is required. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
OptionDescription
freq -

(required) One of the following constants:

-
    -
  • RRule.YEARLY
  • -
  • RRule.MONTHLY
  • -
  • RRule.WEEKLY
  • -
  • RRule.DAILY
  • -
  • RRule.HOURLY
  • -
  • RRule.MINUTELY
  • -
  • RRule.SECONDLY
  • -
-
dtstartThe recurrence start. Besides being the base for the - recurrence, missing parameters in the final recurrence - instances will also be extracted from this date. If not - given, new Date will be used instead. - **IMPORTANT:** See the discussion under timezone support -
intervalThe interval between each freq iteration. For example, - when using RRule.YEARLY, an interval of 2 means - once every - two years, but with RRule.HOURLY, it means once every two - hours. - The default interval is 1. -
wkstThe week start day. Must be one of the RRule.MO, - RRule.TU, RRule.WE constants, or an integer, - specifying - the first day of the week. This will affect recurrences based - on weekly periods. The default week start is RRule.MO. -
countHow many occurrences will be generated.
untilIf given, this must be a Date instance, that will specify - the limit of the recurrence. If a recurrence instance happens - to be the same as the Date instance given in the - until - argument, this will be the last occurrence. -
tzidIf given, this must be a string supported - by Luxon, and the Luxon library must be provided. See - discussion under Timezone support. -
bysetposIf given, it must be either an integer, or an array of - integers, positive or negative. Each given integer will specify - an occurrence number, corresponding to the nth occurrence of - the rule inside the frequency period. For example, a - bysetpos of -1 if combined with a RRule.MONTHLY - frequency, and a byweekday of (RRule.MO, RRule.TU, - RRule.WE, RRule.TH, RRule.FR), will result in - the last - work day of every month. -
bymonthIf given, it must be either an integer, or an array of - integers, meaning the months to apply the recurrence to. -
bymonthdayIf given, it must be either an integer, or an array of - integers, meaning the month days to apply the recurrence to. -
byyeardayIf given, it must be either an integer, or an array of - integers, meaning the year days to apply the recurrence to. -
byweeknoIf given, it must be either an integer, or an array of - integers, meaning the week numbers to apply the recurrence to. - Week numbers have the meaning described in ISO8601, that is, - the first week of the year is that containing at least four - days of the new year. -
byweekdayIf given, it must be either an integer (0 == RRule.MO), an - array of integers, one of the weekday constants - (RRule.MO, - RRule.TU, etc), or an array of these constants. When - given, - these variables will define the weekdays where the recurrence - will be applied. It's also possible to use an argument n for - the weekday instances, which will mean the nth occurrence of - this weekday in the period. For example, with - RRule.MONTHLY, - or with RRule.YEARLY and BYMONTH, using - RRule.FR.nth(+1) or RRule.FR.nth(-1) in byweekday - will specify the first or last friday of the month where the - recurrence happens. - Notice - that the RFC documentation, this is specified as BYDAY, - but was renamed to avoid the ambiguity of that argument. -
byhourIf given, it must be either an integer, or an array of - integers, meaning the hours to apply the recurrence to. -
byminuteIf given, it must be either an integer, or an array of - integers, meaning the minutes to apply the recurrence to. -
bysecondIf given, it must be either an integer, or an array of - integers, meaning the seconds to apply the recurrence to. -
byeasterThis is an extension to the RFC specification which the Python - implementation provides. - Not implemented in the JavaScript version. -
- - -`noCache`: Set to `true` to disable caching of results. If you will use the -same rrule instance multiple times, enabling caching will improve the -performance considerably. Enabled by default. - -See also [python-dateutil](http://labix.org/python-dateutil/) -documentation. - - -* * * * * - - -#### Instance properties - -
-
rule.options
-
Processed options applied to the rule. Includes default options - (such us wkstart). Currently, - rule.options.byweekday isn't equal - to rule.origOptions.byweekday (which is an inconsistency). -
-
rule.origOptions
-
The original options argument passed to - the constructor.
-
- - -* * * * * - - -#### Occurrence Retrieval Methods - -##### `RRule.prototype.all([iterator])` - -Returns all dates matching the rule. It is a replacement for the -iterator protocol this class implements in the Python version. - -As rules without `until` or `count` represent infinite date series, you -can optionally pass `iterator`, which is a function that is called for -each date matched by the rule. It gets two parameters `date` (the `Date` -instance being added), and `i` (zero-indexed position of `date` in the -result). Dates are being added to the result as long as the iterator -returns `true`. If a `false`-y value is returned, `date` isn't added to -the result and the iteration is interrupted (possibly prematurely). - -```javascript -rule.all() -[ '2012-02-01T10:30:00.000Z', - '2012-05-01T10:30:00.000Z', - '2012-07-01T10:30:00.000Z', - '2012-07-02T10:30:00.000Z' ] - -rule.all(function (date, i){return i < 2}) -[ '2012-02-01T10:30:00.000Z', - '2012-05-01T10:30:00.000Z' ] -``` - -##### `RRule.prototype.between(after, before, inc=false [, iterator])` - -Returns all the occurrences of the rrule between `after` and `before`. -The inc keyword defines what happens if `after` and/or `before` are -themselves occurrences. With `inc == true`, they will be included in the -list, if they are found in the recurrence set. - -Optional `iterator` has the same function as it has with -`RRule.prototype.all()`. - -```javascript -rule.between(new Date(Date.UTC(2012, 7, 1)), new Date(Date.UTC(2012, 8, 1))) -['2012-08-27T10:30:00.000Z', - '2012-08-31T10:30:00.000Z'] -``` - -##### `RRule.prototype.before(dt, inc=false)` - -Returns the last recurrence before the given `Date` instance. The `inc` -argument defines what happens if `dt` is an occurrence. With -`inc == true`, if `dt` itself is an occurrence, it will be returned. - - -##### `RRule.prototype.after(dt, inc=false)` - -Returns the first recurrence -after the given `Date` instance. The `inc` argument defines what happens -if `dt` is an occurrence. With `inc == true`, if `dt` itself is an -occurrence, it will be returned. - -See also [python-dateutil](http://labix.org/python-dateutil/) -documentation. - - -* * * * * - - -#### iCalendar RFC String Methods - -##### `RRule.prototype.toString()` - -Returns a string representation of the rule as per the iCalendar RFC. -Only properties explicitly specified in `options` are included: - -```javascript -rule.toString() -"DTSTART:20120201T093000Z\nRRULE:FREQ=WEEKLY;INTERVAL=5;UNTIL=20130130T230000Z;BYDAY=MO,FR" - -rule.toString() == RRule.optionsToString(rule.origOptions) -true -``` - -##### `RRule.optionsToString(options)` - -Converts `options` to iCalendar RFC `RRULE` string: - -```javascript -// Get full a string representation of all options, -// including the default and inferred ones. -RRule.optionsToString(rule.options) -"DTSTART:20120201T093000Z\nRRULE:FREQ=WEEKLY;INTERVAL=5;WKST=0;UNTIL=20130130T230000Z;BYDAY=MO,FR;BYHOUR=10;BYMINUTE=30;BYSECOND=0" - -// Cherry-pick only some options from an rrule: -RRule.optionsToString({ - freq: rule.options.freq, - dtstart: rule.options.dtstart -}) -"DTSTART:20120201T093000Z\nRRULE:FREQ=WEEKLY;" -``` - -##### `RRule.fromString(rfcString)` - -Constructs an `RRule` instance from a complete `rfcString`: - -```javascript -var rule = RRule.fromString("DTSTART:20120201T093000Z\nRRULE:FREQ=WEEKLY;") - -// This is equivalent -var rule = new RRule(RRule.parseString("DTSTART:20120201T093000Z\nRRULE:FREQ=WEEKLY")) -``` - -##### `RRule.parseString(rfcString)` - -Only parse RFC string and return `options`. - -```javascript -var options = RRule.parseString('FREQ=DAILY;INTERVAL=6') -options.dtstart = new Date(Date.UTC(2000, 1, 1)) -var rule = new RRule(options) -``` - -* * * * * - -#### Natural Language Text Methods - -These methods provide an incomplete support for text–`RRule` and -`RRule`–text conversion. You should test them with your input to see -whether the result is acceptable. - -##### `RRule.prototype.toText([gettext, [language]])` - -Returns a textual representation of `rule`. The `gettext` callback, if -provided, will be called for each text token and its return value used -instead. The optional `language` argument is a language definition to be -used (defaults to `rrule/nlp.js:ENGLISH`). - -```javascript -var rule = new RRule({ - freq: RRule.WEEKLY, - count: 23 -}) -rule.toText() -"every week for 23 times" -``` - -##### `RRule.prototype.isFullyConvertibleToText()` - -Provides a hint on whether all the options the rule has are convertible -to text. - -##### `RRule.fromText(text[, language])` - -Constructs an `RRule` instance from `text`. - -```javascript -rule = RRule.fromText('every day for 3 times') -``` - -##### `RRule.parseText(text[, language])` - -Parse `text` into `options`: - -```javascript -options = RRule.parseText('every day for 3 times') -// {freq: 3, count: "3"} -options.dtstart = new Date(Date.UTC(2000, 1, 1)) -var rule = new RRule(options) -``` - - -* * * * * - -#### `RRuleSet` Constructor - -```javascript -new RRuleSet([noCache=false]) -``` - -The RRuleSet instance allows more complex recurrence setups, mixing multiple - rules, dates, exclusion rules, and exclusion dates. - -Default `noCache` argument is `false`, caching of results will be enabled, -improving performance of multiple queries considerably. - -##### `RRuleSet.prototype.rrule(rrule)` - -Include the given rrule instance in the recurrence set generation. - -##### `RRuleSet.prototype.rdate(dt)` -Include the given datetime instance in the recurrence set generation. - -##### `RRuleSet.prototype.exrule(rrule)` -Include the given rrule instance in the recurrence set exclusion list. Dates -which are part of the given recurrence rules will not be generated, even if -some inclusive rrule or rdate matches them. NOTE: EXRULE has been (deprecated -in RFC 5545)[https://icalendar.org/iCalendar-RFC-5545/a-3-deprecated-features.html] -and does not support a DTSTART property. - -##### `RRuleSet.prototype.exdate(dt)` -Include the given datetime instance in the recurrence set exclusion list. Dates -included that way will not be generated, even if some inclusive rrule or -rdate matches them. - -##### `RRuleSet.prototype.tzid(tz?)` -Sets or overrides the timezone identifier. Useful if there are no rrules in this -RRuleSet and thus no DTSTART. - -##### `RRuleSet.prototype.all([iterator])` - -Same as `RRule.prototype.all`. - -##### `RRuleSet.prototype.between(after, before, inc=false [, iterator])` - -Same as `RRule.prototype.between`. - -##### `RRuleSet.prototype.before(dt, inc=false)` - -Same as `RRule.prototype.before`. - -##### `RRuleSet.prototype.after(dt, inc=false)` - -Same as `RRule.prototype.after`. - -##### `RRuleSet.prototype.rrules()` - -Get list of included rrules in this recurrence set. - -##### `RRuleSet.prototype.exrules()` - -Get list of excluded rrules in this recurrence set. - -##### `RRuleSet.prototype.rdates()` - -Get list of included datetimes in this recurrence set. - -##### `RRuleSet.prototype.exdates()` - -Get list of excluded datetimes in this recurrence set. - -* * * * * - -#### `rrulestr` Function - -```js -rrulestr(rruleStr[, options]) -``` - -The `rrulestr` function is a parser for RFC-like syntaxes. The string passed -as parameter may be a multiple line string, a single line string, or just the -RRULE property value. - -Additionally, it accepts the following keyword arguments: - -`cache` -If True, the rruleset or rrule created instance will cache its results. -Default is not to cache. - -`dtstart` -If given, it must be a datetime instance that will be used when no DTSTART -property is found in the parsed string. If it is not given, and the property -is not found, datetime.now() will be used instead. - -`unfold` -If set to True, lines will be unfolded following the RFC specification. It -defaults to False, meaning that spaces before every line will be stripped. - -`forceset` -If set to True a rruleset instance will be returned, even if only a single rule -is found. The default is to return an rrule if possible, and an rruleset if necessary. - -`compatible` -If set to True, the parser will operate in RFC-compatible mode. Right now it -means that unfold will be turned on, and if a DTSTART is found, it will be -considered the first recurrence instance, as documented in the RFC. - -`tzid` -If given, it must be a string that will be used when no `TZID` property is found -in the parsed string. If it is not given, and the property is not found, `'UTC'` -will be used by default. - - -* * * * * - -### Differences From iCalendar RFC - -* `RRule` has no `byday` keyword. The equivalent keyword has been replaced by -the `byweekday` keyword, to remove the ambiguity present in the original -keyword. -* Unlike documented in the RFC, the starting datetime, `dtstart`, is -not the first recurrence instance, unless it does fit in the specified rules. -This is in part due to this project being a port of -[python-dateutil](https://labix.org/python-dateutil#head-a65103993a21b717f6702063f3717e6e75b4ba66), -which has the same non-compliant functionality. Note that you can get the -original behavior by using a `RRuleSet` and adding the `dtstart` as an `rdate`. - -```javascript -var rruleSet = new RRuleSet() -var start = new Date(Date.UTC(2012, 1, 1, 10, 30)) - -// Add a rrule to rruleSet -rruleSet.rrule(new RRule({ - freq: RRule.MONTHLY, - count: 5, - dtstart: start -})) - -// Add a date to rruleSet -rruleSet.rdate(start) -``` - -* Unlike documented in the RFC, every keyword is valid on every frequency (the -RFC documents that `byweekno` is only valid on yearly frequencies, for example). - -### Development - -rrule.js is implemented in Typescript. It uses [JavaScript Standard Style](https://github.com/feross/standard) coding style. - -To run the code, checkout this repository and run: - -``` -$ yarn -``` - -To run the tests, run: - -``` -$ yarn test -``` - -To build files for distribution, run: - -``` -$ yarn build -``` - -#### Authors - -* [Jakub Roztocil](http://roztocil.co/) - ([@jakubroztocil](http://twitter.com/jakubroztocil)) -* Lars Schöning ([@lyschoening](http://twitter.com/lyschoening)) -* David Golightly ([@davigoli](http://twitter.com/davigoli)) - -Python `dateutil` is written by [Gustavo -Niemeyer](http://niemeyer.net/). - -See [LICENCE](https://github.com/jakubroztocil/rrule/blob/master/LICENCE) for -more details. - -[npm-url]: https://npmjs.org/package/rrule -[npm-image]: http://img.shields.io/npm/v/rrule.svg - -[ci-url]: https://github.com/jakubroztocil/rrule/actions -[ci-image]: https://github.com/jakubroztocil/rrule/workflows/Node%20CI/badge.svg - -[downloads-url]: https://npmjs.org/package/rrule -[downloads-image]: http://img.shields.io/npm/dm/rrule.svg?style=flat-square - -[js-standard-url]: https://github.com/feross/standard -[js-standard-image]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat - -[gitter-url]: https://gitter.im/rrule-js/Lobby -[gitter-image]: https://img.shields.io/gitter/room/nwjs/nw.js.svg - - -#### Related projects - -* https://rrules.com/ — RESTful API to get back occurrences of RRULEs that conform to RFC 5545. - +# rrule demo +`gh-pages` branch is permenently diverged from other branches to just host the demo. This way the released `rrule` package will not include demo content, and won't depend on `jQuery` + +## Steps to update demo +* In `package.json`, update version of `rrule` and version of the package to latest at https://www.npmjs.com/package/rrule +* Make any changes needed in `demo.ts` or `demo.ts` or `index.html` +* Run `yarn` then `yarn build` +* Commit changes (including changes in `dist` folder) +* Push/Merge changes to remote `gh-pages` and the demo page will be updated \ No newline at end of file diff --git a/bower.json b/bower.json deleted file mode 100644 index 01698de1..00000000 --- a/bower.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "name": "rrule", - "version": "2.3.0", - "description": "JavaScript library for working with recurrence rules for calendar dates.", - "homepage": "http://jakubroztocil.github.io/rrule/", - "keywords": [ - "dates", - "recurrences", - "calendar", - "icalendar", - "rfc" - ], - "repository": { - "type": "git", - "url": "git://github.com/jakubroztocil/rrule.git" - }, - "authors": [{ - "name": "Jakub Roztočil", - "homepage": "http://subtleapps.com/" - }, { - "name": "Lars Schöning" - }], - "main": "dist/es5/rrule.js", - "ignore": [ - "**/.*", - "node_modules", - "components" - ] -} diff --git a/codecov.yml b/codecov.yml deleted file mode 100644 index 9e0e8073..00000000 --- a/codecov.yml +++ /dev/null @@ -1,7 +0,0 @@ -ignore: - - "dist/" - - "test/" - - "demo/" - - "node_modules/" - - ".github/" - - "webpack.config.js" \ No newline at end of file diff --git a/demo/demo.css b/demo.css similarity index 100% rename from demo/demo.css rename to demo.css diff --git a/demo/demo.ts b/demo.ts similarity index 98% rename from demo/demo.ts rename to demo.ts index 8bd18cc2..39d479c5 100644 --- a/demo/demo.ts +++ b/demo.ts @@ -1,10 +1,10 @@ import * as $ from 'jquery' -import { RRule, Weekday, Options } from '../src/index' +import { RRule, Weekday, Options } from 'rrule' // Make library accessible to browser debuggers so users can try things out themselves // tslint:disable-next-line:no-duplicate-imports -import * as rruleExports from '../src/index' +import * as rruleExports from 'rrule' $.extend(window, rruleExports) const getDay = (i: number) => [ diff --git a/demo/index.html b/demo/index.html deleted file mode 100644 index 88067afb..00000000 --- a/demo/index.html +++ /dev/null @@ -1,586 +0,0 @@ - - - - - - rrule.js demo - - - - - -
-

- Code and docs -

-

- rrule.js demo

- -
-

- This is a demo and test app for - rrule.js, a JavaScript library for working with recurrence rules for calendar dates. -

- -
- -
-

Output

- - - - - - - - - - - - - - - - - - - - - -
- rule = - -

-          
- rule.origOptions - -

-          
- rule.toString() - -
-
- rule.toText() - - - - -
- rule.all() - -
-
-
- - -
-

Input

-
-
-
-

Options

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- freq - -
Frequency
-
-
- - - - - - - -
-
- dtstart - -
The recurrence start. Besides being the base for the recurrence, missing parameters in the final recurrence - instances will also be extracted from this date. If not given, - new Date will be used instead. -
-
-
- -
-
- tzid - -
The timezone for the rule. If present, all recurrences will be interpreted as being in the local time - of the given timezone. If not present, UTC will be used instead. -
-
-
- -
-
- until - -
If given, this must be a - Date - instance, that will specify the limit of the recurrence. If a recurrence instance happens to be the same as the - Date instance given in the - until - argument, this will be the last occurrence. -
-
-
- -
-
- count - -
How many occurrences will be generated. -
-
-
- -
-
- interval - -
The interval between each freq iteration. For example, when using - RRule.YEARLY, an interval of - 2 means once every two years, but with - RRule.HOURLY, it means once every two hours. The default interval is - 1. -
-
-
- -
-
- wkst - -
The week start day. Must be one of the - RRule.MO, - RRule.TU, - RRule.WE - constants, or an integer, specifying the first day of the week. This will affect recurrences based on weekly periods. The - default week start is - RRule.MO. -
-
-
- - - - - - - -
-
- byweekday - -
If given, it must be either an integer ( - 0 == RRule.MO), a sequence of integers, one of the weekday constants ( - RRule.MO, - RRule.TU, etc), or a sequence of these constants. When given, these variables will define - the weekdays where the recurrence will be applied. It's also possible to use an argument n for the - weekday instances, which will mean the nth occurrence of this weekday in the period. For example, - with - RRule.MONTHLY, or with - RRule.YEARLY and - BYMONTH, using - RRule.FR.clone(+1) in - byweekday will specify the first friday of the month where the recurrence happens. Notice - that the RFC documentation, this is specified as - BYDAY, but was renamed to avoid the ambiguity of that argument. -
-
-
- - - - - - - -
-
- bymonth - -
If given, it must be either an integer, or a sequence of integers, meaning the months to apply the - recurrence to. -
-
-
- - - - - - - - - - - - -
-
- bysetpos - -
If given, it must be either an integer, or a sequence of integers, positive or negative. Each given - integer will specify an occurrence number, corresponding to the nth occurrence of the rule inside - the frequency period. For example, a - bysetpos of - -1 if combined with a - RRule.MONTHLY - frequency, and a byweekday of ( - RRule.MO, - RRule.TU, - RRule.WE, - RRule.TH, - RRule.FR), will result in the last work day of every month. -
-
-
- -
-
- bymonthday - -
If given, it must be either an integer, or a sequence of integers, meaning the month days to apply - the recurrence to. -
-
-
- -
-
- byyearday - -
If given, it must be either an integer, or a sequence of integers, meaning the year days to apply the - recurrence to. -
-
-
- -
-
- byweekno - -
If given, it must be either an integer, or a sequence of integers, meaning the week numbers to apply - the recurrence to. Week numbers have the meaning described in ISO8601, that is, the first week of - the year is that containing at least four days of the new year. -
-
-
- -
-
- byhour - -
If given, it must be either an integer, or a sequence of integers, meaning the hours to apply the recurrence - to. -
-
-
- -
-
- byminute - -
If given, it must be either an integer, or a sequence of integers, meaning the minutes to apply the - recurrence to. -
-
-
- -
-
- bysecond - -
If given, it must be either an integer, or a sequence of integers, meaning the seconds to apply the - recurrence to. -
-
-
- -
-
- byeaster - -
- This is an extension to the RFC specification which the Python implementation provides. - Not implemented in the JavaScript version. - -
-
-
- -
-
-
- - -
-

- RRULE string

-

- -

-

- Enter an - RRULE as per - iCalendar RFC. -

-

Examples:

-
    -
  • - FREQ=WEEKLY;BYDAY=MO,WE -
  • -
  • - FREQ=MONTHLY;BYMONTHDAY=10,15;COUNT=20 -
  • -
  • - FREQ=DAILY;INTERVAL=3;COUNT=10 -
  • -
  • - FREQ=MONTHLY;BYDAY=-2FR;COUNT=7 -
  • -
-
- - - -
-

Text input

-

- -

-

Examples:

-
    -
  • - Every weekday -
  • -
  • - Every 2 weeks on Tuesday -
  • -
  • - Every week on Monday, Wednesday -
  • -
  • - Every month on the 2nd last Friday for 7 times -
  • -
  • - Every 6 months -
  • -
-
- - -
-
-
- - Fork me on GitHub - - - - diff --git a/dist/demo.d.ts.map b/dist/demo.d.ts.map index addfc44d..d4242ea5 100644 --- a/dist/demo.d.ts.map +++ b/dist/demo.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"demo.d.ts","sourceRoot":"","sources":["../../../demo/demo.ts"],"names":[],"mappings":""} \ No newline at end of file +{"version":3,"file":"demo.d.ts","sourceRoot":"","sources":["../demo.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/dist/demo.js b/dist/demo.js index 2e88938b..aee13748 100644 --- a/dist/demo.js +++ b/dist/demo.js @@ -1,32 +1,4 @@ -!function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=4)}([function(e,t,n){"use strict";n.d(t,"f",function(){return r}),n.d(t,"e",function(){return i}),n.d(t,"d",function(){return o}),n.d(t,"j",function(){return a}),n.d(t,"k",function(){return s}),n.d(t,"m",function(){return u}),n.d(t,"h",function(){return c}),n.d(t,"l",function(){return l}),n.d(t,"i",function(){return f}),n.d(t,"a",function(){return d}),n.d(t,"b",function(){return h}),n.d(t,"g",function(){return p}),n.d(t,"c",function(){return y});var r=function(e){return null!==e&&void 0!==e},i=function(e){return"number"==typeof e},o=Array.isArray,a=function(e,t){void 0===t&&(t=e),1===arguments.length&&(t=e,e=0);for(var n=[],r=e;r>=0,r.length>t?String(r):((t-=r.length)>n.length&&(n+=s(n,t/n.length)),n.slice(0,t)+String(r))}var l=function(e,t,n){var r=e.split(t);return n?r.slice(0,n).concat([r.slice(n).join(t)]):r},f=function(e,t){var n=e%t;return n*t<0?n+t:n},d=function(e,t){return{div:Math.floor(e/t),mod:f(e,t)}},h=function(e){return!r(e)||0===e.length},p=function(e){return!h(e)},y=function(e,t){return p(e)&&-1!==e.indexOf(t)}},function(e,t,n){"use strict";var r,i=n(0);!function(e){e.MONTH_DAYS=[31,28,31,30,31,30,31,31,30,31,30,31],e.ONE_DAY=864e5,e.MAXYEAR=9999,e.ORDINAL_BASE=new Date(Date.UTC(1970,0,1)),e.PY_WEEKDAYS=[6,0,1,2,3,4,5],e.getYearDay=function(t){var n=new Date(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate());return Math.ceil((n.valueOf()-new Date(t.getUTCFullYear(),0,1).valueOf())/e.ONE_DAY)+1},e.isLeapYear=function(e){return e%4==0&&e%100!=0||e%400==0},e.isDate=function(e){return e instanceof Date},e.isValidDate=function(t){return e.isDate(t)&&!isNaN(t.getTime())},e.tzOffset=function(e){return 60*e.getTimezoneOffset()*1e3},e.daysBetween=function(t,n){var r=t.getTime()-e.tzOffset(t)-(n.getTime()-e.tzOffset(n));return Math.round(r/e.ONE_DAY)},e.toOrdinal=function(t){return e.daysBetween(t,e.ORDINAL_BASE)},e.fromOrdinal=function(t){return new Date(e.ORDINAL_BASE.getTime()+t*e.ONE_DAY)},e.getMonthDays=function(t){var n=t.getUTCMonth();return 1===n&&e.isLeapYear(t.getUTCFullYear())?29:e.MONTH_DAYS[n]},e.getWeekday=function(t){return e.PY_WEEKDAYS[t.getUTCDay()]},e.monthRange=function(t,n){var r=new Date(Date.UTC(t,n,1));return[e.getWeekday(r),e.getMonthDays(r)]},e.combine=function(e,t){return t=t||e,new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()))},e.clone=function(e){return new Date(e.getTime())},e.cloneDates=function(t){for(var n=[],r=0;rthis.maxDate;if("between"===this.method){if(t)return!0;if(n)return!1}else if("before"===this.method){if(n)return!1}else if("after"===this.method)return!!t||(this.add(e),!1);return this.add(e)},e.prototype.add=function(e){return this._result.push(e),!0},e.prototype.getValue=function(){var e=this._result;switch(this.method){case"all":case"between":return e;case"before":case"after":default:return e.length?e[e.length-1]:null}},e.prototype.clone=function(){return new e(this.method,this.args)},e}(),u=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),c=function(e){function t(t,n,r){var i=e.call(this,t,n)||this;return i.iterator=r,i}return u(t,e),t.prototype.add=function(e){return!!this.iterator(e,this._result.length)&&(this._result.push(e),!0)},t}(s);function l(e){return e0?"+":"")+String(this.n)+e),e},e.prototype.getJsWeekday=function(){return 6===this.weekday?0:this.weekday+1},e}(),h=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),p=function(){function e(e,t,n,r){this.hour=e,this.minute=t,this.second=n,this.millisecond=r||0}return e.prototype.getHours=function(){return this.hour},e.prototype.getMinutes=function(){return this.minute},e.prototype.getSeconds=function(){return this.second},e.prototype.getMilliseconds=function(){return this.millisecond},e.prototype.getTime=function(){return 1e3*(60*this.hour*60+60*this.minute+this.second)+this.millisecond},e}(),y=function(e){function t(t,n,r,i,o,a,s){var u=e.call(this,i,o,a,s)||this;return u.year=t,u.month=n,u.day=r,u}return h(t,e),t.fromDate=function(e){return new this(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.valueOf()%1e3)},t.prototype.getWeekday=function(){return r.getWeekday(new Date(this.getTime()))},t.prototype.getTime=function(){return new Date(Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second,this.millisecond)).getTime()},t.prototype.getDay=function(){return this.day},t.prototype.getMonth=function(){return this.month},t.prototype.getYear=function(){return this.year},t.prototype.addYears=function(e){this.year+=e},t.prototype.addMonths=function(e){if(this.month+=e,this.month>12){var t=Math.floor(this.month/12),n=Object(i.i)(this.month,12);this.month=n,this.year+=t,0===this.month&&(this.month=12,--this.year)}},t.prototype.addWeekly=function(e,t){t>this.getWeekday()?this.day+=-(this.getWeekday()+1+(6-t))+7*e:this.day+=-(this.getWeekday()-t)+7*e,this.fixDay()},t.prototype.addDaily=function(e){this.day+=e,this.fixDay()},t.prototype.addHours=function(e,t,n){for(t&&(this.hour+=Math.floor((23-this.hour)/e)*e);;){this.hour+=e;var r=Object(i.a)(this.hour,24),o=r.div,a=r.mod;if(o&&(this.hour=a,this.addDaily(o)),Object(i.b)(n)||Object(i.c)(n,this.hour))break}},t.prototype.addMinutes=function(e,t,n,r){for(t&&(this.minute+=Math.floor((1439-(60*this.hour+this.minute))/e)*e);;){this.minute+=e;var o=Object(i.a)(this.minute,60),a=o.div,s=o.mod;if(a&&(this.minute=s,this.addHours(a,!1,n)),(Object(i.b)(n)||Object(i.c)(n,this.hour))&&(Object(i.b)(r)||Object(i.c)(r,this.minute)))break}},t.prototype.addSeconds=function(e,t,n,r,o){for(t&&(this.second+=Math.floor((86399-(3600*this.hour+60*this.minute+this.second))/e)*e);;){this.second+=e;var a=Object(i.a)(this.second,60),s=a.div,u=a.mod;if(s&&(this.second=u,this.addMinutes(s,!1,n,r)),(Object(i.b)(n)||Object(i.c)(n,this.hour))&&(Object(i.b)(r)||Object(i.c)(r,this.minute))&&(Object(i.b)(o)||Object(i.c)(o,this.second)))break}},t.prototype.fixDay=function(){if(!(this.day<=28)){var e=r.monthRange(this.year,this.month-1)[1];if(!(this.day<=e))for(;this.day>e;){if(this.day-=e,++this.month,13===this.month&&(this.month=1,++this.year,this.year>r.MAXYEAR))return;e=r.monthRange(this.year,this.month-1)[1]}}},t.prototype.add=function(e,t){var n=e.freq,r=e.interval,i=e.wkst,a=e.byhour,s=e.byminute,u=e.bysecond;switch(n){case o.YEARLY:return this.addYears(r);case o.MONTHLY:return this.addMonths(r);case o.WEEKLY:return this.addWeekly(r,i);case o.DAILY:return this.addDaily(r);case o.HOURLY:return this.addHours(r,t,a);case o.MINUTELY:return this.addMinutes(r,t,a,s);case o.SECONDLY:return this.addSeconds(r,t,a,s,u)}},t}(p);function m(e){var t=[],n={};if(Object.keys(e).forEach(function(r){var o=e[r];n[r]=o,Object(i.c)(re,r)||t.push(r),a.isDate(o)&&!a.isValidDate(o)&&t.push(r)}),t.length)throw new Error("Invalid options: "+t.join(", "));return n}var v=function(){return(v=Object.assign||function(e){for(var t,n=1,r=arguments.length;n=4?(d=0,r=f.yearlen+Object(i.i)(l-t.wkst,7)):r=s-d;for(var h=Math.floor(r/7),p=Object(i.i)(r,7),y=Math.floor(h+p/4),m=0;m0&&v<=y){var g=void 0;v>1?(g=d+7*(v-1),d!==n&&(g-=7-n)):g=d;for(var b=0;b<7&&(f.wnomask[g]=1,g++,f.wdaymask[g]!==t.wkst);b++);}}if(Object(i.c)(t.byweekno,1)){g=d+7*y;if(d!==n&&(g-=7-n),g=4?(x=0,O=T+Object(i.i)(k-t.wkst,7)):O=s-d,w=Math.floor(52+Object(i.i)(O,7)/4)}if(Object(i.c)(t.byweekno,w))for(g=0;g=ie.HOURLY&&Object(i.g)(o)&&!Object(i.c)(o,t.hour)||r>=ie.MINUTELY&&Object(i.g)(a)&&!Object(i.c)(a,t.minute)||r>=ie.SECONDLY&&Object(i.g)(s)&&!Object(i.c)(s,t.second))return[];return e.gettimeset(r)(t.hour,t.minute,t.second,t.millisecond)}(d,f,t);;){var m=d.getdayset(r)(f.year,f.month,f.day),v=m[0],g=m[1],b=m[2],w=Q(v,g,b,d,t);if(Object(i.g)(u))for(var k=$(u,h,g,b,d,v),x=0;xs)return K(e);if(T>=n){var O=X(T,t);if(!e.accept(O))return K(e);if(c&&!--c)return K(e)}}else for(x=g;xs)return K(e);if(T>=n){O=X(T,t);if(!e.accept(O))return K(e);if(c&&!--c)return K(e)}}}if(0===t.interval)return K(e);if(f.add(t,w),f.year>a.MAXYEAR)return K(e);l(r)||(h=d.gettimeset(r)(f.hour,f.minute,f.second,0)),d.rebuild(f.year,f.month)}}function G(e,t,n){var r=n.bymonth,o=n.byweekno,a=n.byweekday,s=n.byeaster,u=n.bymonthday,c=n.bynmonthday,l=n.byyearday;return Object(i.g)(r)&&!Object(i.c)(r,e.mmask[t])||Object(i.g)(o)&&!e.wnomask[t]||Object(i.g)(a)&&!Object(i.c)(a,e.wdaymask[t])||Object(i.g)(e.nwdaymask)&&!e.nwdaymask[t]||null!==s&&!Object(i.c)(e.eastermask,t)||(Object(i.g)(u)||Object(i.g)(c))&&!Object(i.c)(u,e.mdaymask[t])&&!Object(i.c)(c,e.nmdaymask[t])||Object(i.g)(l)&&(t=e.yearlen&&!Object(i.c)(l,t+1-e.yearlen)&&!Object(i.c)(l,-e.nextyearlen+t-e.yearlen))}function X(e,t){return new O(e,t.tzid).rezonedDate()}function K(e){return e.getValue()}function Q(e,t,n,r,i){for(var o=!1,a=t;a=-366&&u<=366))throw new Error("bysetpos must be between 1 and 366, or between -366 and -1")}if(!(Boolean(t.byweekno)||Object(i.g)(t.byweekno)||Object(i.g)(t.byyearday)||Boolean(t.bymonthday)||Object(i.g)(t.bymonthday)||Object(i.f)(t.byweekday)||Object(i.f)(t.byeaster)))switch(t.freq){case ie.YEARLY:t.bymonth||(t.bymonth=t.dtstart.getUTCMonth()+1),t.bymonthday=t.dtstart.getUTCDate();break;case ie.MONTHLY:t.bymonthday=t.dtstart.getUTCDate();break;case ie.WEEKLY:t.byweekday=[a.getWeekday(t.dtstart)]}if(Object(i.f)(t.bymonth)&&!Object(i.d)(t.bymonth)&&(t.bymonth=[t.bymonth]),Object(i.f)(t.byyearday)&&!Object(i.d)(t.byyearday)&&Object(i.e)(t.byyearday)&&(t.byyearday=[t.byyearday]),Object(i.f)(t.bymonthday))if(Object(i.d)(t.bymonthday)){var o=[],s=[];for(r=0;r0?o.push(u):u<0&&s.push(u)}t.bymonthday=o,t.bynmonthday=s}else t.bymonthday<0?(t.bynmonthday=[t.bymonthday],t.bymonthday=[]):(t.bynmonthday=[],t.bymonthday=[t.bymonthday]);else t.bymonthday=[],t.bynmonthday=[];if(Object(i.f)(t.byweekno)&&!Object(i.d)(t.byweekno)&&(t.byweekno=[t.byweekno]),Object(i.f)(t.byweekday))if(Object(i.e)(t.byweekday))t.byweekday=[t.byweekday],t.bynweekday=null;else if(t.byweekday instanceof d)!t.byweekday.n||t.freq>ie.MONTHLY?(t.byweekday=[t.byweekday.weekday],t.bynweekday=null):(t.bynweekday=[[t.byweekday.weekday,t.byweekday.n]],t.byweekday=null);else{var c=[],l=[];for(r=0;rie.MONTHLY?c.push(h.weekday):l.push([h.weekday,h.n])}}t.byweekday=Object(i.g)(c)?c:null,t.bynweekday=Object(i.g)(l)?l:null}else t.bynweekday=null;return Object(i.f)(t.byhour)?Object(i.e)(t.byhour)&&(t.byhour=[t.byhour]):t.byhour=t.freq - * Copyright (c) 2012 - Tomi Pieviläinen - * https://github.com/jakubroztocil/rrule/blob/master/LICENCE - * - */t.b=ie},function(e,t,n){var r; -/*! - * jQuery JavaScript Library v3.3.1 - * https://jquery.com/ - * - * Includes Sizzle.js - * https://sizzlejs.com/ - * - * Copyright JS Foundation and other contributors - * Released under the MIT license - * https://jquery.org/license - * - * Date: 2018-01-20T17:24Z - */ +!function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=1)}([function(e,t,n){var r; /*! * jQuery JavaScript Library v3.3.1 * https://jquery.com/ @@ -39,8 +11,7 @@ * https://jquery.org/license * * Date: 2018-01-20T17:24Z - */ -!function(t,n){"use strict";"object"==typeof e&&"object"==typeof e.exports?e.exports=t.document?n(t,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return n(e)}:n(t)}("undefined"!=typeof window?window:this,function(n,i){"use strict";var o=[],a=n.document,s=Object.getPrototypeOf,u=o.slice,c=o.concat,l=o.push,f=o.indexOf,d={},h=d.toString,p=d.hasOwnProperty,y=p.toString,m=y.call(Object),v={},g=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},b=function(e){return null!=e&&e===e.window},w={type:!0,src:!0,noModule:!0};function k(e,t,n){var r,i=(t=t||a).createElement("script");if(i.text=e,n)for(r in w)n[r]&&(i[r]=n[r]);t.head.appendChild(i).parentNode.removeChild(i)}function x(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?d[h.call(e)]||"object":typeof e}var T=function(e,t){return new T.fn.init(e,t)},O=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;function S(e){var t=!!e&&"length"in e&&e.length,n=x(e);return!g(e)&&!b(e)&&("array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e)}T.fn=T.prototype={jquery:"3.3.1",constructor:T,length:0,toArray:function(){return u.call(this)},get:function(e){return null==e?u.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=T.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return T.each(this,e)},map:function(e){return this.pushStack(T.map(this,function(t,n){return e.call(t,n,t)}))},slice:function(){return this.pushStack(u.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(n>=0&&n0&&t-1 in e)}T.fn=T.prototype={jquery:"3.3.1",constructor:T,length:0,toArray:function(){return u.call(this)},get:function(e){return null==e?u.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=T.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return T.each(this,e)},map:function(e){return this.pushStack(T.map(this,(function(t,n){return e.call(t,n,t)})))},slice:function(){return this.pushStack(u.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(n>=0&&n+~]|"+_+")"+_+"*"),z=new RegExp("="+_+"*([^\\]'\"]*?)"+_+"*\\]","g"),V=new RegExp(H),Z=new RegExp("^"+U+"$"),B={ID:new RegExp("^#("+U+")"),CLASS:new RegExp("^\\.("+U+")"),TAG:new RegExp("^("+U+"|[*])"),ATTR:new RegExp("^"+q),PSEUDO:new RegExp("^"+H),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+_+"*(even|odd|(([+-]|)(\\d*)n|)"+_+"*(?:([+-]|)"+_+"*(\\d+)|))"+_+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+_+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+_+"*((?:-\\d)?\\d*)"+_+"*\\)|)(?=[^-]|$)","i")},$=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,G=/^[^{]+\{\s*\[native \w/,X=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,K=/[+~]/,Q=new RegExp("\\\\([\\da-f]{1,6}"+_+"?|("+_+")|.)","ig"),ee=function(e,t,n){var r="0x"+t-65536;return r!=r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},te=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ne=function(e,t){return t?"\0"===e?"�":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},re=function(){d()},ie=ge(function(e){return!0===e.disabled&&("form"in e||"label"in e)},{dir:"parentNode",next:"legend"});try{A.apply(N=M.call(k.childNodes),k.childNodes),N[k.childNodes.length].nodeType}catch(e){A={apply:N.length?function(e,t){L.apply(e,M.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}function oe(e,t,r,i){var o,s,c,l,f,p,v,g=t&&t.ownerDocument,x=t?t.nodeType:9;if(r=r||[],"string"!=typeof e||!e||1!==x&&9!==x&&11!==x)return r;if(!i&&((t?t.ownerDocument||t:k)!==h&&d(t),t=t||h,y)){if(11!==x&&(f=X.exec(e)))if(o=f[1]){if(9===x){if(!(c=t.getElementById(o)))return r;if(c.id===o)return r.push(c),r}else if(g&&(c=g.getElementById(o))&&b(t,c)&&c.id===o)return r.push(c),r}else{if(f[2])return A.apply(r,t.getElementsByTagName(e)),r;if((o=f[3])&&n.getElementsByClassName&&t.getElementsByClassName)return A.apply(r,t.getElementsByClassName(o)),r}if(n.qsa&&!E[e+" "]&&(!m||!m.test(e))){if(1!==x)g=t,v=e;else if("object"!==t.nodeName.toLowerCase()){for((l=t.getAttribute("id"))?l=l.replace(te,ne):t.setAttribute("id",l=w),s=(p=a(e)).length;s--;)p[s]="#"+l+" "+ve(p[s]);v=p.join(","),g=K.test(e)&&ye(t.parentNode)||t}if(v)try{return A.apply(r,g.querySelectorAll(v)),r}catch(e){}finally{l===w&&t.removeAttribute("id")}}}return u(e.replace(F,"$1"),t,r,i)}function ae(){var e=[];return function t(n,i){return e.push(n+" ")>r.cacheLength&&delete t[e.shift()],t[n+" "]=i}}function se(e){return e[w]=!0,e}function ue(e){var t=h.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function ce(e,t){for(var n=e.split("|"),i=n.length;i--;)r.attrHandle[n[i]]=t}function le(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function fe(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function de(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function he(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&ie(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function pe(e){return se(function(t){return t=+t,se(function(n,r){for(var i,o=e([],n.length,t),a=o.length;a--;)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}function ye(e){return e&&void 0!==e.getElementsByTagName&&e}for(t in n=oe.support={},o=oe.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},d=oe.setDocument=function(e){var t,i,a=e?e.ownerDocument||e:k;return a!==h&&9===a.nodeType&&a.documentElement?(p=(h=a).documentElement,y=!o(h),k!==h&&(i=h.defaultView)&&i.top!==i&&(i.addEventListener?i.addEventListener("unload",re,!1):i.attachEvent&&i.attachEvent("onunload",re)),n.attributes=ue(function(e){return e.className="i",!e.getAttribute("className")}),n.getElementsByTagName=ue(function(e){return e.appendChild(h.createComment("")),!e.getElementsByTagName("*").length}),n.getElementsByClassName=G.test(h.getElementsByClassName),n.getById=ue(function(e){return p.appendChild(e).id=w,!h.getElementsByName||!h.getElementsByName(w).length}),n.getById?(r.filter.ID=function(e){var t=e.replace(Q,ee);return function(e){return e.getAttribute("id")===t}},r.find.ID=function(e,t){if(void 0!==t.getElementById&&y){var n=t.getElementById(e);return n?[n]:[]}}):(r.filter.ID=function(e){var t=e.replace(Q,ee);return function(e){var n=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}},r.find.ID=function(e,t){if(void 0!==t.getElementById&&y){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];for(i=t.getElementsByName(e),r=0;o=i[r++];)if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),r.find.TAG=n.getElementsByTagName?function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):n.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[i++];)1===n.nodeType&&r.push(n);return r}return o},r.find.CLASS=n.getElementsByClassName&&function(e,t){if(void 0!==t.getElementsByClassName&&y)return t.getElementsByClassName(e)},v=[],m=[],(n.qsa=G.test(h.querySelectorAll))&&(ue(function(e){p.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&m.push("[*^$]="+_+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||m.push("\\["+_+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+w+"-]").length||m.push("~="),e.querySelectorAll(":checked").length||m.push(":checked"),e.querySelectorAll("a#"+w+"+*").length||m.push(".#.+[+~]")}),ue(function(e){e.innerHTML="";var t=h.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&m.push("name"+_+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&m.push(":enabled",":disabled"),p.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&m.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),m.push(",.*:")})),(n.matchesSelector=G.test(g=p.matches||p.webkitMatchesSelector||p.mozMatchesSelector||p.oMatchesSelector||p.msMatchesSelector))&&ue(function(e){n.disconnectedMatch=g.call(e,"*"),g.call(e,"[s!='']:x"),v.push("!=",H)}),m=m.length&&new RegExp(m.join("|")),v=v.length&&new RegExp(v.join("|")),t=G.test(p.compareDocumentPosition),b=t||G.test(p.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},j=t?function(e,t){if(e===t)return f=!0,0;var r=!e.compareDocumentPosition-!t.compareDocumentPosition;return r||(1&(r=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!n.sortDetached&&t.compareDocumentPosition(e)===r?e===h||e.ownerDocument===k&&b(k,e)?-1:t===h||t.ownerDocument===k&&b(k,t)?1:l?I(l,e)-I(l,t):0:4&r?-1:1)}:function(e,t){if(e===t)return f=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e===h?-1:t===h?1:i?-1:o?1:l?I(l,e)-I(l,t):0;if(i===o)return le(e,t);for(n=e;n=n.parentNode;)a.unshift(n);for(n=t;n=n.parentNode;)s.unshift(n);for(;a[r]===s[r];)r++;return r?le(a[r],s[r]):a[r]===k?-1:s[r]===k?1:0},h):h},oe.matches=function(e,t){return oe(e,null,null,t)},oe.matchesSelector=function(e,t){if((e.ownerDocument||e)!==h&&d(e),t=t.replace(z,"='$1']"),n.matchesSelector&&y&&!E[t+" "]&&(!v||!v.test(t))&&(!m||!m.test(t)))try{var r=g.call(e,t);if(r||n.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(e){}return oe(t,h,null,[e]).length>0},oe.contains=function(e,t){return(e.ownerDocument||e)!==h&&d(e),b(e,t)},oe.attr=function(e,t){(e.ownerDocument||e)!==h&&d(e);var i=r.attrHandle[t.toLowerCase()],o=i&&D.call(r.attrHandle,t.toLowerCase())?i(e,t,!y):void 0;return void 0!==o?o:n.attributes||!y?e.getAttribute(t):(o=e.getAttributeNode(t))&&o.specified?o.value:null},oe.escape=function(e){return(e+"").replace(te,ne)},oe.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},oe.uniqueSort=function(e){var t,r=[],i=0,o=0;if(f=!n.detectDuplicates,l=!n.sortStable&&e.slice(0),e.sort(j),f){for(;t=e[o++];)t===e[o]&&(i=r.push(o));for(;i--;)e.splice(r[i],1)}return l=null,e},i=oe.getText=function(e){var t,n="",r=0,o=e.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=i(e)}else if(3===o||4===o)return e.nodeValue}else for(;t=e[r++];)n+=i(t);return n},(r=oe.selectors={cacheLength:50,createPseudo:se,match:B,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(Q,ee),e[3]=(e[3]||e[4]||e[5]||"").replace(Q,ee),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||oe.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&oe.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return B.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&V.test(n)&&(t=a(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(Q,ee).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=O[e+" "];return t||(t=new RegExp("(^|"+_+")"+e+"("+_+"|$)"))&&O(e,function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=oe.attr(r,e);return null==i?"!="===t:!t||(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i.replace(Y," ")+" ").indexOf(n)>-1:"|="===t&&(i===n||i.slice(0,n.length+1)===n+"-"))}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,u){var c,l,f,d,h,p,y=o!==a?"nextSibling":"previousSibling",m=t.parentNode,v=s&&t.nodeName.toLowerCase(),g=!u&&!s,b=!1;if(m){if(o){for(;y;){for(d=t;d=d[y];)if(s?d.nodeName.toLowerCase()===v:1===d.nodeType)return!1;p=y="only"===e&&!p&&"nextSibling"}return!0}if(p=[a?m.firstChild:m.lastChild],a&&g){for(b=(h=(c=(l=(f=(d=m)[w]||(d[w]={}))[d.uniqueID]||(f[d.uniqueID]={}))[e]||[])[0]===x&&c[1])&&c[2],d=h&&m.childNodes[h];d=++h&&d&&d[y]||(b=h=0)||p.pop();)if(1===d.nodeType&&++b&&d===t){l[e]=[x,h,b];break}}else if(g&&(b=h=(c=(l=(f=(d=t)[w]||(d[w]={}))[d.uniqueID]||(f[d.uniqueID]={}))[e]||[])[0]===x&&c[1]),!1===b)for(;(d=++h&&d&&d[y]||(b=h=0)||p.pop())&&((s?d.nodeName.toLowerCase()!==v:1!==d.nodeType)||!++b||(g&&((l=(f=d[w]||(d[w]={}))[d.uniqueID]||(f[d.uniqueID]={}))[e]=[x,b]),d!==t)););return(b-=i)===r||b%r==0&&b/r>=0}}},PSEUDO:function(e,t){var n,i=r.pseudos[e]||r.setFilters[e.toLowerCase()]||oe.error("unsupported pseudo: "+e);return i[w]?i(t):i.length>1?(n=[e,e,"",t],r.setFilters.hasOwnProperty(e.toLowerCase())?se(function(e,n){for(var r,o=i(e,t),a=o.length;a--;)e[r=I(e,o[a])]=!(n[r]=o[a])}):function(e){return i(e,0,n)}):i}},pseudos:{not:se(function(e){var t=[],n=[],r=s(e.replace(F,"$1"));return r[w]?se(function(e,t,n,i){for(var o,a=r(e,null,i,[]),s=e.length;s--;)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),t[0]=null,!n.pop()}}),has:se(function(e){return function(t){return oe(e,t).length>0}}),contains:se(function(e){return e=e.replace(Q,ee),function(t){return(t.textContent||t.innerText||i(t)).indexOf(e)>-1}}),lang:se(function(e){return Z.test(e||"")||oe.error("unsupported lang: "+e),e=e.replace(Q,ee).toLowerCase(),function(t){var n;do{if(n=y?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===p},focus:function(e){return e===h.activeElement&&(!h.hasFocus||h.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:he(!1),disabled:he(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!r.pseudos.empty(e)},header:function(e){return J.test(e.nodeName)},input:function(e){return $.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:pe(function(){return[0]}),last:pe(function(e,t){return[t-1]}),eq:pe(function(e,t,n){return[n<0?n+t:n]}),even:pe(function(e,t){for(var n=0;n=0;)e.push(r);return e}),gt:pe(function(e,t,n){for(var r=n<0?n+t:n;++r1?function(t,n,r){for(var i=e.length;i--;)if(!e[i](t,n,r))return!1;return!0}:e[0]}function we(e,t,n,r,i){for(var o,a=[],s=0,u=e.length,c=null!=t;s-1&&(o[c]=!(a[c]=f))}}else v=we(v===a?v.splice(p,v.length):v),i?i(null,a,v,u):A.apply(a,v)})}function xe(e){for(var t,n,i,o=e.length,a=r.relative[e[0].type],s=a||r.relative[" "],u=a?1:0,l=ge(function(e){return e===t},s,!0),f=ge(function(e){return I(t,e)>-1},s,!0),d=[function(e,n,r){var i=!a&&(r||n!==c)||((t=n).nodeType?l(e,n,r):f(e,n,r));return t=null,i}];u1&&be(d),u>1&&ve(e.slice(0,u-1).concat({value:" "===e[u-2].type?"*":""})).replace(F,"$1"),n,u0,i=e.length>0,o=function(o,a,s,u,l){var f,p,m,v=0,g="0",b=o&&[],w=[],k=c,T=o||i&&r.find.TAG("*",l),O=x+=null==k?1:Math.random()||.1,S=T.length;for(l&&(c=a===h||a||l);g!==S&&null!=(f=T[g]);g++){if(i&&f){for(p=0,a||f.ownerDocument===h||(d(f),s=!y);m=e[p++];)if(m(f,a||h,s)){u.push(f);break}l&&(x=O)}n&&((f=!m&&f)&&v--,o&&b.push(f))}if(v+=g,n&&g!==v){for(p=0;m=t[p++];)m(b,w,a,s);if(o){if(v>0)for(;g--;)b[g]||w[g]||(w[g]=C.call(u));w=we(w)}A.apply(u,w),l&&!o&&w.length>0&&v+t.length>1&&oe.uniqueSort(u)}return l&&(x=O,c=k),b};return n?se(o):o}(o,i))).selector=e}return s},u=oe.select=function(e,t,n,i){var o,u,c,l,f,d="function"==typeof e&&e,h=!i&&a(e=d.selector||e);if(n=n||[],1===h.length){if((u=h[0]=h[0].slice(0)).length>2&&"ID"===(c=u[0]).type&&9===t.nodeType&&y&&r.relative[u[1].type]){if(!(t=(r.find.ID(c.matches[0].replace(Q,ee),t)||[])[0]))return n;d&&(t=t.parentNode),e=e.slice(u.shift().value.length)}for(o=B.needsContext.test(e)?0:u.length;o--&&(c=u[o],!r.relative[l=c.type]);)if((f=r.find[l])&&(i=f(c.matches[0].replace(Q,ee),K.test(u[0].type)&&ye(t.parentNode)||t))){if(u.splice(o,1),!(e=i.length&&ve(u)))return A.apply(n,i),n;break}}return(d||s(e,h))(i,t,!y,n,!t||K.test(e)&&ye(t.parentNode)||t),n},n.sortStable=w.split("").sort(j).join("")===w,n.detectDuplicates=!!f,d(),n.sortDetached=ue(function(e){return 1&e.compareDocumentPosition(h.createElement("fieldset"))}),ue(function(e){return e.innerHTML="","#"===e.firstChild.getAttribute("href")})||ce("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),n.attributes&&ue(function(e){return e.innerHTML="",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||ce("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),ue(function(e){return null==e.getAttribute("disabled")})||ce(R,function(e,t,n){var r;if(!n)return!0===e[t]?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),oe}(n);T.find=E,T.expr=E.selectors,T.expr[":"]=T.expr.pseudos,T.uniqueSort=T.unique=E.uniqueSort,T.text=E.getText,T.isXMLDoc=E.isXML,T.contains=E.contains,T.escapeSelector=E.escape;var j=function(e,t,n){for(var r=[],i=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(i&&T(e).is(n))break;r.push(e)}return r},D=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},N=T.expr.match.needsContext;function C(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}var L=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function A(e,t,n){return g(t)?T.grep(e,function(e,r){return!!t.call(e,r,e)!==n}):t.nodeType?T.grep(e,function(e){return e===t!==n}):"string"!=typeof t?T.grep(e,function(e){return f.call(t,e)>-1!==n}):T.filter(t,e,n)}T.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?T.find.matchesSelector(r,e)?[r]:[]:T.find.matches(e,T.grep(t,function(e){return 1===e.nodeType}))},T.fn.extend({find:function(e){var t,n,r=this.length,i=this;if("string"!=typeof e)return this.pushStack(T(e).filter(function(){for(t=0;t1?T.uniqueSort(n):n},filter:function(e){return this.pushStack(A(this,e||[],!1))},not:function(e){return this.pushStack(A(this,e||[],!0))},is:function(e){return!!A(this,"string"==typeof e&&N.test(e)?T(e):e||[],!1).length}});var M,I=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(T.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||M,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:I.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof T?t[0]:t,T.merge(this,T.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:a,!0)),L.test(r[1])&&T.isPlainObject(t))for(r in t)g(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=a.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):g(e)?void 0!==n.ready?n.ready(e):e(T):T.makeArray(e,this)}).prototype=T.fn,M=T(a);var R=/^(?:parents|prev(?:Until|All))/,_={children:!0,contents:!0,next:!0,prev:!0};function U(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}T.fn.extend({has:function(e){var t=T(e,this),n=t.length;return this.filter(function(){for(var e=0;e-1:1===n.nodeType&&T.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(o.length>1?T.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?f.call(T(e),this[0]):f.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(T.uniqueSort(T.merge(this.get(),T(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),T.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return j(e,"parentNode")},parentsUntil:function(e,t,n){return j(e,"parentNode",n)},next:function(e){return U(e,"nextSibling")},prev:function(e){return U(e,"previousSibling")},nextAll:function(e){return j(e,"nextSibling")},prevAll:function(e){return j(e,"previousSibling")},nextUntil:function(e,t,n){return j(e,"nextSibling",n)},prevUntil:function(e,t,n){return j(e,"previousSibling",n)},siblings:function(e){return D((e.parentNode||{}).firstChild,e)},children:function(e){return D(e.firstChild)},contents:function(e){return C(e,"iframe")?e.contentDocument:(C(e,"template")&&(e=e.content||e),T.merge([],e.childNodes))}},function(e,t){T.fn[e]=function(n,r){var i=T.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=T.filter(r,i)),this.length>1&&(_[e]||T.uniqueSort(i),R.test(e)&&i.reverse()),this.pushStack(i)}});var q=/[^\x20\t\r\n\f]+/g;function H(e){return e}function Y(e){throw e}function F(e,t,n,r){var i;try{e&&g(i=e.promise)?i.call(e).done(t).fail(n):e&&g(i=e.then)?i.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}T.Callbacks=function(e){e="string"==typeof e?function(e){var t={};return T.each(e.match(q)||[],function(e,n){t[n]=!0}),t}(e):T.extend({},e);var t,n,r,i,o=[],a=[],s=-1,u=function(){for(i=i||e.once,r=t=!0;a.length;s=-1)for(n=a.shift();++s-1;)o.splice(n,1),n<=s&&s--}),this},has:function(e){return e?T.inArray(e,o)>-1:o.length>0},empty:function(){return o&&(o=[]),this},disable:function(){return i=a=[],o=n="",this},disabled:function(){return!o},lock:function(){return i=a=[],n||t||(o=n=""),this},locked:function(){return!!i},fireWith:function(e,n){return i||(n=[e,(n=n||[]).slice?n.slice():n],a.push(n),t||u()),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!r}};return c},T.extend({Deferred:function(e){var t=[["notify","progress",T.Callbacks("memory"),T.Callbacks("memory"),2],["resolve","done",T.Callbacks("once memory"),T.Callbacks("once memory"),0,"resolved"],["reject","fail",T.Callbacks("once memory"),T.Callbacks("once memory"),1,"rejected"]],r="pending",i={state:function(){return r},always:function(){return o.done(arguments).fail(arguments),this},catch:function(e){return i.then(null,e)},pipe:function(){var e=arguments;return T.Deferred(function(n){T.each(t,function(t,r){var i=g(e[r[4]])&&e[r[4]];o[r[1]](function(){var e=i&&i.apply(this,arguments);e&&g(e.promise)?e.promise().progress(n.notify).done(n.resolve).fail(n.reject):n[r[0]+"With"](this,i?[e]:arguments)})}),e=null}).promise()},then:function(e,r,i){var o=0;function a(e,t,r,i){return function(){var s=this,u=arguments,c=function(){var n,c;if(!(e=o&&(r!==Y&&(s=void 0,u=[n]),t.rejectWith(s,u))}};e?l():(T.Deferred.getStackHook&&(l.stackTrace=T.Deferred.getStackHook()),n.setTimeout(l))}}return T.Deferred(function(n){t[0][3].add(a(0,n,g(i)?i:H,n.notifyWith)),t[1][3].add(a(0,n,g(e)?e:H)),t[2][3].add(a(0,n,g(r)?r:Y))}).promise()},promise:function(e){return null!=e?T.extend(e,i):i}},o={};return T.each(t,function(e,n){var a=n[2],s=n[5];i[n[1]]=a.add,s&&a.add(function(){r=s},t[3-e][2].disable,t[3-e][3].disable,t[0][2].lock,t[0][3].lock),a.add(n[3].fire),o[n[0]]=function(){return o[n[0]+"With"](this===o?void 0:this,arguments),this},o[n[0]+"With"]=a.fireWith}),i.promise(o),e&&e.call(o,o),o},when:function(e){var t=arguments.length,n=t,r=Array(n),i=u.call(arguments),o=T.Deferred(),a=function(e){return function(n){r[e]=this,i[e]=arguments.length>1?u.call(arguments):n,--t||o.resolveWith(r,i)}};if(t<=1&&(F(e,o.done(a(n)).resolve,o.reject,!t),"pending"===o.state()||g(i[n]&&i[n].then)))return o.then();for(;n--;)F(i[n],a(n),o.reject);return o.promise()}});var W=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;T.Deferred.exceptionHook=function(e,t){n.console&&n.console.warn&&e&&W.test(e.name)&&n.console.warn("jQuery.Deferred exception: "+e.message,e.stack,t)},T.readyException=function(e){n.setTimeout(function(){throw e})};var P=T.Deferred();function z(){a.removeEventListener("DOMContentLoaded",z),n.removeEventListener("load",z),T.ready()}T.fn.ready=function(e){return P.then(e).catch(function(e){T.readyException(e)}),this},T.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--T.readyWait:T.isReady)||(T.isReady=!0,!0!==e&&--T.readyWait>0||P.resolveWith(a,[T]))}}),T.ready.then=P.then,"complete"===a.readyState||"loading"!==a.readyState&&!a.documentElement.doScroll?n.setTimeout(T.ready):(a.addEventListener("DOMContentLoaded",z),n.addEventListener("load",z));var V=function(e,t,n,r,i,o,a){var s=0,u=e.length,c=null==n;if("object"===x(n))for(s in i=!0,n)V(e,t,s,n[s],!0,o,a);else if(void 0!==r&&(i=!0,g(r)||(a=!0),c&&(a?(t.call(e,r),t=null):(c=t,t=function(e,t,n){return c.call(T(e),n)})),t))for(;s1,null,!0)},removeData:function(e){return this.each(function(){Q.remove(this,e)})}}),T.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=K.get(e,t),n&&(!r||Array.isArray(n)?r=K.access(e,t,T.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=T.queue(e,t),r=n.length,i=n.shift(),o=T._queueHooks(e,t);"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,function(){T.dequeue(e,t)},o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return K.get(e,n)||K.access(e,n,{empty:T.Callbacks("once memory").add(function(){K.remove(e,[t+"queue",n])})})}}),T.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length\x20\t\r\n\f]+)/i,pe=/^$|^module$|\/(?:java|ecma)script/i,ye={option:[1,""],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function me(e,t){var n;return n=void 0!==e.getElementsByTagName?e.getElementsByTagName(t||"*"):void 0!==e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&C(e,t)?T.merge([e],n):n}function ve(e,t){for(var n=0,r=e.length;n-1)i&&i.push(o);else if(c=T.contains(o.ownerDocument,o),a=me(f.appendChild(o),"script"),c&&ve(a),n)for(l=0;o=a[l++];)pe.test(o.type||"")&&n.push(o);return f}!function(){var e=a.createDocumentFragment().appendChild(a.createElement("div")),t=a.createElement("input");t.setAttribute("type","radio"),t.setAttribute("checked","checked"),t.setAttribute("name","t"),e.appendChild(t),v.checkClone=e.cloneNode(!0).cloneNode(!0).lastChild.checked,e.innerHTML="",v.noCloneChecked=!!e.cloneNode(!0).lastChild.defaultValue}();var we=a.documentElement,ke=/^key/,xe=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Te=/^([^.]*)(?:\.(.+)|)/;function Oe(){return!0}function Se(){return!1}function Ee(){try{return a.activeElement}catch(e){}}function je(e,t,n,r,i,o){var a,s;if("object"==typeof t){for(s in"string"!=typeof n&&(r=r||n,n=void 0),t)je(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=Se;else if(!i)return e;return 1===o&&(a=i,(i=function(e){return T().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=T.guid++)),e.each(function(){T.event.add(this,t,i,r,n)})}T.event={global:{},add:function(e,t,n,r,i){var o,a,s,u,c,l,f,d,h,p,y,m=K.get(e);if(m)for(n.handler&&(n=(o=n).handler,i=o.selector),i&&T.find.matchesSelector(we,i),n.guid||(n.guid=T.guid++),(u=m.events)||(u=m.events={}),(a=m.handle)||(a=m.handle=function(t){return void 0!==T&&T.event.triggered!==t.type?T.event.dispatch.apply(e,arguments):void 0}),c=(t=(t||"").match(q)||[""]).length;c--;)h=y=(s=Te.exec(t[c])||[])[1],p=(s[2]||"").split(".").sort(),h&&(f=T.event.special[h]||{},h=(i?f.delegateType:f.bindType)||h,f=T.event.special[h]||{},l=T.extend({type:h,origType:y,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&T.expr.match.needsContext.test(i),namespace:p.join(".")},o),(d=u[h])||((d=u[h]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(e,r,p,a)||e.addEventListener&&e.addEventListener(h,a)),f.add&&(f.add.call(e,l),l.handler.guid||(l.handler.guid=n.guid)),i?d.splice(d.delegateCount++,0,l):d.push(l),T.event.global[h]=!0)},remove:function(e,t,n,r,i){var o,a,s,u,c,l,f,d,h,p,y,m=K.hasData(e)&&K.get(e);if(m&&(u=m.events)){for(c=(t=(t||"").match(q)||[""]).length;c--;)if(h=y=(s=Te.exec(t[c])||[])[1],p=(s[2]||"").split(".").sort(),h){for(f=T.event.special[h]||{},d=u[h=(r?f.delegateType:f.bindType)||h]||[],s=s[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=d.length;o--;)l=d[o],!i&&y!==l.origType||n&&n.guid!==l.guid||s&&!s.test(l.namespace)||r&&r!==l.selector&&("**"!==r||!l.selector)||(d.splice(o,1),l.selector&&d.delegateCount--,f.remove&&f.remove.call(e,l));a&&!d.length&&(f.teardown&&!1!==f.teardown.call(e,p,m.handle)||T.removeEvent(e,h,m.handle),delete u[h])}else for(h in u)T.event.remove(e,h+t[c],n,r,!0);T.isEmptyObject(u)&&K.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,o,a,s=T.event.fix(e),u=new Array(arguments.length),c=(K.get(this,"events")||{})[s.type]||[],l=T.event.special[s.type]||{};for(u[0]=s,t=1;t=1))for(;c!==this;c=c.parentNode||this)if(1===c.nodeType&&("click"!==e.type||!0!==c.disabled)){for(o=[],a={},n=0;n-1:T.find(i,this,null,[c]).length),a[i]&&o.push(r);o.length&&s.push({elem:c,handlers:o})}return c=this,u\x20\t\r\n\f]*)[^>]*)\/>/gi,Ne=/\s*$/g;function Ae(e,t){return C(e,"table")&&C(11!==t.nodeType?t:t.firstChild,"tr")&&T(e).children("tbody")[0]||e}function Me(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function Ie(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Re(e,t){var n,r,i,o,a,s,u,c;if(1===t.nodeType){if(K.hasData(e)&&(o=K.access(e),a=K.set(t,o),c=o.events))for(i in delete a.handle,a.events={},c)for(n=0,r=c[i].length;n1&&"string"==typeof p&&!v.checkClone&&Ce.test(p))return e.each(function(i){var o=e.eq(i);y&&(t[0]=p.call(this,i,o.html())),Ue(o,t,n,r)});if(d&&(o=(i=be(t,e[0].ownerDocument,!1,e,r)).firstChild,1===i.childNodes.length&&(i=o),o||r)){for(s=(a=T.map(me(i,"script"),Me)).length;f")},clone:function(e,t,n){var r,i,o,a,s=e.cloneNode(!0),u=T.contains(e.ownerDocument,e);if(!(v.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||T.isXMLDoc(e)))for(a=me(s),r=0,i=(o=me(e)).length;r0&&ve(a,!u&&me(e,"script")),s},cleanData:function(e){for(var t,n,r,i=T.event.special,o=0;void 0!==(n=e[o]);o++)if(G(n)){if(t=n[K.expando]){if(t.events)for(r in t.events)i[r]?T.event.remove(n,r):T.removeEvent(n,r,t.handle);n[K.expando]=void 0}n[Q.expando]&&(n[Q.expando]=void 0)}}}),T.fn.extend({detach:function(e){return qe(this,e,!0)},remove:function(e){return qe(this,e)},text:function(e){return V(this,function(e){return void 0===e?T.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)})},null,e,arguments.length)},append:function(){return Ue(this,arguments,function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Ae(this,e).appendChild(e)})},prepend:function(){return Ue(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Ae(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return Ue(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return Ue(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(T.cleanData(me(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return T.clone(this,e,t)})},html:function(e){return V(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!Ne.test(e)&&!ye[(he.exec(e)||["",""])[1].toLowerCase()]){e=T.htmlPrefilter(e);try{for(;n=0&&(u+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-o-u-s-.5))),u}function Qe(e,t,n){var r=Ye(e),i=We(e,t,r),o="border-box"===T.css(e,"boxSizing",!1,r),a=o;if(He.test(i)){if(!n)return i;i="auto"}return a=a&&(v.boxSizingReliable()||i===e.style[t]),("auto"===i||!parseFloat(i)&&"inline"===T.css(e,"display",!1,r))&&(i=e["offset"+t[0].toUpperCase()+t.slice(1)],a=!0),(i=parseFloat(i)||0)+Ke(e,t,n||(o?"border":"content"),a,r,i)+"px"}function et(e,t,n,r,i){return new et.prototype.init(e,t,n,r,i)}T.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=We(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,a,s=J(t),u=Ve.test(t),c=e.style;if(u||(t=Ge(s)),a=T.cssHooks[t]||T.cssHooks[s],void 0===n)return a&&"get"in a&&void 0!==(i=a.get(e,!1,r))?i:c[t];"string"===(o=typeof n)&&(i=ie.exec(n))&&i[1]&&(n=ue(e,t,i),o="number"),null!=n&&n==n&&("number"===o&&(n+=i&&i[3]||(T.cssNumber[s]?"":"px")),v.clearCloneStyle||""!==n||0!==t.indexOf("background")||(c[t]="inherit"),a&&"set"in a&&void 0===(n=a.set(e,n,r))||(u?c.setProperty(t,n):c[t]=n))}},css:function(e,t,n,r){var i,o,a,s=J(t);return Ve.test(t)||(t=Ge(s)),(a=T.cssHooks[t]||T.cssHooks[s])&&"get"in a&&(i=a.get(e,!0,n)),void 0===i&&(i=We(e,t,r)),"normal"===i&&t in Be&&(i=Be[t]),""===n||n?(o=parseFloat(i),!0===n||isFinite(o)?o||0:i):i}}),T.each(["height","width"],function(e,t){T.cssHooks[t]={get:function(e,n,r){if(n)return!ze.test(T.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?Qe(e,t,r):se(e,Ze,function(){return Qe(e,t,r)})},set:function(e,n,r){var i,o=Ye(e),a="border-box"===T.css(e,"boxSizing",!1,o),s=r&&Ke(e,t,r,a,o);return a&&v.scrollboxSize()===o.position&&(s-=Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-parseFloat(o[t])-Ke(e,t,"border",!1,o)-.5)),s&&(i=ie.exec(n))&&"px"!==(i[3]||"px")&&(e.style[t]=n,n=T.css(e,t)),Xe(0,n,s)}}}),T.cssHooks.marginLeft=Pe(v.reliableMarginLeft,function(e,t){if(t)return(parseFloat(We(e,"marginLeft"))||e.getBoundingClientRect().left-se(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+"px"}),T.each({margin:"",padding:"",border:"Width"},function(e,t){T.cssHooks[e+t]={expand:function(n){for(var r=0,i={},o="string"==typeof n?n.split(" "):[n];r<4;r++)i[e+oe[r]+t]=o[r]||o[r-2]||o[0];return i}},"margin"!==e&&(T.cssHooks[e+t].set=Xe)}),T.fn.extend({css:function(e,t){return V(this,function(e,t,n){var r,i,o={},a=0;if(Array.isArray(t)){for(r=Ye(e),i=t.length;a1)}}),T.Tween=et,et.prototype={constructor:et,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||T.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(T.cssNumber[n]?"":"px")},cur:function(){var e=et.propHooks[this.prop];return e&&e.get?e.get(this):et.propHooks._default.get(this)},run:function(e){var t,n=et.propHooks[this.prop];return this.options.duration?this.pos=t=T.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):et.propHooks._default.set(this),this}},et.prototype.init.prototype=et.prototype,et.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=T.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){T.fx.step[e.prop]?T.fx.step[e.prop](e):1!==e.elem.nodeType||null==e.elem.style[T.cssProps[e.prop]]&&!T.cssHooks[e.prop]?e.elem[e.prop]=e.now:T.style(e.elem,e.prop,e.now+e.unit)}}},et.propHooks.scrollTop=et.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},T.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},T.fx=et.prototype.init,T.fx.step={};var tt,nt,rt=/^(?:toggle|show|hide)$/,it=/queueHooks$/;function ot(){nt&&(!1===a.hidden&&n.requestAnimationFrame?n.requestAnimationFrame(ot):n.setTimeout(ot,T.fx.interval),T.fx.tick())}function at(){return n.setTimeout(function(){tt=void 0}),tt=Date.now()}function st(e,t){var n,r=0,i={height:e};for(t=t?1:0;r<4;r+=2-t)i["margin"+(n=oe[r])]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function ut(e,t,n){for(var r,i=(ct.tweeners[t]||[]).concat(ct.tweeners["*"]),o=0,a=i.length;o1)},removeAttr:function(e){return this.each(function(){T.removeAttr(this,e)})}}),T.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return void 0===e.getAttribute?T.prop(e,t,n):(1===o&&T.isXMLDoc(e)||(i=T.attrHooks[t.toLowerCase()]||(T.expr.match.bool.test(t)?lt:void 0)),void 0!==n?null===n?void T.removeAttr(e,t):i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(r=i.get(e,t))?r:null==(r=T.find.attr(e,t))?void 0:r)},attrHooks:{type:{set:function(e,t){if(!v.radioValue&&"radio"===t&&C(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r=0,i=t&&t.match(q);if(i&&1===e.nodeType)for(;n=i[r++];)e.removeAttribute(n)}}),lt={set:function(e,t,n){return!1===t?T.removeAttr(e,n):e.setAttribute(n,n),n}},T.each(T.expr.match.bool.source.match(/\w+/g),function(e,t){var n=ft[t]||T.find.attr;ft[t]=function(e,t,r){var i,o,a=t.toLowerCase();return r||(o=ft[a],ft[a]=i,i=null!=n(e,t,r)?a:null,ft[a]=o),i}});var dt=/^(?:input|select|textarea|button)$/i,ht=/^(?:a|area)$/i;function pt(e){return(e.match(q)||[]).join(" ")}function yt(e){return e.getAttribute&&e.getAttribute("class")||""}function mt(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(q)||[]}T.fn.extend({prop:function(e,t){return V(this,T.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each(function(){delete this[T.propFix[e]||e]})}}),T.extend({prop:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&T.isXMLDoc(e)||(t=T.propFix[t]||t,i=T.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=T.find.attr(e,"tabindex");return t?parseInt(t,10):dt.test(e.nodeName)||ht.test(e.nodeName)&&e.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),v.optSelected||(T.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),T.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){T.propFix[this.toLowerCase()]=this}),T.fn.extend({addClass:function(e){var t,n,r,i,o,a,s,u=0;if(g(e))return this.each(function(t){T(this).addClass(e.call(this,t,yt(this)))});if((t=mt(e)).length)for(;n=this[u++];)if(i=yt(n),r=1===n.nodeType&&" "+pt(i)+" "){for(a=0;o=t[a++];)r.indexOf(" "+o+" ")<0&&(r+=o+" ");i!==(s=pt(r))&&n.setAttribute("class",s)}return this},removeClass:function(e){var t,n,r,i,o,a,s,u=0;if(g(e))return this.each(function(t){T(this).removeClass(e.call(this,t,yt(this)))});if(!arguments.length)return this.attr("class","");if((t=mt(e)).length)for(;n=this[u++];)if(i=yt(n),r=1===n.nodeType&&" "+pt(i)+" "){for(a=0;o=t[a++];)for(;r.indexOf(" "+o+" ")>-1;)r=r.replace(" "+o+" "," ");i!==(s=pt(r))&&n.setAttribute("class",s)}return this},toggleClass:function(e,t){var n=typeof e,r="string"===n||Array.isArray(e);return"boolean"==typeof t&&r?t?this.addClass(e):this.removeClass(e):g(e)?this.each(function(n){T(this).toggleClass(e.call(this,n,yt(this),t),t)}):this.each(function(){var t,i,o,a;if(r)for(i=0,o=T(this),a=mt(e);t=a[i++];)o.hasClass(t)?o.removeClass(t):o.addClass(t);else void 0!==e&&"boolean"!==n||((t=yt(this))&&K.set(this,"__className__",t),this.setAttribute&&this.setAttribute("class",t||!1===e?"":K.get(this,"__className__")||""))})},hasClass:function(e){var t,n,r=0;for(t=" "+e+" ";n=this[r++];)if(1===n.nodeType&&(" "+pt(yt(n))+" ").indexOf(t)>-1)return!0;return!1}});var vt=/\r/g;T.fn.extend({val:function(e){var t,n,r,i=this[0];return arguments.length?(r=g(e),this.each(function(n){var i;1===this.nodeType&&(null==(i=r?e.call(this,n,T(this).val()):e)?i="":"number"==typeof i?i+="":Array.isArray(i)&&(i=T.map(i,function(e){return null==e?"":e+""})),(t=T.valHooks[this.type]||T.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,i,"value")||(this.value=i))})):i?(t=T.valHooks[i.type]||T.valHooks[i.nodeName.toLowerCase()])&&"get"in t&&void 0!==(n=t.get(i,"value"))?n:"string"==typeof(n=i.value)?n.replace(vt,""):null==n?"":n:void 0}}),T.extend({valHooks:{option:{get:function(e){var t=T.find.attr(e,"value");return null!=t?t:pt(T.text(e))}},select:{get:function(e){var t,n,r,i=e.options,o=e.selectedIndex,a="select-one"===e.type,s=a?null:[],u=a?o+1:i.length;for(r=o<0?u:a?o:0;r-1)&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),T.each(["radio","checkbox"],function(){T.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=T.inArray(T(e).val(),t)>-1}},v.checkOn||(T.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}),v.focusin="onfocusin"in n;var gt=/^(?:focusinfocus|focusoutblur)$/,bt=function(e){e.stopPropagation()};T.extend(T.event,{trigger:function(e,t,r,i){var o,s,u,c,l,f,d,h,y=[r||a],m=p.call(e,"type")?e.type:e,v=p.call(e,"namespace")?e.namespace.split("."):[];if(s=h=u=r=r||a,3!==r.nodeType&&8!==r.nodeType&&!gt.test(m+T.event.triggered)&&(m.indexOf(".")>-1&&(m=(v=m.split(".")).shift(),v.sort()),l=m.indexOf(":")<0&&"on"+m,(e=e[T.expando]?e:new T.Event(m,"object"==typeof e&&e)).isTrigger=i?2:3,e.namespace=v.join("."),e.rnamespace=e.namespace?new RegExp("(^|\\.)"+v.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=r),t=null==t?[e]:T.makeArray(t,[e]),d=T.event.special[m]||{},i||!d.trigger||!1!==d.trigger.apply(r,t))){if(!i&&!d.noBubble&&!b(r)){for(c=d.delegateType||m,gt.test(c+m)||(s=s.parentNode);s;s=s.parentNode)y.push(s),u=s;u===(r.ownerDocument||a)&&y.push(u.defaultView||u.parentWindow||n)}for(o=0;(s=y[o++])&&!e.isPropagationStopped();)h=s,e.type=o>1?c:d.bindType||m,(f=(K.get(s,"events")||{})[e.type]&&K.get(s,"handle"))&&f.apply(s,t),(f=l&&s[l])&&f.apply&&G(s)&&(e.result=f.apply(s,t),!1===e.result&&e.preventDefault());return e.type=m,i||e.isDefaultPrevented()||d._default&&!1!==d._default.apply(y.pop(),t)||!G(r)||l&&g(r[m])&&!b(r)&&((u=r[l])&&(r[l]=null),T.event.triggered=m,e.isPropagationStopped()&&h.addEventListener(m,bt),r[m](),e.isPropagationStopped()&&h.removeEventListener(m,bt),T.event.triggered=void 0,u&&(r[l]=u)),e.result}},simulate:function(e,t,n){var r=T.extend(new T.Event,n,{type:e,isSimulated:!0});T.event.trigger(r,null,t)}}),T.fn.extend({trigger:function(e,t){return this.each(function(){T.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return T.event.trigger(e,t,n,!0)}}),v.focusin||T.each({focus:"focusin",blur:"focusout"},function(e,t){var n=function(e){T.event.simulate(t,e.target,T.event.fix(e))};T.event.special[t]={setup:function(){var r=this.ownerDocument||this,i=K.access(r,t);i||r.addEventListener(e,n,!0),K.access(r,t,(i||0)+1)},teardown:function(){var r=this.ownerDocument||this,i=K.access(r,t)-1;i?K.access(r,t,i):(r.removeEventListener(e,n,!0),K.remove(r,t))}}});var wt=n.location,kt=Date.now(),xt=/\?/;T.parseXML=function(e){var t;if(!e||"string"!=typeof e)return null;try{t=(new n.DOMParser).parseFromString(e,"text/xml")}catch(e){t=void 0}return t&&!t.getElementsByTagName("parsererror").length||T.error("Invalid XML: "+e),t};var Tt=/\[\]$/,Ot=/\r?\n/g,St=/^(?:submit|button|image|reset|file)$/i,Et=/^(?:input|select|textarea|keygen)/i;function jt(e,t,n,r){var i;if(Array.isArray(t))T.each(t,function(t,i){n||Tt.test(e)?r(e,i):jt(e+"["+("object"==typeof i&&null!=i?t:"")+"]",i,n,r)});else if(n||"object"!==x(t))r(e,t);else for(i in t)jt(e+"["+i+"]",t[i],n,r)}T.param=function(e,t){var n,r=[],i=function(e,t){var n=g(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(Array.isArray(e)||e.jquery&&!T.isPlainObject(e))T.each(e,function(){i(this.name,this.value)});else for(n in e)jt(n,e[n],t,i);return r.join("&")},T.fn.extend({serialize:function(){return T.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=T.prop(this,"elements");return e?T.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!T(this).is(":disabled")&&Et.test(this.nodeName)&&!St.test(e)&&(this.checked||!de.test(e))}).map(function(e,t){var n=T(this).val();return null==n?null:Array.isArray(n)?T.map(n,function(e){return{name:t.name,value:e.replace(Ot,"\r\n")}}):{name:t.name,value:n.replace(Ot,"\r\n")}}).get()}});var Dt=/%20/g,Nt=/#.*$/,Ct=/([?&])_=[^&]*/,Lt=/^(.*?):[ \t]*([^\r\n]*)$/gm,At=/^(?:GET|HEAD)$/,Mt=/^\/\//,It={},Rt={},_t="*/".concat("*"),Ut=a.createElement("a");function qt(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,o=t.toLowerCase().match(q)||[];if(g(n))for(;r=o[i++];)"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function Ht(e,t,n,r){var i={},o=e===Rt;function a(s){var u;return i[s]=!0,T.each(e[s]||[],function(e,s){var c=s(t,n,r);return"string"!=typeof c||o||i[c]?o?!(u=c):void 0:(t.dataTypes.unshift(c),a(c),!1)}),u}return a(t.dataTypes[0])||!i["*"]&&a("*")}function Yt(e,t){var n,r,i=T.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&T.extend(!0,e,r),e}Ut.href=wt.href,T.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:wt.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(wt.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":_t,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":T.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Yt(Yt(e,T.ajaxSettings),t):Yt(T.ajaxSettings,e)},ajaxPrefilter:qt(It),ajaxTransport:qt(Rt),ajax:function(e,t){"object"==typeof e&&(t=e,e=void 0),t=t||{};var r,i,o,s,u,c,l,f,d,h,p=T.ajaxSetup({},t),y=p.context||p,m=p.context&&(y.nodeType||y.jquery)?T(y):T.event,v=T.Deferred(),g=T.Callbacks("once memory"),b=p.statusCode||{},w={},k={},x="canceled",O={readyState:0,getResponseHeader:function(e){var t;if(l){if(!s)for(s={};t=Lt.exec(o);)s[t[1].toLowerCase()]=t[2];t=s[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return l?o:null},setRequestHeader:function(e,t){return null==l&&(e=k[e.toLowerCase()]=k[e.toLowerCase()]||e,w[e]=t),this},overrideMimeType:function(e){return null==l&&(p.mimeType=e),this},statusCode:function(e){var t;if(e)if(l)O.always(e[O.status]);else for(t in e)b[t]=[b[t],e[t]];return this},abort:function(e){var t=e||x;return r&&r.abort(t),S(0,t),this}};if(v.promise(O),p.url=((e||p.url||wt.href)+"").replace(Mt,wt.protocol+"//"),p.type=t.method||t.type||p.method||p.type,p.dataTypes=(p.dataType||"*").toLowerCase().match(q)||[""],null==p.crossDomain){c=a.createElement("a");try{c.href=p.url,c.href=c.href,p.crossDomain=Ut.protocol+"//"+Ut.host!=c.protocol+"//"+c.host}catch(e){p.crossDomain=!0}}if(p.data&&p.processData&&"string"!=typeof p.data&&(p.data=T.param(p.data,p.traditional)),Ht(It,p,t,O),l)return O;for(d in(f=T.event&&p.global)&&0==T.active++&&T.event.trigger("ajaxStart"),p.type=p.type.toUpperCase(),p.hasContent=!At.test(p.type),i=p.url.replace(Nt,""),p.hasContent?p.data&&p.processData&&0===(p.contentType||"").indexOf("application/x-www-form-urlencoded")&&(p.data=p.data.replace(Dt,"+")):(h=p.url.slice(i.length),p.data&&(p.processData||"string"==typeof p.data)&&(i+=(xt.test(i)?"&":"?")+p.data,delete p.data),!1===p.cache&&(i=i.replace(Ct,"$1"),h=(xt.test(i)?"&":"?")+"_="+kt+++h),p.url=i+h),p.ifModified&&(T.lastModified[i]&&O.setRequestHeader("If-Modified-Since",T.lastModified[i]),T.etag[i]&&O.setRequestHeader("If-None-Match",T.etag[i])),(p.data&&p.hasContent&&!1!==p.contentType||t.contentType)&&O.setRequestHeader("Content-Type",p.contentType),O.setRequestHeader("Accept",p.dataTypes[0]&&p.accepts[p.dataTypes[0]]?p.accepts[p.dataTypes[0]]+("*"!==p.dataTypes[0]?", "+_t+"; q=0.01":""):p.accepts["*"]),p.headers)O.setRequestHeader(d,p.headers[d]);if(p.beforeSend&&(!1===p.beforeSend.call(y,O,p)||l))return O.abort();if(x="abort",g.add(p.complete),O.done(p.success),O.fail(p.error),r=Ht(Rt,p,t,O)){if(O.readyState=1,f&&m.trigger("ajaxSend",[O,p]),l)return O;p.async&&p.timeout>0&&(u=n.setTimeout(function(){O.abort("timeout")},p.timeout));try{l=!1,r.send(w,S)}catch(e){if(l)throw e;S(-1,e)}}else S(-1,"No Transport");function S(e,t,a,s){var c,d,h,w,k,x=t;l||(l=!0,u&&n.clearTimeout(u),r=void 0,o=s||"",O.readyState=e>0?4:0,c=e>=200&&e<300||304===e,a&&(w=function(e,t,n){for(var r,i,o,a,s=e.contents,u=e.dataTypes;"*"===u[0];)u.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(i in s)if(s[i]&&s[i].test(r)){u.unshift(i);break}if(u[0]in n)o=u[0];else{for(i in n){if(!u[0]||e.converters[i+" "+u[0]]){o=i;break}a||(a=i)}o=o||a}if(o)return o!==u[0]&&u.unshift(o),n[o]}(p,O,a)),w=function(e,t,n,r){var i,o,a,s,u,c={},l=e.dataTypes.slice();if(l[1])for(a in e.converters)c[a.toLowerCase()]=e.converters[a];for(o=l.shift();o;)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!u&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u=o,o=l.shift())if("*"===o)o=u;else if("*"!==u&&u!==o){if(!(a=c[u+" "+o]||c["* "+o]))for(i in c)if((s=i.split(" "))[1]===o&&(a=c[u+" "+s[0]]||c["* "+s[0]])){!0===a?a=c[i]:!0!==c[i]&&(o=s[0],l.unshift(s[1]));break}if(!0!==a)if(a&&e.throws)t=a(t);else try{t=a(t)}catch(e){return{state:"parsererror",error:a?e:"No conversion from "+u+" to "+o}}}return{state:"success",data:t}}(p,w,O,c),c?(p.ifModified&&((k=O.getResponseHeader("Last-Modified"))&&(T.lastModified[i]=k),(k=O.getResponseHeader("etag"))&&(T.etag[i]=k)),204===e||"HEAD"===p.type?x="nocontent":304===e?x="notmodified":(x=w.state,d=w.data,c=!(h=w.error))):(h=x,!e&&x||(x="error",e<0&&(e=0))),O.status=e,O.statusText=(t||x)+"",c?v.resolveWith(y,[d,x,O]):v.rejectWith(y,[O,x,h]),O.statusCode(b),b=void 0,f&&m.trigger(c?"ajaxSuccess":"ajaxError",[O,p,c?d:h]),g.fireWith(y,[O,x]),f&&(m.trigger("ajaxComplete",[O,p]),--T.active||T.event.trigger("ajaxStop")))}return O},getJSON:function(e,t,n){return T.get(e,t,n,"json")},getScript:function(e,t){return T.get(e,void 0,t,"script")}}),T.each(["get","post"],function(e,t){T[t]=function(e,n,r,i){return g(n)&&(i=i||r,r=n,n=void 0),T.ajax(T.extend({url:e,type:t,dataType:i,data:n,success:r},T.isPlainObject(e)&&e))}}),T._evalUrl=function(e){return T.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,throws:!0})},T.fn.extend({wrapAll:function(e){var t;return this[0]&&(g(e)&&(e=e.call(this[0])),t=T(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e}).append(this)),this},wrapInner:function(e){return g(e)?this.each(function(t){T(this).wrapInner(e.call(this,t))}):this.each(function(){var t=T(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=g(e);return this.each(function(n){T(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(e){return this.parent(e).not("body").each(function(){T(this).replaceWith(this.childNodes)}),this}}),T.expr.pseudos.hidden=function(e){return!T.expr.pseudos.visible(e)},T.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},T.ajaxSettings.xhr=function(){try{return new n.XMLHttpRequest}catch(e){}};var Ft={0:200,1223:204},Wt=T.ajaxSettings.xhr();v.cors=!!Wt&&"withCredentials"in Wt,v.ajax=Wt=!!Wt,T.ajaxTransport(function(e){var t,r;if(v.cors||Wt&&!e.crossDomain)return{send:function(i,o){var a,s=e.xhr();if(s.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(a in e.xhrFields)s[a]=e.xhrFields[a];for(a in e.mimeType&&s.overrideMimeType&&s.overrideMimeType(e.mimeType),e.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest"),i)s.setRequestHeader(a,i[a]);t=function(e){return function(){t&&(t=r=s.onload=s.onerror=s.onabort=s.ontimeout=s.onreadystatechange=null,"abort"===e?s.abort():"error"===e?"number"!=typeof s.status?o(0,"error"):o(s.status,s.statusText):o(Ft[s.status]||s.status,s.statusText,"text"!==(s.responseType||"text")||"string"!=typeof s.responseText?{binary:s.response}:{text:s.responseText},s.getAllResponseHeaders()))}},s.onload=t(),r=s.onerror=s.ontimeout=t("error"),void 0!==s.onabort?s.onabort=r:s.onreadystatechange=function(){4===s.readyState&&n.setTimeout(function(){t&&r()})},t=t("abort");try{s.send(e.hasContent&&e.data||null)}catch(e){if(t)throw e}},abort:function(){t&&t()}}}),T.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),T.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return T.globalEval(e),e}}}),T.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),T.ajaxTransport("script",function(e){var t,n;if(e.crossDomain)return{send:function(r,i){t=T(" - - - -
-

- Code and docs -

-

- rrule.js demo

- -
-

- This is a demo and test app for - rrule.js, a JavaScript library for working with recurrence rules for calendar dates. -

- -
- -
-

Output

- - - - - - - - - - - - - - - - - - - - - -
- rule = - -

-          
- rule.origOptions - -

-          
- rule.toString() - -
-
- rule.toText() - - - - -
- rule.all() - -
-
-
- - -
-

Input

-
-
-
-

Options

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- freq - -
Frequency
-
-
- - - - - - - -
-
- dtstart - -
The recurrence start. Besides being the base for the recurrence, missing parameters in the final recurrence - instances will also be extracted from this date. If not given, - new Date will be used instead. -
-
-
- -
-
- tzid - -
The timezone for the rule. If present, all recurrences will be interpreted as being in the local time - of the given timezone. If not present, UTC will be used instead. -
-
-
- -
-
- until - -
If given, this must be a - Date - instance, that will specify the limit of the recurrence. If a recurrence instance happens to be the same as the - Date instance given in the - until - argument, this will be the last occurrence. -
-
-
- -
-
- count - -
How many occurrences will be generated. -
-
-
- -
-
- interval - -
The interval between each freq iteration. For example, when using - RRule.YEARLY, an interval of - 2 means once every two years, but with - RRule.HOURLY, it means once every two hours. The default interval is - 1. -
-
-
- -
-
- wkst - -
The week start day. Must be one of the - RRule.MO, - RRule.TU, - RRule.WE - constants, or an integer, specifying the first day of the week. This will affect recurrences based on weekly periods. The - default week start is - RRule.MO. -
-
-
- - - - - - - -
-
- byweekday - -
If given, it must be either an integer ( - 0 == RRule.MO), a sequence of integers, one of the weekday constants ( - RRule.MO, - RRule.TU, etc), or a sequence of these constants. When given, these variables will define - the weekdays where the recurrence will be applied. It's also possible to use an argument n for the - weekday instances, which will mean the nth occurrence of this weekday in the period. For example, - with - RRule.MONTHLY, or with - RRule.YEARLY and - BYMONTH, using - RRule.FR.clone(+1) in - byweekday will specify the first friday of the month where the recurrence happens. Notice - that the RFC documentation, this is specified as - BYDAY, but was renamed to avoid the ambiguity of that argument. -
-
-
- - - - - - - -
-
- bymonth - -
If given, it must be either an integer, or a sequence of integers, meaning the months to apply the - recurrence to. -
-
-
- - - - - - - - - - - - -
-
- bysetpos - -
If given, it must be either an integer, or a sequence of integers, positive or negative. Each given - integer will specify an occurrence number, corresponding to the nth occurrence of the rule inside - the frequency period. For example, a - bysetpos of - -1 if combined with a - RRule.MONTHLY - frequency, and a byweekday of ( - RRule.MO, - RRule.TU, - RRule.WE, - RRule.TH, - RRule.FR), will result in the last work day of every month. -
-
-
- -
-
- bymonthday - -
If given, it must be either an integer, or a sequence of integers, meaning the month days to apply - the recurrence to. -
-
-
- -
-
- byyearday - -
If given, it must be either an integer, or a sequence of integers, meaning the year days to apply the - recurrence to. -
-
-
- -
-
- byweekno - -
If given, it must be either an integer, or a sequence of integers, meaning the week numbers to apply - the recurrence to. Week numbers have the meaning described in ISO8601, that is, the first week of - the year is that containing at least four days of the new year. -
-
-
- -
-
- byhour - -
If given, it must be either an integer, or a sequence of integers, meaning the hours to apply the recurrence - to. -
-
-
- -
-
- byminute - -
If given, it must be either an integer, or a sequence of integers, meaning the minutes to apply the - recurrence to. -
-
-
- -
-
- bysecond - -
If given, it must be either an integer, or a sequence of integers, meaning the seconds to apply the - recurrence to. -
-
-
- -
-
- byeaster - -
- This is an extension to the RFC specification which the Python implementation provides. - Not implemented in the JavaScript version. - -
-
-
- -
-
-
- - -
-

- RRULE string

-

- -

-

- Enter an - RRULE as per - iCalendar RFC. -

-

Examples:

-
    -
  • - FREQ=WEEKLY;BYDAY=MO,WE -
  • -
  • - FREQ=MONTHLY;BYMONTHDAY=10,15;COUNT=20 -
  • -
  • - FREQ=DAILY;INTERVAL=3;COUNT=10 -
  • -
  • - FREQ=MONTHLY;BYDAY=-2FR;COUNT=7 -
  • -
-
- - - -
-

Text input

-

- -

-

Examples:

-
    -
  • - Every weekday -
  • -
  • - Every 2 weeks on Tuesday -
  • -
  • - Every week on Monday, Wednesday -
  • -
  • - Every month on the 2nd last Friday for 7 times -
  • -
  • - Every 6 months -
  • -
-
- - -
-
-
- - Fork me on GitHub - - - - diff --git a/dist/esm/src/cache.d.ts b/dist/esm/src/cache.d.ts deleted file mode 100644 index eda13916..00000000 --- a/dist/esm/src/cache.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { IterArgs } from './iterresult'; -export declare type CacheKeys = 'before' | 'after' | 'between'; -export declare class Cache { - all: Date[] | Partial | false; - before: IterArgs[]; - after: IterArgs[]; - between: IterArgs[]; - /** - * @param {String} what - all/before/after/between - * @param {Array,Date} value - an array of dates, one date, or null - * @param {Object?} args - _iter arguments - */ - _cacheAdd(what: CacheKeys | 'all', value: Date[] | Date | null, args?: Partial): void; - /** - * @return false - not in the cache - * null - cached, but zero occurrences (before/after) - * Date - cached (before/after) - * [] - cached, but zero occurrences (all/between) - * [Date1, DateN] - cached (all/between) - */ - _cacheGet(what: CacheKeys | 'all', args?: Partial): Date | Date[] | false | null; -} -//# sourceMappingURL=cache.d.ts.map \ No newline at end of file diff --git a/dist/esm/src/cache.d.ts.map b/dist/esm/src/cache.d.ts.map deleted file mode 100644 index 3deeed40..00000000 --- a/dist/esm/src/cache.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../../../src/cache.ts"],"names":[],"mappings":"AAAA,OAAmB,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AAInD,oBAAY,SAAS,GAAG,QAAQ,GAAG,OAAO,GAAG,SAAS,CAAA;AAEtD,qBAAa,KAAK;IAChB,GAAG,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,QAAQ,CAAC,GAAG,KAAK,CAAQ;IAC/C,MAAM,EAAE,QAAQ,EAAE,CAAK;IACvB,KAAK,EAAE,QAAQ,EAAE,CAAK;IACtB,OAAO,EAAE,QAAQ,EAAE,CAAK;IAExB;;;;OAIG;IACI,SAAS,CACd,IAAI,EAAE,SAAS,GAAG,KAAK,EACvB,KAAK,EAAE,IAAI,EAAE,GAAG,IAAI,GAAG,IAAI,EAC3B,IAAI,CAAC,EAAE,OAAO,CAAC,QAAQ,CAAC;IAiB1B;;;;;;OAMG;IACI,SAAS,CACd,IAAI,EAAE,SAAS,GAAG,KAAK,EACvB,IAAI,CAAC,EAAE,OAAO,CAAC,QAAQ,CAAC,GACvB,IAAI,GAAG,IAAI,EAAE,GAAG,KAAK,GAAG,IAAI;CA6ChC"} \ No newline at end of file diff --git a/dist/esm/src/cache.js b/dist/esm/src/cache.js deleted file mode 100644 index 30d51277..00000000 --- a/dist/esm/src/cache.js +++ /dev/null @@ -1,85 +0,0 @@ -import IterResult from './iterresult'; -import dateutil from './dateutil'; -import { isArray } from './helpers'; -var Cache = /** @class */ (function () { - function Cache() { - this.all = false; - this.before = []; - this.after = []; - this.between = []; - } - /** - * @param {String} what - all/before/after/between - * @param {Array,Date} value - an array of dates, one date, or null - * @param {Object?} args - _iter arguments - */ - Cache.prototype._cacheAdd = function (what, value, args) { - if (value) { - value = - value instanceof Date - ? dateutil.clone(value) - : dateutil.cloneDates(value); - } - if (what === 'all') { - this.all = value; - } - else { - args._value = value; - this[what].push(args); - } - }; - /** - * @return false - not in the cache - * null - cached, but zero occurrences (before/after) - * Date - cached (before/after) - * [] - cached, but zero occurrences (all/between) - * [Date1, DateN] - cached (all/between) - */ - Cache.prototype._cacheGet = function (what, args) { - var cached = false; - var argsKeys = args ? Object.keys(args) : []; - var findCacheDiff = function (item) { - for (var i = 0; i < argsKeys.length; i++) { - var key = argsKeys[i]; - if (String(args[key]) !== String(item[key])) { - return true; - } - } - return false; - }; - var cachedObject = this[what]; - if (what === 'all') { - cached = this.all; - } - else if (isArray(cachedObject)) { - // Let's see whether we've already called the - // 'what' method with the same 'args' - for (var i = 0; i < cachedObject.length; i++) { - var item = cachedObject[i]; - if (argsKeys.length && findCacheDiff(item)) - continue; - cached = item._value; - break; - } - } - if (!cached && this.all) { - // Not in the cache, but we already know all the occurrences, - // so we can find the correct dates from the cached ones. - var iterResult = new IterResult(what, args); - for (var i = 0; i < this.all.length; i++) { - if (!iterResult.accept(this.all[i])) - break; - } - cached = iterResult.getValue(); - this._cacheAdd(what, cached, args); - } - return isArray(cached) - ? dateutil.cloneDates(cached) - : cached instanceof Date - ? dateutil.clone(cached) - : cached; - }; - return Cache; -}()); -export { Cache }; -//# sourceMappingURL=cache.js.map \ No newline at end of file diff --git a/dist/esm/src/cache.js.map b/dist/esm/src/cache.js.map deleted file mode 100644 index 35a207b0..00000000 --- a/dist/esm/src/cache.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"cache.js","sourceRoot":"","sources":["../../../src/cache.ts"],"names":[],"mappings":"AAAA,OAAO,UAAwB,MAAM,cAAc,CAAA;AACnD,OAAO,QAAQ,MAAM,YAAY,CAAA;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAInC;IAAA;QACE,QAAG,GAAuC,KAAK,CAAA;QAC/C,WAAM,GAAe,EAAE,CAAA;QACvB,UAAK,GAAe,EAAE,CAAA;QACtB,YAA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00000000 --- a/dist/esm/src/callbackiterresult.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import IterResult, { IterArgs } from './iterresult'; -declare type Iterator = (d: Date, len: number) => boolean; -/** - * IterResult subclass that calls a callback function on each add, - * and stops iterating when the callback returns false. - */ -export default class CallbackIterResult extends IterResult<'all' | 'between'> { - private iterator; - constructor(method: 'all' | 'between', args: Partial, iterator: Iterator); - add(date: Date): boolean; -} -export {}; -//# sourceMappingURL=callbackiterresult.d.ts.map \ No newline at end of file diff --git a/dist/esm/src/callbackiterresult.d.ts.map b/dist/esm/src/callbackiterresult.d.ts.map deleted file mode 100644 index 4ad43999..00000000 --- a/dist/esm/src/callbackiterresult.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"callbackiterresult.d.ts","sourceRoot":"","sources":["../../../src/callbackiterresult.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,EAAE,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AAEnD,aAAK,QAAQ,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,KAAK,OAAO,CAAA;AAEjD;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,kBAAmB,SAAQ,UAAU,CAAC,KAAK,GAAG,SAAS,CAAC;IAC3E,OAAO,CAAC,QAAQ,CAAU;gBAGxB,MAAM,EAAE,KAAK,GAAG,SAAS,EACzB,IAAI,EAAE,OAAO,CAAC,QAAQ,CAAC,EACvB,QAAQ,EAAE,QAAQ;IAOpB,GAAG,CAAE,IAAI,EAAE,IAAI;CAOhB"} \ No newline at end of file diff --git a/dist/esm/src/callbackiterresult.js b/dist/esm/src/callbackiterresult.js deleted file mode 100644 index d95f279b..00000000 --- a/dist/esm/src/callbackiterresult.js +++ /dev/null @@ -1,24 +0,0 @@ -import { __extends } from "tslib"; -import IterResult from './iterresult'; -/** - * IterResult subclass that calls a callback function on each add, - * and stops iterating when the callback returns false. - */ -var CallbackIterResult = /** @class */ (function (_super) { - __extends(CallbackIterResult, _super); - function CallbackIterResult(method, args, iterator) { - var _this = _super.call(this, method, args) || this; - _this.iterator = iterator; - return _this; - } - CallbackIterResult.prototype.add = function (date) { - if (this.iterator(date, this._result.length)) { - this._result.push(date); - return true; - } - return false; - }; - return CallbackIterResult; -}(IterResult)); -export default CallbackIterResult; -//# sourceMappingURL=callbackiterresult.js.map \ No newline at end of file diff --git a/dist/esm/src/callbackiterresult.js.map b/dist/esm/src/callbackiterresult.js.map deleted file mode 100644 index f4f6a12f..00000000 --- a/dist/esm/src/callbackiterresult.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"callbackiterresult.js","sourceRoot":"","sources":["../../../src/callbackiterresult.ts"],"names":[],"mappings":";AAAA,OAAO,UAAwB,MAAM,cAAc,CAAA;AAInD;;;GAGG;AACH;IAAgD,sCAA6B;IAG3E,4BACE,MAAyB,EACzB,IAAuB,EACvB,QAAkB;QAHpB,YAKE,kBAAM,MAAM,EAAE,IAAI,CAAC,SAGpB;QADC,KAAI,CAAC,QAAQ,GAAG,QAAQ,CAAA;;IAC1B,CAAC;IAED,gCAAG,GAAH,UAAK,IAAU;QACb,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;YAC5C,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;YACvB,OAAO,IAAI,CAAA;SACZ;QACD,OAAO,KAAK,CAAA;IACd,CAAC;IACH,yBAAC;AAAD,CAAC,AApBD,CAAgD,UAAU,GAoBzD"} \ No newline at end of file diff --git a/dist/esm/src/datetime.d.ts b/dist/esm/src/datetime.d.ts deleted file mode 100644 index 4ef44405..00000000 --- a/dist/esm/src/datetime.d.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { ParsedOptions } from './types'; -export declare class Time { - hour: number; - minute: number; - second: number; - millisecond: number; - constructor(hour: number, minute: number, second: number, millisecond: number); - getHours(): number; - getMinutes(): number; - getSeconds(): number; - getMilliseconds(): number; - getTime(): number; -} -export declare class DateTime extends Time { - day: number; - month: number; - year: number; - static fromDate(date: Date): DateTime; - constructor(year: number, month: number, day: number, hour: number, minute: number, second: number, millisecond: number); - getWeekday(): number; - getTime(): number; - getDay(): number; - getMonth(): number; - getYear(): number; - addYears(years: number): void; - addMonths(months: number): void; - addWeekly(days: number, wkst: number): void; - addDaily(days: number): void; - addHours(hours: number, filtered: boolean, byhour: number[]): void; - addMinutes(minutes: number, filtered: boolean, byhour: number[], byminute: number[]): void; - addSeconds(seconds: number, filtered: boolean, byhour: number[], byminute: number[], bysecond: number[]): void; - fixDay(): void; - add(options: ParsedOptions, filtered: boolean): void; -} -//# sourceMappingURL=datetime.d.ts.map \ No newline at end of file diff --git a/dist/esm/src/datetime.d.ts.map b/dist/esm/src/datetime.d.ts.map deleted file mode 100644 index 2a0bb3ce..00000000 --- a/dist/esm/src/datetime.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"datetime.d.ts","sourceRoot":"","sources":["../../../src/datetime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAa,MAAM,SAAS,CAAA;AAIlD,qBAAa,IAAI;IACR,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,MAAM,CAAA;IACd,WAAW,EAAE,MAAM,CAAA;gBAGtB,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM;IAQvB,QAAQ;IAIR,UAAU;IAIV,UAAU;IAIV,eAAe;IAIf,OAAO;CAMR;AAED,qBAAa,QAAS,SAAQ,IAAI;IACzB,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IAEnB,MAAM,CAAC,QAAQ,CAAE,IAAI,EAAE,IAAI;gBAavB,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,EACb,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM;IAQvB,UAAU;IAIV,OAAO;IAQP,MAAM;IAIN,QAAQ;IAIR,OAAO;IAIA,QAAQ,CAAE,KAAK,EAAE,MAAM;IAIvB,SAAS,CAAE,MAAM,EAAE,MAAM;IAczB,SAAS,CAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM;IAUrC,QAAQ,CAAE,IAAI,EAAE,MAAM;IAKtB,QAAQ,CAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE;IAkB5D,UAAU,CAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE;IAwBpF,UAAU,CAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE;IA2BxG,MAAM;IAyBN,GAAG,CAAE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,OAAO;CAoBtD"} \ No newline at end of file diff --git a/dist/esm/src/datetime.js b/dist/esm/src/datetime.js deleted file mode 100644 index e5c1631c..00000000 --- a/dist/esm/src/datetime.js +++ /dev/null @@ -1,178 +0,0 @@ -import { __extends } from "tslib"; -import { Frequency } from './types'; -import { pymod, divmod, empty, includes } from './helpers'; -import { dateutil } from './dateutil'; -var Time = /** @class */ (function () { - function Time(hour, minute, second, millisecond) { - this.hour = hour; - this.minute = minute; - this.second = second; - this.millisecond = millisecond || 0; - } - Time.prototype.getHours = function () { - return this.hour; - }; - Time.prototype.getMinutes = function () { - return this.minute; - }; - Time.prototype.getSeconds = function () { - return this.second; - }; - Time.prototype.getMilliseconds = function () { - return this.millisecond; - }; - Time.prototype.getTime = function () { - return ((this.hour * 60 * 60 + this.minute * 60 + this.second) * 1000 + - this.millisecond); - }; - return Time; -}()); -export { Time }; -var DateTime = /** @class */ (function (_super) { - __extends(DateTime, _super); - function DateTime(year, month, day, hour, minute, second, millisecond) { - var _this = _super.call(this, hour, minute, second, millisecond) || this; - _this.year = year; - _this.month = month; - _this.day = day; - return _this; - } - DateTime.fromDate = function (date) { - return new this(date.getUTCFullYear(), date.getUTCMonth() + 1, date.getUTCDate(), date.getUTCHours(), date.getUTCMinutes(), date.getUTCSeconds(), date.valueOf() % 1000); - }; - DateTime.prototype.getWeekday = function () { - return dateutil.getWeekday(new Date(this.getTime())); - }; - DateTime.prototype.getTime = function () { - return new Date(Date.UTC(this.year, this.month - 1, this.day, this.hour, this.minute, this.second, this.millisecond)).getTime(); - }; - DateTime.prototype.getDay = function () { - return this.day; - }; - DateTime.prototype.getMonth = function () { - return this.month; - }; - DateTime.prototype.getYear = function () { - return this.year; - }; - DateTime.prototype.addYears = function (years) { - this.year += years; - }; - DateTime.prototype.addMonths = function (months) { - this.month += months; - if (this.month > 12) { - var yearDiv = Math.floor(this.month / 12); - var monthMod = pymod(this.month, 12); - this.month = monthMod; - this.year += yearDiv; - if (this.month === 0) { - this.month = 12; - --this.year; - } - } - }; - DateTime.prototype.addWeekly = function (days, wkst) { - if (wkst > this.getWeekday()) { - this.day += -(this.getWeekday() + 1 + (6 - wkst)) + days * 7; - } - else { - this.day += -(this.getWeekday() - wkst) + days * 7; - } - this.fixDay(); - }; - DateTime.prototype.addDaily = function (days) { - this.day += days; - this.fixDay(); - }; - DateTime.prototype.addHours = function (hours, filtered, byhour) { - if (filtered) { - // Jump to one iteration before next day - this.hour += Math.floor((23 - this.hour) / hours) * hours; - } - while (true) { - this.hour += hours; - var _a = divmod(this.hour, 24), dayDiv = _a.div, hourMod = _a.mod; - if (dayDiv) { - this.hour = hourMod; - this.addDaily(dayDiv); - } - if (empty(byhour) || includes(byhour, this.hour)) - break; - } - }; - DateTime.prototype.addMinutes = function (minutes, filtered, byhour, byminute) { - if (filtered) { - // Jump to one iteration before next day - this.minute += - Math.floor((1439 - (this.hour * 60 + this.minute)) / minutes) * minutes; - } - while (true) { - this.minute += minutes; - var _a = divmod(this.minute, 60), hourDiv = _a.div, minuteMod = _a.mod; - if (hourDiv) { - this.minute = minuteMod; - this.addHours(hourDiv, false, byhour); - } - if ((empty(byhour) || includes(byhour, this.hour)) && - (empty(byminute) || includes(byminute, this.minute))) { - break; - } - } - }; - DateTime.prototype.addSeconds = function (seconds, filtered, byhour, byminute, bysecond) { - if (filtered) { - // Jump to one iteration before next day - this.second += - Math.floor((86399 - (this.hour * 3600 + this.minute * 60 + this.second)) / seconds) * seconds; - } - while (true) { - this.second += seconds; - var _a = divmod(this.second, 60), minuteDiv = _a.div, secondMod = _a.mod; - if (minuteDiv) { - this.second = secondMod; - this.addMinutes(minuteDiv, false, byhour, byminute); - } - if ((empty(byhour) || includes(byhour, this.hour)) && - (empty(byminute) || includes(byminute, this.minute)) && - (empty(bysecond) || includes(bysecond, this.second))) { - break; - } - } - }; - DateTime.prototype.fixDay = function () { - if (this.day <= 28) { - return; - } - var daysinmonth = dateutil.monthRange(this.year, this.month - 1)[1]; - if (this.day <= daysinmonth) { - return; - } - while (this.day > daysinmonth) { - this.day -= daysinmonth; - ++this.month; - if (this.month === 13) { - this.month = 1; - ++this.year; - if (this.year > dateutil.MAXYEAR) { - return; - } - } - daysinmonth = dateutil.monthRange(this.year, this.month - 1)[1]; - } - }; - DateTime.prototype.add = function (options, filtered) { - var freq = options.freq, interval = options.interval, wkst = options.wkst, byhour = options.byhour, byminute = options.byminute, bysecond = options.bysecond; - switch (freq) { - case Frequency.YEARLY: return this.addYears(interval); - case Frequency.MONTHLY: return this.addMonths(interval); - case Frequency.WEEKLY: return this.addWeekly(interval, wkst); - case Frequency.DAILY: return this.addDaily(interval); - case Frequency.HOURLY: return this.addHours(interval, filtered, byhour); - case Frequency.MINUTELY: return this.addMinutes(interval, filtered, byhour, byminute); - case Frequency.SECONDLY: return this.addSeconds(interval, filtered, byhour, byminute, bysecond); - } - }; - return DateTime; -}(Time)); -export { DateTime }; -//# sourceMappingURL=datetime.js.map \ No newline at end of file diff --git a/dist/esm/src/datetime.js.map b/dist/esm/src/datetime.js.map deleted file mode 100644 index 90493762..00000000 --- a/dist/esm/src/datetime.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"datetime.js","sourceRoot":"","sources":["../../../src/datetime.ts"],"names":[],"mappings":";AAAA,OAAO,EAAiB,SAAS,EAAE,MAAM,SAAS,CAAA;AAClD,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAErC;IAME,cACI,IAAY,EACZ,MAAc,EACd,MAAc,EACd,WAAmB;QAErB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;QAChB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;QACpB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;QACpB,IAAI,CAAC,WAAW,GAAG,WAAW,IAAI,CAAC,CAAA;IACrC,CAAC;IAED,uBAAQ,GAAR;QACE,OAAO,IAAI,CAAC,IAAI,CAAA;IAClB,CAAC;IAED,yBAAU,GAAV;QACE,OAAO,IAAI,CAAC,MAAM,CAAA;IACpB,CAAC;IAED,yBAAU,GAAV;QACE,OAAO,IAAI,CAAC,MAAM,CAAA;IACpB,CAAC;IAED,8BAAe,GAAf;QACE,OAAO,IAAI,CAAC,WAAW,CAAA;IACzB,CAAC;IAED,sBAAO,GAAP;QACE,OAAO,CACH,CAAC,IAAI,CAAC,IAAI,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,MAAM,GAAG,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,IAAI;YAC7D,IAAI,CAAC,WAAW,CACnB,CAAA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AA;YACpD,KAAK,SAAS,CAAC,MAAM,CAAC,CAAC,OAAO,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAA;YACvE,KAAK,SAAS,CAAC,QAAQ,CAAC,CAAC,OAAO,IAAI,CAAC,UAAU,CAAC,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAA;YACrF,KAAK,SAAS,CAAC,QAAQ,CAAC,CAAC,OAAO,IAAI,CAAC,UAAU,CAAC,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAA;SAChG;IACH,CAAC;IACH,eAAC;AAAD,CAAC,AA3MD,CAA8B,IAAI,GA2MjC"} \ No newline at end of file diff --git a/dist/esm/src/dateutil.d.ts b/dist/esm/src/dateutil.d.ts deleted file mode 100644 index 763aab6f..00000000 --- a/dist/esm/src/dateutil.d.ts +++ /dev/null @@ -1,74 +0,0 @@ -import { Time } from './datetime'; -/** - * General date-related utilities. - * Also handles several incompatibilities between JavaScript and Python - * - */ -export declare namespace dateutil { - const MONTH_DAYS: number[]; - /** - * Number of milliseconds of one day - */ - const ONE_DAY: number; - /** - * @see: - */ - const MAXYEAR = 9999; - /** - * Python uses 1-Jan-1 as the base for calculating ordinals but we don't - * want to confuse the JS engine with milliseconds > Number.MAX_NUMBER, - * therefore we use 1-Jan-1970 instead - */ - const ORDINAL_BASE: Date; - /** - * Python: MO-SU: 0 - 6 - * JS: SU-SAT 0 - 6 - */ - const PY_WEEKDAYS: number[]; - /** - * py_date.timetuple()[7] - */ - const getYearDay: (date: Date) => number; - const isLeapYear: (year: number) => boolean; - const isDate: (value: any) => value is Date; - const isValidDate: (value: any) => value is Date; - /** - * @return {Number} the date's timezone offset in ms - */ - const tzOffset: (date: Date) => number; - /** - * @see: - */ - const daysBetween: (date1: Date, date2: Date) => number; - /** - * @see: - */ - const toOrdinal: (date: Date) => number; - /** - * @see - - */ - const fromOrdinal: (ordinal: number) => Date; - const getMonthDays: (date: Date) => number; - /** - * @return {Number} python-like weekday - */ - const getWeekday: (date: Date) => number; - /** - * @see: - */ - const monthRange: (year: number, month: number) => number[]; - /** - * @see: - */ - const combine: (date: Date, time: Date | Time) => Date; - const clone: (date: Date | Time) => Date; - const cloneDates: (dates: Date[] | Time[]) => Date[]; - /** - * Sorts an array of Date or dateutil.Time objects - */ - const sort: >(dates: T[]) => void; - const timeToUntilString: (time: number, utc?: boolean) => string; - const untilStringToDate: (until: string) => Date; -} -export default dateutil; -//# sourceMappingURL=dateutil.d.ts.map \ No newline at end of file diff --git a/dist/esm/src/dateutil.d.ts.map b/dist/esm/src/dateutil.d.ts.map deleted file mode 100644 index 86e854ef..00000000 --- a/dist/esm/src/dateutil.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"dateutil.d.ts","sourceRoot":"","sources":["../../../src/dateutil.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AAIjC;;;;GAIG;AACH,yBAAiB,QAAQ,CAAC;IACjB,MAAM,UAAU,UAAmD,CAAA;IAE1E;;OAEG;IACI,MAAM,OAAO,QAAsB,CAAA;IAE1C;;OAEG;IACI,MAAM,OAAO,OAAO,CAAA;IAE3B;;;;OAIG;IACI,MAAM,YAAY,MAAiC,CAAA;IAE1D;;;OAGG;IACI,MAAM,WAAW,UAAwB,CAAA;IAEhD;;OAEG;IACI,MAAM,UAAU,wBAatB,CAAA;IAEM,MAAM,UAAU,2BAEtB,CAAA;IAEM,MAAM,MAAM,+BAElB,CAAA;IAEM,MAAM,WAAW,+BAEvB,CAAA;IAED;;OAEG;IACI,MAAM,QAAQ,wBAEpB,CAAA;IAED;;OAEG;IACI,MAAM,WAAW,sCASvB,CAAA;IAED;;OAEG;IACI,MAAM,SAAS,wBAErB,CAAA;IAED;;OAEG;IACI,MAAM,WAAW,2BAEvB,CAAA;IAEM,MAAM,YAAY,wBAKxB,CAAA;IAED;;OAEG;IACI,MAAM,UAAU,wBAEtB,CAAA;IAED;;OAEG;IACI,MAAM,UAAU,2CAGtB,CAAA;IAED;;OAEG;IACI,MAAM,OAAO,yCAanB,CAAA;IAEM,MAAM,KAAK,6BAGjB,CAAA;IAEM,MAAM,UAAU,oCAMtB,CAAA;IAED;;OAEG;IACI,MAAM,IAAI,uDAIhB,CAAA;IAEM,MAAM,iBAAiB,yCAY7B,CAAA;IAEM,MAAM,iBAAiB,yBAgB7B,CAAA;CAEF;AAED,eAAe,QAAQ,CAAA"} \ No newline at end of file diff --git a/dist/esm/src/dateutil.js b/dist/esm/src/dateutil.js deleted file mode 100644 index 3ec5e8be..00000000 --- a/dist/esm/src/dateutil.js +++ /dev/null @@ -1,146 +0,0 @@ -import { padStart } from './helpers'; -/** - * General date-related utilities. - * Also handles several incompatibilities between JavaScript and Python - * - */ -export var dateutil; -(function (dateutil) { - dateutil.MONTH_DAYS = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; - /** - * Number of milliseconds of one day - */ - dateutil.ONE_DAY = 1000 * 60 * 60 * 24; - /** - * @see: - */ - dateutil.MAXYEAR = 9999; - /** - * Python uses 1-Jan-1 as the base for calculating ordinals but we don't - * want to confuse the JS engine with milliseconds > Number.MAX_NUMBER, - * therefore we use 1-Jan-1970 instead - */ - dateutil.ORDINAL_BASE = new Date(Date.UTC(1970, 0, 1)); - /** - * Python: MO-SU: 0 - 6 - * JS: SU-SAT 0 - 6 - */ - dateutil.PY_WEEKDAYS = [6, 0, 1, 2, 3, 4, 5]; - /** - * py_date.timetuple()[7] - */ - dateutil.getYearDay = function (date) { - var dateNoTime = new Date(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate()); - return (Math.ceil((dateNoTime.valueOf() - - new Date(date.getUTCFullYear(), 0, 1).valueOf()) / - dateutil.ONE_DAY) + 1); - }; - dateutil.isLeapYear = function (year) { - return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0; - }; - dateutil.isDate = function (value) { - return value instanceof Date; - }; - dateutil.isValidDate = function (value) { - return dateutil.isDate(value) && !isNaN(value.getTime()); - }; - /** - * @return {Number} the date's timezone offset in ms - */ - dateutil.tzOffset = function (date) { - return date.getTimezoneOffset() * 60 * 1000; - }; - /** - * @see: - */ - dateutil.daysBetween = function (date1, date2) { - // The number of milliseconds in one day - // Convert both dates to milliseconds - var date1ms = date1.getTime() - dateutil.tzOffset(date1); - var date2ms = date2.getTime() - dateutil.tzOffset(date2); - // Calculate the difference in milliseconds - var differencems = date1ms - date2ms; - // Convert back to days and return - return Math.round(differencems / dateutil.ONE_DAY); - }; - /** - * @see: - */ - dateutil.toOrdinal = function (date) { - return dateutil.daysBetween(date, dateutil.ORDINAL_BASE); - }; - /** - * @see - - */ - dateutil.fromOrdinal = function (ordinal) { - return new Date(dateutil.ORDINAL_BASE.getTime() + ordinal * dateutil.ONE_DAY); - }; - dateutil.getMonthDays = function (date) { - var month = date.getUTCMonth(); - return month === 1 && dateutil.isLeapYear(date.getUTCFullYear()) - ? 29 - : dateutil.MONTH_DAYS[month]; - }; - /** - * @return {Number} python-like weekday - */ - dateutil.getWeekday = function (date) { - return dateutil.PY_WEEKDAYS[date.getUTCDay()]; - }; - /** - * @see: - */ - dateutil.monthRange = function (year, month) { - var date = new Date(Date.UTC(year, month, 1)); - return [dateutil.getWeekday(date), dateutil.getMonthDays(date)]; - }; - /** - * @see: - */ - dateutil.combine = function (date, time) { - time = time || date; - return new Date(Date.UTC(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate(), time.getHours(), time.getMinutes(), time.getSeconds(), time.getMilliseconds())); - }; - dateutil.clone = function (date) { - var dolly = new Date(date.getTime()); - return dolly; - }; - dateutil.cloneDates = function (dates) { - var clones = []; - for (var i = 0; i < dates.length; i++) { - clones.push(dateutil.clone(dates[i])); - } - return clones; - }; - /** - * Sorts an array of Date or dateutil.Time objects - */ - dateutil.sort = function (dates) { - dates.sort(function (a, b) { - return a.getTime() - b.getTime(); - }); - }; - dateutil.timeToUntilString = function (time, utc) { - if (utc === void 0) { utc = true; } - var date = new Date(time); - return [ - padStart(date.getUTCFullYear().toString(), 4, '0'), - padStart(date.getUTCMonth() + 1, 2, '0'), - padStart(date.getUTCDate(), 2, '0'), - 'T', - padStart(date.getUTCHours(), 2, '0'), - padStart(date.getUTCMinutes(), 2, '0'), - padStart(date.getUTCSeconds(), 2, '0'), - utc ? 'Z' : '' - ].join(''); - }; - dateutil.untilStringToDate = function (until) { - var re = /^(\d{4})(\d{2})(\d{2})(T(\d{2})(\d{2})(\d{2})Z?)?$/; - var bits = re.exec(until); - if (!bits) - throw new Error("Invalid UNTIL value: " + until); - return new Date(Date.UTC(parseInt(bits[1], 10), parseInt(bits[2], 10) - 1, parseInt(bits[3], 10), parseInt(bits[5], 10) || 0, parseInt(bits[6], 10) || 0, parseInt(bits[7], 10) || 0)); - }; -})(dateutil || (dateutil = {})); -export default dateutil; -//# sourceMappingURL=dateutil.js.map \ No newline at end of file diff --git a/dist/esm/src/dateutil.js.map b/dist/esm/src/dateutil.js.map deleted file mode 100644 index c36419fd..00000000 --- a/dist/esm/src/dateutil.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"dateutil.js","sourceRoot":"","sources":["../../../src/dateutil.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AAKpC;;;;GAIG;AACH,MAAM,KAAW,QAAQ,CAyLxB;AAzLD,WAAiB,QAAQ;IACV,mBAAU,GAAG,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAA;IAE1E;;OAEG;IACU,gBAAO,GAAG,IAAI,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAA;IAE1C;;OAEG;IACU,gBAAO,GAAG,IAAI,CAAA;IAE3B;;;;OAIG;I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AE,CAAC,IAAI,CAAC,EAC1B,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,EAC1B,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,CAC3B,CACF,CAAA;IACH,CAAC,CAAA;AAEH,CAAC,EAzLgB,QAAQ,KAAR,QAAQ,QAyLxB;AAED,eAAe,QAAQ,CAAA"} \ No newline at end of file diff --git a/dist/esm/src/datewithzone.d.ts b/dist/esm/src/datewithzone.d.ts deleted file mode 100644 index 6d428c8d..00000000 --- a/dist/esm/src/datewithzone.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -export declare class DateWithZone { - date: Date; - tzid?: string | null; - constructor(date: Date, tzid?: string | null); - private get isUTC(); - toString(): string; - getTime(): number; - rezonedDate(): Date; -} -//# sourceMappingURL=datewithzone.d.ts.map \ No newline at end of file diff --git a/dist/esm/src/datewithzone.d.ts.map b/dist/esm/src/datewithzone.d.ts.map deleted file mode 100644 index 28e07370..00000000 --- a/dist/esm/src/datewithzone.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"datewithzone.d.ts","sourceRoot":"","sources":["../../../src/datewithzone.ts"],"names":[],"mappings":"AAGA,qBAAa,YAAY;IAChB,IAAI,EAAE,IAAI,CAAA;IACV,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;gBAEd,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI;IAK7C,OAAO,KAAK,KAAK,GAEhB;IAEM,QAAQ;IASR,OAAO;IAIP,WAAW;CAmBnB"} \ No newline at end of file diff --git a/dist/esm/src/datewithzone.js b/dist/esm/src/datewithzone.js deleted file mode 100644 index e03ae4d7..00000000 --- a/dist/esm/src/datewithzone.js +++ /dev/null @@ -1,45 +0,0 @@ -import dateutil from './dateutil'; -import { DateTime } from 'luxon'; -var DateWithZone = /** @class */ (function () { - function DateWithZone(date, tzid) { - this.date = date; - this.tzid = tzid; - } - Object.defineProperty(DateWithZone.prototype, "isUTC", { - get: function () { - return !this.tzid || this.tzid.toUpperCase() === 'UTC'; - }, - enumerable: true, - configurable: true - }); - DateWithZone.prototype.toString = function () { - var datestr = dateutil.timeToUntilString(this.date.getTime(), this.isUTC); - if (!this.isUTC) { - return ";TZID=" + this.tzid + ":" + datestr; - } - return ":" + datestr; - }; - DateWithZone.prototype.getTime = function () { - return this.date.getTime(); - }; - DateWithZone.prototype.rezonedDate = function () { - if (this.isUTC) { - return this.date; - } - try { - var datetime = DateTime - .fromJSDate(this.date); - var rezoned = datetime.setZone(this.tzid, { keepLocalTime: true }); - return rezoned.toJSDate(); - } - catch (e) { - if (e instanceof TypeError) { - console.error('Using TZID without Luxon available is unsupported. Returned times are in UTC, not the requested time zone'); - } - return this.date; - } - }; - return DateWithZone; -}()); -export { DateWithZone }; -//# sourceMappingURL=datewithzone.js.map \ No newline at end of file diff --git a/dist/esm/src/datewithzone.js.map b/dist/esm/src/datewithzone.js.map deleted file mode 100644 index 2527b386..00000000 --- a/dist/esm/src/datewithzone.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"datewithzone.js","sourceRoot":"","sources":["../../../src/datewithzone.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,YAAY,CAAA;AACjC,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAEhC;IAIE,sBAAa,IAAU,EAAE,IAAoB;QAC3C,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;QAChB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;IAClB,CAAC;IAED,sBAAY,+BAAK;aAAjB;YACE,OAAO,CAAC,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,KAAK,CAAA;QACxD,CAAC;;;OAAA;IAEM,+BAAQ,GAAf;QACE,IAAM,OAAO,GAAG,QAAQ,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC,CAAA;QAC3E,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE;YACf,OAAO,WAAS,IAAI,CAAC,IAAI,SAAI,OAAS,CAAA;SACvC;QAED,OAAO,MAAI,OAAS,CAAA;IACtB,CAAC;IAEM,8BAAO,GAAd;QACE,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAA;IAC5B,CAAC;IAEM,kCAAW,GAAlB;QACE,IAAI,IAAI,CAAC,KAAK,EAAE;YACd,OAAO,IAAI,CAAC,IAAI,CAAA;SACjB;QAED,IAAI;YACF,IAAM,QAAQ,GAAG,QAAQ;iBACtB,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;YAExB,IAAM,OAAO,GAAG,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,IAAK,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAA;YAErE,OAAO,OAAO,CAAC,QAAQ,EAAE,CAAA;SAC1B;QAAC,OAAO,CAAC,EAAE;YACV,IAAI,CAAC,YAAY,SAAS,EAAE;gBAC1B,OAAO,CAAC,KAAK,CAAC,2GAA2G,CAAC,CAAA;aAC3H;YACD,OAAO,IAAI,CAAC,IAAI,CAAA;SACjB;IACH,CAAC;IACH,mBAAC;AAAD,CAAC,AA7CD,IA6CC"} \ No newline at end of file diff --git a/dist/esm/src/fake-luxon.d.ts b/dist/esm/src/fake-luxon.d.ts deleted file mode 100644 index a772f1fa..00000000 --- a/dist/esm/src/fake-luxon.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export declare const DateTime: { - fromJSDate(): never; -}; -//# sourceMappingURL=fake-luxon.d.ts.map \ No newline at end of file diff --git a/dist/esm/src/fake-luxon.d.ts.map b/dist/esm/src/fake-luxon.d.ts.map deleted file mode 100644 index 99428aaa..00000000 --- a/dist/esm/src/fake-luxon.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"fake-luxon.d.ts","sourceRoot":"","sources":["../../../src/fake-luxon.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ;;CAIpB,CAAA"} \ No newline at end of file diff --git a/dist/esm/src/fake-luxon.js b/dist/esm/src/fake-luxon.js deleted file mode 100644 index efd05ad9..00000000 --- a/dist/esm/src/fake-luxon.js +++ /dev/null @@ -1,6 +0,0 @@ -export var DateTime = { - fromJSDate: function () { - throw new TypeError(); - } -}; -//# sourceMappingURL=fake-luxon.js.map \ No newline at end of file diff --git a/dist/esm/src/fake-luxon.js.map b/dist/esm/src/fake-luxon.js.map deleted file mode 100644 index 390790bc..00000000 --- a/dist/esm/src/fake-luxon.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"fake-luxon.js","sourceRoot":"","sources":["../../../src/fake-luxon.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,IAAM,QAAQ,GAAG;IACtB,UAAU;QACR,MAAM,IAAI,SAAS,EAAE,CAAA;IACvB,CAAC;CACF,CAAA"} \ No newline at end of file diff --git a/dist/esm/src/helpers.d.ts b/dist/esm/src/helpers.d.ts deleted file mode 100644 index e9726ed8..00000000 --- a/dist/esm/src/helpers.d.ts +++ /dev/null @@ -1,53 +0,0 @@ -import { WeekdayStr } from './weekday'; -export declare const isPresent: (value?: T | null | undefined) => value is T; -export declare const isNumber: (value?: any) => value is number; -export declare const isWeekdayStr: (value?: any) => value is WeekdayStr; -export declare const isArray: (arg: any) => arg is any[]; -/** - * Simplified version of python's range() - */ -export declare const range: (start: number, end?: number) => number[]; -export declare const clone: (array: T[]) => T[]; -export declare const repeat: (value: T | T[], times: number) => (T | T[])[]; -export declare const toArray: (item: T | T[]) => T[]; -export declare function padStart(item: string | number, targetLength: number, padString?: string): string; -/** - * Python like split - */ -export declare const split: (str: string, sep: string, num: number) => string[]; -/** - * closure/goog/math/math.js:modulo - * Copyright 2006 The Closure Library Authors. - * The % operator in JavaScript returns the remainder of a / b, but differs from - * some other languages in that the result will have the same sign as the - * dividend. For example, -1 % 8 == -1, whereas in some other languages - * (such as Python) the result would be 7. This function emulates the more - * correct modulo behavior, which is useful for certain applications such as - * calculating an offset index in a circular list. - * - * @param {number} a The dividend. - * @param {number} b The divisor. - * @return {number} a % b where the result is between 0 and b (either 0 <= x < b - * or b < x <= 0, depending on the sign of b). - */ -export declare const pymod: (a: number, b: number) => number; -/** - * @see: - */ -export declare const divmod: (a: number, b: number) => { - div: number; - mod: number; -}; -export declare const empty: (obj: T[] | null | undefined) => boolean; -/** - * Python-like boolean - * @return {Boolean} value of an object/primitive, taking into account - * the fact that in Python an empty list's/tuple's - * boolean value is False, whereas in JS it's true - */ -export declare const notEmpty: (obj: T[] | null | undefined) => obj is T[]; -/** - * Return true if a value is in an array - */ -export declare const includes: (arr: T[] | null | undefined, val: T) => boolean; -//# sourceMappingURL=helpers.d.ts.map \ No newline at end of file diff --git a/dist/esm/src/helpers.d.ts.map b/dist/esm/src/helpers.d.ts.map deleted file mode 100644 index a06712db..00000000 --- a/dist/esm/src/helpers.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/helpers.ts"],"names":[],"mappings":"AAIA,OAAO,EAAgB,UAAU,EAAE,MAAM,WAAW,CAAA;AAEpD,eAAO,MAAM,SAAS,iDAErB,CAAA;AAED,eAAO,MAAM,QAAQ,kCAEpB,CAAA;AAED,eAAO,MAAM,YAAY,sCAExB,CAAA;AAED,eAAO,MAAM,OAAO,4BAAgB,CAAA;AAEpC;;GAEG;AACH,eAAO,MAAM,KAAK,2CAQjB,CAAA;AAED,eAAO,MAAM,KAAK,wBAEjB,CAAA;AAED,eAAO,MAAM,MAAM,mDAUlB,CAAA;AAED,eAAO,MAAM,OAAO,2BAMnB,CAAA;AAED,wBAAgB,QAAQ,CAAE,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,SAAS,GAAE,MAAY,UAa7F;AAED;;GAEG;AACH,eAAO,MAAM,KAAK,qDAKjB,CAAA;AAED;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,KAAK,kCAIjB,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,MAAM;;;CAElB,CAAA;AAED,eAAO,MAAM,KAAK,6CAEjB,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,QAAQ,gDAEpB,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,QAAQ,qDAEpB,CAAA"} \ No newline at end of file diff --git a/dist/esm/src/helpers.js b/dist/esm/src/helpers.js deleted file mode 100644 index a83130d1..00000000 --- a/dist/esm/src/helpers.js +++ /dev/null @@ -1,117 +0,0 @@ -// ============================================================================= -// Helper functions -// ============================================================================= -import { ALL_WEEKDAYS } from './weekday'; -export var isPresent = function (value) { - return value !== null && value !== undefined; -}; -export var isNumber = function (value) { - return typeof value === 'number'; -}; -export var isWeekdayStr = function (value) { - return ALL_WEEKDAYS.indexOf(value) >= 0; -}; -export var isArray = Array.isArray; -/** - * Simplified version of python's range() - */ -export var range = function (start, end) { - if (end === void 0) { end = start; } - if (arguments.length === 1) { - end = start; - start = 0; - } - var rang = []; - for (var i = start; i < end; i++) - rang.push(i); - return rang; -}; -export var clone = function (array) { - return [].concat(array); -}; -export var repeat = function (value, times) { - var i = 0; - var array = []; - if (isArray(value)) { - for (; i < times; i++) - array[i] = [].concat(value); - } - else { - for (; i < times; i++) - array[i] = value; - } - return array; -}; -export var toArray = function (item) { - if (isArray(item)) { - return item; - } - return [item]; -}; -export function padStart(item, targetLength, padString) { - if (padString === void 0) { padString = ' '; } - var str = String(item); - targetLength = targetLength >> 0; - if (str.length > targetLength) { - return String(str); - } - targetLength = targetLength - str.length; - if (targetLength > padString.length) { - padString += repeat(padString, targetLength / padString.length); - } - return padString.slice(0, targetLength) + String(str); -} -/** - * Python like split - */ -export var split = function (str, sep, num) { - var splits = str.split(sep); - return num - ? splits.slice(0, num).concat([splits.slice(num).join(sep)]) - : splits; -}; -/** - * closure/goog/math/math.js:modulo - * Copyright 2006 The Closure Library Authors. - * The % operator in JavaScript returns the remainder of a / b, but differs from - * some other languages in that the result will have the same sign as the - * dividend. For example, -1 % 8 == -1, whereas in some other languages - * (such as Python) the result would be 7. This function emulates the more - * correct modulo behavior, which is useful for certain applications such as - * calculating an offset index in a circular list. - * - * @param {number} a The dividend. - * @param {number} b The divisor. - * @return {number} a % b where the result is between 0 and b (either 0 <= x < b - * or b < x <= 0, depending on the sign of b). - */ -export var pymod = function (a, b) { - var r = a % b; - // If r and b differ in sign, add b to wrap the result to the correct sign. - return r * b < 0 ? r + b : r; -}; -/** - * @see: - */ -export var divmod = function (a, b) { - return { div: Math.floor(a / b), mod: pymod(a, b) }; -}; -export var empty = function (obj) { - return !isPresent(obj) || obj.length === 0; -}; -/** - * Python-like boolean - * @return {Boolean} value of an object/primitive, taking into account - * the fact that in Python an empty list's/tuple's - * boolean value is False, whereas in JS it's true - */ -export var notEmpty = function (obj) { - return !empty(obj); -}; -/** - * Return true if a value is in an array - */ -export var includes = function (arr, val) { - return notEmpty(arr) && arr.indexOf(val) !== -1; -}; -//# sourceMappingURL=helpers.js.map \ No newline at end of file diff --git a/dist/esm/src/helpers.js.map b/dist/esm/src/helpers.js.map deleted file mode 100644 index 0dfa2aca..00000000 --- a/dist/esm/src/helpers.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../src/helpers.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,mBAAmB;AACnB,gFAAgF;AAEhF,OAAO,EAAE,YAAY,EAAc,MAAM,WAAW,CAAA;AAEpD,MAAM,CAAC,IAAM,SAAS,GAAG,UAAY,KAA4B;IAC/D,OAAO,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,CAAA;AAC9C,CAAC,CAAA;AAED,MAAM,CAAC,IAAM,QAAQ,GAAG,UAAU,KAAW;IAC3C,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAA;AAClC,C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AC,CAAA;IACf,2EAA2E;IAC3E,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;AAC9B,CAAC,CAAA;AAED;;GAEG;AACH,MAAM,CAAC,IAAM,MAAM,GAAG,UAAU,CAAS,EAAE,CAAS;IAClD,OAAO,EAAE,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAA;AACrD,CAAC,CAAA;AAED,MAAM,CAAC,IAAM,KAAK,GAAG,UAAY,GAA2B;IAC1D,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC,CAAA;AAC5C,CAAC,CAAA;AAED;;;;;GAKG;AACH,MAAM,CAAC,IAAM,QAAQ,GAAG,UAAY,GAA2B;IAC7D,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;AACpB,CAAC,CAAA;AAED;;GAEG;AACH,MAAM,CAAC,IAAM,QAAQ,GAAG,UAAY,GAA2B,EAAE,GAAM;IACrE,OAAO,QAAQ,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAA;AACjD,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/esm/src/index.d.ts b/dist/esm/src/index.d.ts deleted file mode 100644 index 722332e6..00000000 --- a/dist/esm/src/index.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -/*! - * rrule.js - Library for working with recurrence rules for calendar dates. - * https://github.com/jakubroztocil/rrule - * - * Copyright 2010, Jakub Roztocil and Lars Schoning - * Licenced under the BSD licence. - * https://github.com/jakubroztocil/rrule/blob/master/LICENCE - * - * Based on: - * python-dateutil - Extensions to the standard Python datetime module. - * Copyright (c) 2003-2011 - Gustavo Niemeyer - * Copyright (c) 2012 - Tomi Pieviläinen - * https://github.com/jakubroztocil/rrule/blob/master/LICENCE - * - */ -import RRule from './rrule'; -import RRuleSet from './rruleset'; -export { rrulestr } from './rrulestr'; -export { Frequency, ByWeekday, Options } from './types'; -export { Weekday, WeekdayStr } from './weekday'; -export { RRuleStrOptions } from './rrulestr'; -export { RRule, RRuleSet }; -export default RRule; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/dist/esm/src/index.d.ts.map b/dist/esm/src/index.d.ts.map deleted file mode 100644 index 4cfa6892..00000000 --- a/dist/esm/src/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,MAAM,SAAS,CAAA;AAC3B,OAAO,QAAQ,MAAM,YAAY,CAAA;AAEjC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AACvD,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAE5C,OAAO,EACL,KAAK,EACL,QAAQ,EACT,CAAA;AAED,eAAe,KAAK,CAAA"} \ No newline at end of file diff --git a/dist/esm/src/index.js b/dist/esm/src/index.js deleted file mode 100644 index bb2d77bc..00000000 --- a/dist/esm/src/index.js +++ /dev/null @@ -1,23 +0,0 @@ -/*! - * rrule.js - Library for working with recurrence rules for calendar dates. - * https://github.com/jakubroztocil/rrule - * - * Copyright 2010, Jakub Roztocil and Lars Schoning - * Licenced under the BSD licence. - * https://github.com/jakubroztocil/rrule/blob/master/LICENCE - * - * Based on: - * python-dateutil - Extensions to the standard Python datetime module. - * Copyright (c) 2003-2011 - Gustavo Niemeyer - * Copyright (c) 2012 - Tomi Pieviläinen - * https://github.com/jakubroztocil/rrule/blob/master/LICENCE - * - */ -import RRule from './rrule'; -import RRuleSet from './rruleset'; -export { rrulestr } from './rrulestr'; -export { Frequency } from './types'; -export { Weekday } from './weekday'; -export { RRule, RRuleSet }; -export default RRule; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/esm/src/index.js.map b/dist/esm/src/index.js.map deleted file mode 100644 index 4aefdb11..00000000 --- a/dist/esm/src/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,MAAM,SAAS,CAAA;AAC3B,OAAO,QAAQ,MAAM,YAAY,CAAA;AAEjC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,SAAS,EAAsB,MAAM,SAAS,CAAA;AACvD,OAAO,EAAE,OAAO,EAAc,MAAM,WAAW,CAAA;AAG/C,OAAO,EACL,KAAK,EACL,QAAQ,EACT,CAAA;AAED,eAAe,KAAK,CAAA"} \ No newline at end of file diff --git a/dist/esm/src/iter/index.d.ts b/dist/esm/src/iter/index.d.ts deleted file mode 100644 index 365ff126..00000000 --- a/dist/esm/src/iter/index.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import IterResult from '../iterresult'; -import { ParsedOptions, QueryMethodTypes } from '../types'; -export declare function iter(iterResult: IterResult, options: ParsedOptions): import("../types").IterResultType; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/dist/esm/src/iter/index.d.ts.map b/dist/esm/src/iter/index.d.ts.map deleted file mode 100644 index e4e73b3c..00000000 --- a/dist/esm/src/iter/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/iter/index.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,eAAe,CAAA;AACtC,OAAO,EAAE,aAAa,EAAwB,gBAAgB,EAAE,MAAM,UAAU,CAAA;AAUhF,wBAAgB,IAAI,CAAE,CAAC,SAAS,gBAAgB,EAAG,UAAU,EAAE,UAAU,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,aAAa,wCAqGnG"} \ No newline at end of file diff --git a/dist/esm/src/iter/index.js b/dist/esm/src/iter/index.js deleted file mode 100644 index fb11b71e..00000000 --- a/dist/esm/src/iter/index.js +++ /dev/null @@ -1,138 +0,0 @@ -import { freqIsDailyOrGreater } from '../types'; -import dateutil from '../dateutil'; -import Iterinfo from '../iterinfo/index'; -import RRule from '../rrule'; -import { buildTimeset } from '../parseoptions'; -import { notEmpty, includes, isPresent } from '../helpers'; -import { DateWithZone } from '../datewithzone'; -import { buildPoslist } from './poslist'; -import { DateTime } from '../datetime'; -export function iter(iterResult, options) { - var dtstart = options.dtstart, freq = options.freq, interval = options.interval, until = options.until, bysetpos = options.bysetpos; - var count = options.count; - if (count === 0 || interval === 0) { - return emitResult(iterResult); - } - var counterDate = DateTime.fromDate(dtstart); - var ii = new Iterinfo(options); - ii.rebuild(counterDate.year, counterDate.month); - var timeset = makeTimeset(ii, counterDate, options); - while (true) { - var _a = ii.getdayset(freq)(counterDate.year, counterDate.month, counterDate.day), dayset = _a[0], start = _a[1], end = _a[2]; - var filtered = removeFilteredDays(dayset, start, end, ii, options); - if (notEmpty(bysetpos)) { - var poslist = buildPoslist(bysetpos, timeset, start, end, ii, dayset); - for (var j = 0; j < poslist.length; j++) { - var res = poslist[j]; - if (until && res > until) { - return emitResult(iterResult); - } - if (res >= dtstart) { - var rezonedDate = rezoneIfNeeded(res, options); - if (!iterResult.accept(rezonedDate)) { - return emitResult(iterResult); - } - if (count) { - --count; - if (!count) { - return emitResult(iterResult); - } - } - } - } - } - else { - for (var j = start; j < end; j++) { - var currentDay = dayset[j]; - if (!isPresent(currentDay)) { - continue; - } - var date = dateutil.fromOrdinal(ii.yearordinal + currentDay); - for (var k = 0; k < timeset.length; k++) { - var time = timeset[k]; - var res = dateutil.combine(date, time); - if (until && res > until) { - return emitResult(iterResult); - } - if (res >= dtstart) { - var rezonedDate = rezoneIfNeeded(res, options); - if (!iterResult.accept(rezonedDate)) { - return emitResult(iterResult); - } - if (count) { - --count; - if (!count) { - return emitResult(iterResult); - } - } - } - } - } - } - if (options.interval === 0) { - return emitResult(iterResult); - } - // Handle frequency and interval - counterDate.add(options, filtered); - if (counterDate.year > dateutil.MAXYEAR) { - return emitResult(iterResult); - } - if (!freqIsDailyOrGreater(freq)) { - timeset = ii.gettimeset(freq)(counterDate.hour, counterDate.minute, counterDate.second, 0); - } - ii.rebuild(counterDate.year, counterDate.month); - } -} -function isFiltered(ii, currentDay, options) { - var bymonth = options.bymonth, byweekno = options.byweekno, byweekday = options.byweekday, byeaster = options.byeaster, bymonthday = options.bymonthday, bynmonthday = options.bynmonthday, byyearday = options.byyearday; - return ((notEmpty(bymonth) && !includes(bymonth, ii.mmask[currentDay])) || - (notEmpty(byweekno) && !ii.wnomask[currentDay]) || - (notEmpty(byweekday) && !includes(byweekday, ii.wdaymask[currentDay])) || - (notEmpty(ii.nwdaymask) && !ii.nwdaymask[currentDay]) || - (byeaster !== null && !includes(ii.eastermask, currentDay)) || - ((notEmpty(bymonthday) || notEmpty(bynmonthday)) && - !includes(bymonthday, ii.mdaymask[currentDay]) && - !includes(bynmonthday, ii.nmdaymask[currentDay])) || - (notEmpty(byyearday) && - ((currentDay < ii.yearlen && - !includes(byyearday, currentDay + 1) && - !includes(byyearday, -ii.yearlen + currentDay)) || - (currentDay >= ii.yearlen && - !includes(byyearday, currentDay + 1 - ii.yearlen) && - !includes(byyearday, -ii.nextyearlen + currentDay - ii.yearlen))))); -} -function rezoneIfNeeded(date, options) { - return new DateWithZone(date, options.tzid).rezonedDate(); -} -function emitResult(iterResult) { - return iterResult.getValue(); -} -function removeFilteredDays(dayset, start, end, ii, options) { - var filtered = false; - for (var dayCounter = start; dayCounter < end; dayCounter++) { - var currentDay = dayset[dayCounter]; - filtered = isFiltered(ii, currentDay, options); - if (filtered) - dayset[currentDay] = null; - } - return filtered; -} -function makeTimeset(ii, counterDate, options) { - var freq = options.freq, byhour = options.byhour, byminute = options.byminute, bysecond = options.bysecond; - if (freqIsDailyOrGreater(freq)) { - return buildTimeset(options); - } - if ((freq >= RRule.HOURLY && - notEmpty(byhour) && - !includes(byhour, counterDate.hour)) || - (freq >= RRule.MINUTELY && - notEmpty(byminute) && - !includes(byminute, counterDate.minute)) || - (freq >= RRule.SECONDLY && - notEmpty(bysecond) && - !includes(bysecond, counterDate.second))) { - return []; - } - return ii.gettimeset(freq)(counterDate.hour, counterDate.minute, counterDate.second, counterDate.millisecond); -} -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/esm/src/iter/index.js.map b/dist/esm/src/iter/index.js.map deleted file mode 100644 index 61c55c21..00000000 --- a/dist/esm/src/iter/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/iter/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAiB,oBAAoB,EAAoB,MAAM,UAAU,CAAA;AAChF,OAAO,QAAQ,MAAM,aAAa,CAAA;AAClC,OAAO,QAAQ,MAAM,mBAAmB,CAAA;AACxC,OAAO,KAAK,MAAM,UAAU,CAAA;AAC5B,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAC9C,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AACxC,OAAO,EAAQ,QAAQ,EAAE,MAAM,aAAa,CAAA;AAE5C,MAAM,UAAU,IAAI,CAA+B,UAAyB,EAAE,OAAsB;IAEhG,IAAA,yBAAO,EACP,mBAAI,EACJ,2BAAQ,EACR,qBAAK,EACL,2BAAQ,CACC;IAEX,IAAI,KAAK,GAAG,OAAO,CAAC,K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G,MAAM,CAAC,UAAU,CAAW,CAAA;QAE7C,QAAQ,GAAG,UAAU,CACnB,EAAE,EACF,UAAU,EACV,OAAO,CACR,CAAA;QAED,IAAI,QAAQ;YAAE,MAAM,CAAC,UAAU,CAAC,GAAG,IAAI,CAAA;KACxC;IAED,OAAO,QAAQ,CAAA;AACjB,CAAC;AAED,SAAS,WAAW,CAAE,EAAY,EAAE,WAAqB,EAAE,OAAsB;IAE7E,IAAA,mBAAI,EACJ,uBAAM,EACN,2BAAQ,EACR,2BAAQ,CACC;IAEX,IAAI,oBAAoB,CAAC,IAAI,CAAC,EAAE;QAC9B,OAAO,YAAY,CAAC,OAAO,CAAC,CAAA;KAC7B;IAED,IACE,CAAC,IAAI,IAAI,KAAK,CAAC,MAAM;QACnB,QAAQ,CAAC,MAAM,CAAC;QAChB,CAAC,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC,IAAI,CAAC,CAAC;QACtC,CAAC,IAAI,IAAI,KAAK,CAAC,QAAQ;YACrB,QAAQ,CAAC,QAAQ,CAAC;YAClB,CAAC,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;QAC1C,CAAC,IAAI,IAAI,KAAK,CAAC,QAAQ;YACrB,QAAQ,CAAC,QAAQ,CAAC;YAClB,CAAC,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC,EAC1C;QACA,OAAO,EAAE,CAAA;KACV;IAED,OAAO,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,CACxB,WAAW,CAAC,IAAI,EAChB,WAAW,CAAC,MAAM,EAClB,WAAW,CAAC,MAAM,EAClB,WAAW,CAAC,WAAW,CACxB,CAAA;AACH,CAAC"} \ No newline at end of file diff --git a/dist/esm/src/iter/poslist.d.ts b/dist/esm/src/iter/poslist.d.ts deleted file mode 100644 index d86bf9c1..00000000 --- a/dist/esm/src/iter/poslist.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import Iterinfo from '../iterinfo/index'; -import { Time } from '../datetime'; -export declare function buildPoslist(bysetpos: number[], timeset: Time[], start: number, end: number, ii: Iterinfo, dayset: (number | null)[]): Date[]; -//# sourceMappingURL=poslist.d.ts.map \ No newline at end of file diff --git a/dist/esm/src/iter/poslist.d.ts.map b/dist/esm/src/iter/poslist.d.ts.map deleted file mode 100644 index 393961df..00000000 --- a/dist/esm/src/iter/poslist.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"poslist.d.ts","sourceRoot":"","sources":["../../../../src/iter/poslist.ts"],"names":[],"mappings":"AACA,OAAO,QAAQ,MAAM,mBAAmB,CAAA;AAExC,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAElC,wBAAgB,YAAY,CAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,UAwCrI"} \ No newline at end of file diff --git a/dist/esm/src/iter/poslist.js b/dist/esm/src/iter/poslist.js deleted file mode 100644 index 4f1d3b79..00000000 --- a/dist/esm/src/iter/poslist.js +++ /dev/null @@ -1,42 +0,0 @@ -import dateutil from '../dateutil'; -import { pymod, isPresent, includes } from '../helpers'; -export function buildPoslist(bysetpos, timeset, start, end, ii, dayset) { - var poslist = []; - for (var j = 0; j < bysetpos.length; j++) { - var daypos = void 0; - var timepos = void 0; - var pos = bysetpos[j]; - if (pos < 0) { - daypos = Math.floor(pos / timeset.length); - timepos = pymod(pos, timeset.length); - } - else { - daypos = Math.floor((pos - 1) / timeset.length); - timepos = pymod(pos - 1, timeset.length); - } - var tmp = []; - for (var k = start; k < end; k++) { - var val = dayset[k]; - if (!isPresent(val)) - continue; - tmp.push(val); - } - var i = void 0; - if (daypos < 0) { - i = tmp.slice(daypos)[0]; - } - else { - i = tmp[daypos]; - } - var time = timeset[timepos]; - var date = dateutil.fromOrdinal(ii.yearordinal + i); - var res = dateutil.combine(date, time); - // XXX: can this ever be in the array? - // - compare the actual date instead? - if (!includes(poslist, res)) - poslist.push(res); - } - dateutil.sort(poslist); - return poslist; -} -//# sourceMappingURL=poslist.js.map \ No newline at end of file diff --git a/dist/esm/src/iter/poslist.js.map b/dist/esm/src/iter/poslist.js.map deleted file mode 100644 index c538a31e..00000000 --- a/dist/esm/src/iter/poslist.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"poslist.js","sourceRoot":"","sources":["../../../../src/iter/poslist.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,aAAa,CAAA;AAElC,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAGvD,MAAM,UAAU,YAAY,CAAE,QAAkB,EAAE,OAAe,EAAE,KAAa,EAAE,GAAW,EAAE,EAAY,EAAE,MAAyB;IACpI,IAAM,OAAO,GAAW,EAAE,CAAA;IAE1B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACxC,IAAI,MAAM,SAAQ,CAAA;QAClB,IAAI,OAAO,SAAQ,CAAA;QACnB,IAAM,GAAG,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAA;QAEvB,IAAI,GAAG,GAAG,CAAC,EAAE;YACX,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;YACzC,OAAO,GAAG,KAAK,CAAC,GAAG,EAAE,OAAO,CAAC,MAAM,CAAC,CAAA;SACrC;aAAM;YACL,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;YAC/C,OAAO,GAAG,KAAK,CAAC,GAAG,GAAG,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,CAAA;SACzC;QAED,IAAM,GAAG,GAAG,EAAE,CAAA;QACd,KAAK,IAAI,CAAC,GAAG,KAAK,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,EAAE,EAAE;YAChC,IAAM,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,CAAA;YACrB,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC;gBAAE,SAAQ;YAC7B,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;SACd;QACD,IAAI,CAAC,SAAQ,CAAA;QACb,IAAI,MAAM,GAAG,CAAC,EAAE;YACd,CAAC,GAAG,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAA;SACzB;aAAM;YACL,CAAC,GAAG,GAAG,CAAC,MAAM,CAAC,CAAA;SAChB;QAED,IAAM,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;QAC7B,IAAM,IAAI,GAAG,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC,WAAW,GAAG,CAAC,CAAC,CAAA;QACrD,IAAM,GAAG,GAAG,QAAQ,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,CAAA;QACxC,sCAAsC;QACtC,qCAAqC;QACrC,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,GAAG,CAAC;YAAE,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;KAC/C;IAED,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;IAEtB,OAAO,OAAO,CAAA;AAChB,CAAC"} \ No newline at end of file diff --git a/dist/esm/src/iterinfo/easter.d.ts b/dist/esm/src/iterinfo/easter.d.ts deleted file mode 100644 index 4803ea48..00000000 --- a/dist/esm/src/iterinfo/easter.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare function easter(y: number, offset?: number): number[]; -//# sourceMappingURL=easter.d.ts.map \ No newline at end of file diff --git a/dist/esm/src/iterinfo/easter.d.ts.map b/dist/esm/src/iterinfo/easter.d.ts.map deleted file mode 100644 index 17dee0b9..00000000 --- a/dist/esm/src/iterinfo/easter.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"easter.d.ts","sourceRoot":"","sources":["../../../../src/iterinfo/easter.ts"],"names":[],"mappings":"AAAA,wBAAgB,MAAM,CAAE,CAAC,EAAE,MAAM,EAAE,MAAM,GAAE,MAAU,YAmBpD"} \ No newline at end of file diff --git a/dist/esm/src/iterinfo/easter.js b/dist/esm/src/iterinfo/easter.js deleted file mode 100644 index a2a27319..00000000 --- a/dist/esm/src/iterinfo/easter.js +++ /dev/null @@ -1,21 +0,0 @@ -export function easter(y, offset) { - if (offset === void 0) { offset = 0; } - var a = y % 19; - var b = Math.floor(y / 100); - var c = y % 100; - var d = Math.floor(b / 4); - var e = b % 4; - var f = Math.floor((b + 8) / 25); - var g = Math.floor((b - f + 1) / 3); - var h = Math.floor(19 * a + b - d - g + 15) % 30; - var i = Math.floor(c / 4); - var k = c % 4; - var l = Math.floor(32 + 2 * e + 2 * i - h - k) % 7; - var m = Math.floor((a + 11 * h + 22 * l) / 451); - var month = Math.floor((h + l - 7 * m + 114) / 31); - var day = ((h + l - 7 * m + 114) % 31) + 1; - var date = Date.UTC(y, month - 1, day + offset); - var yearStart = Date.UTC(y, 0, 1); - return [Math.ceil((date - yearStart) / (1000 * 60 * 60 * 24))]; -} -//# sourceMappingURL=easter.js.map \ No newline at end of file diff --git a/dist/esm/src/iterinfo/easter.js.map b/dist/esm/src/iterinfo/easter.js.map deleted file mode 100644 index c0461f31..00000000 --- a/dist/esm/src/iterinfo/easter.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"easter.js","sourceRoot":"","sources":["../../../../src/iterinfo/easter.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,MAAM,CAAE,CAAS,EAAE,MAAkB;IAAlB,uBAAA,EAAA,UAAkB;IACnD,IAAM,CAAC,GAAG,CAAC,GAAG,EAAE,CAAA;IAChB,IAAM,CAAC,G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,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAA;IAC5C,IAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,GAAG,CAAC,EAAE,GAAG,GAAG,MAAM,CAAC,CAAA;IACjD,IAAM,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAA;IAEnC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,GAAG,SAAS,CAAC,GAAG,CAAC,IAAI,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,CAAA;AAChE,CAAC"} \ No newline at end of file diff --git a/dist/esm/src/iterinfo/index.d.ts b/dist/esm/src/iterinfo/index.d.ts deleted file mode 100644 index d31a6a78..00000000 --- a/dist/esm/src/iterinfo/index.d.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { ParsedOptions, Frequency } from '../types'; -import { YearInfo } from './yearinfo'; -import { MonthInfo } from './monthinfo'; -import { Time } from '../datetime'; -export declare type DaySet = [(number | null)[], number, number]; -export declare type GetDayset = () => DaySet; -export default class Iterinfo { - private options; - yearinfo: YearInfo; - monthinfo: MonthInfo; - eastermask: number[] | null; - constructor(options: ParsedOptions); - rebuild(year: number, month: number): void; - get lastyear(): number | null; - get lastmonth(): number | null; - get yearlen(): 366 | 365; - get yearordinal(): number; - get mrange(): number[]; - get wdaymask(): number[]; - get mmask(): number[]; - get wnomask(): number[] | null; - get nwdaymask(): number[]; - get nextyearlen(): 366 | 365; - get mdaymask(): number[]; - get nmdaymask(): number[]; - ydayset(): (number | number[])[]; - mdayset(_: any, month: number, __: any): (number | (number | (number | null)[] | null)[])[]; - wdayset(year: number, month: number, day: number): (number | (number | (number | null)[] | null)[])[]; - ddayset(year: number, month: number, day: number): (number | (number | null)[])[]; - htimeset(hour: number, _: number, second: number, millisecond: number): Time[]; - mtimeset(hour: number, minute: number, _: number, millisecond: number): Time[]; - stimeset(hour: number, minute: number, second: number, millisecond: number): Time[]; - getdayset(freq: Frequency): (y: number, m: number, d: number) => DaySet; - gettimeset(freq: Frequency.HOURLY | Frequency.MINUTELY | Frequency.SECONDLY): (h: number, m: number, s: number, ms: number) => Time[]; -} -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/dist/esm/src/iterinfo/index.d.ts.map b/dist/esm/src/iterinfo/index.d.ts.map deleted file mode 100644 index ff5fcdf2..00000000 --- a/dist/esm/src/iterinfo/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/iterinfo/index.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AACnD,OAAO,EAAE,QAAQ,EAAe,MAAM,YAAY,CAAA;AAClD,OAAO,EAAgB,SAAS,EAAE,MAAM,aAAa,CAAA;AAErD,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAElC,oBAAY,MAAM,GAAG,CAAC,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,CAAA;AACxD,oBAAY,SAAS,GAAG,MAAM,MAAM,CAAA;AAMpC,MAAM,CAAC,OAAO,OAAO,QAAQ;IAKd,OAAO,CAAC,OAAO;IAJrB,QAAQ,EAAE,QAAQ,CAAA;IAClB,SAAS,EAAE,SAAS,CAAA;IACpB,UAAU,EAAE,MAAM,EAAE,GAAG,IAAI,CAAA;gBAEb,OAAO,EAAE,aAAa;IAE3C,OAAO,CAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;IAsBpC,IAAI,QAAQ,kBAEX;IAED,IAAI,SAAS,kBAEZ;IAED,IAAI,OAAO,cAEV;IAED,IAAI,WAAW,WAEd;IAED,IAAI,MAAM,aAET;IAED,IAAI,QAAQ,aAEX;IAED,IAAI,KAAK,aAER;IAED,IAAI,OAAO,oBAEV;IAED,IAAI,SAAS,aAEZ;IAED,IAAI,WAAW,cAEd;IAED,IAAI,QAAQ,aAEX;IAED,IAAI,SAAS,aAEZ;IAED,OAAO;IAIP,OAAO,CAAE,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,GAAG;IAQvC,OAAO,CAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM;IAejD,OAAO,CAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM;IASjD,QAAQ,CAAE,IAAI,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM;IAStE,QAAQ,CAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM;IAStE,QAAQ,CAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM;IAI3E,SAAS,CAAE,IAAI,EAAE,SAAS,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,KAAK,MAAM;IAUxE,UAAU,CAAE,IAAI,EAAE,SAAS,CAAC,MAAM,GAAG,SAAS,CAAC,QAAQ,GAAG,SAAS,CAAC,QAAQ,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,KAAK,IAAI,EAAE;CAOvI"} \ No newline at end of file diff --git a/dist/esm/src/iterinfo/index.js b/dist/esm/src/iterinfo/index.js deleted file mode 100644 index 9ff2cb92..00000000 --- a/dist/esm/src/iterinfo/index.js +++ /dev/null @@ -1,183 +0,0 @@ -import dateutil from '../dateutil'; -import { notEmpty, repeat, range, isPresent } from '../helpers'; -import { Frequency } from '../types'; -import { rebuildYear } from './yearinfo'; -import { rebuildMonth } from './monthinfo'; -import { easter } from './easter'; -import { Time } from '../datetime'; -// ============================================================================= -// Iterinfo -// ============================================================================= -var Iterinfo = /** @class */ (function () { - function Iterinfo(options) { - this.options = options; - } - Iterinfo.prototype.rebuild = function (year, month) { - var options = this.options; - if (year !== this.lastyear) { - this.yearinfo = rebuildYear(year, options); - } - if (notEmpty(options.bynweekday) && - (month !== this.lastmonth || year !== this.lastyear)) { - var _a = this.yearinfo, yearlen = _a.yearlen, mrange = _a.mrange, wdaymask = _a.wdaymask; - this.monthinfo = rebuildMonth(year, month, yearlen, mrange, wdaymask, options); - } - if (isPresent(options.byeaster)) { - this.eastermask = easter(year, options.byeaster); - } - }; - Object.defineProperty(Iterinfo.prototype, "lastyear", { - get: function () { - return this.monthinfo ? this.monthinfo.lastyear : null; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(Iterinfo.prototype, "lastmonth", { - get: function () { - return this.monthinfo ? this.monthinfo.lastmonth : null; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(Iterinfo.prototype, "yearlen", { - get: function () { - return this.yearinfo.yearlen; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(Iterinfo.prototype, "yearordinal", { - get: function () { - return this.yearinfo.yearordinal; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(Iterinfo.prototype, "mrange", { - get: function () { - return this.yearinfo.mrange; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(Iterinfo.prototype, "wdaymask", { - get: function () { - return this.yearinfo.wdaymask; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(Iterinfo.prototype, "mmask", { - get: function () { - return this.yearinfo.mmask; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(Iterinfo.prototype, "wnomask", { - get: function () { - return this.yearinfo.wnomask; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(Iterinfo.prototype, "nwdaymask", { - get: function () { - return this.monthinfo ? this.monthinfo.nwdaymask : []; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(Iterinfo.prototype, "nextyearlen", { - get: function () { - return this.yearinfo.nextyearlen; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(Iterinfo.prototype, "mdaymask", { - get: function () { - return this.yearinfo.mdaymask; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(Iterinfo.prototype, "nmdaymask", { - get: function () { - return this.yearinfo.nmdaymask; - }, - enumerable: true, - configurable: true - }); - Iterinfo.prototype.ydayset = function () { - return [range(this.yearlen), 0, this.yearlen]; - }; - Iterinfo.prototype.mdayset = function (_, month, __) { - var start = this.mrange[month - 1]; - var end = this.mrange[month]; - var set = repeat(null, this.yearlen); - for (var i = start; i < end; i++) - set[i] = i; - return [set, start, end]; - }; - Iterinfo.prototype.wdayset = function (year, month, day) { - // We need to handle cross-year weeks here. - var set = repeat(null, this.yearlen + 7); - var i = dateutil.toOrdinal(new Date(Date.UTC(year, month - 1, day))) - - this.yearordinal; - var start = i; - for (var j = 0; j < 7; j++) { - set[i] = i; - ++i; - if (this.wdaymask[i] === this.options.wkst) - break; - } - return [set, start, i]; - }; - Iterinfo.prototype.ddayset = function (year, month, day) { - var set = repeat(null, this.yearlen); - var i = dateutil.toOrdinal(new Date(Date.UTC(year, month - 1, day))) - - this.yearordinal; - set[i] = i; - return [set, i, i + 1]; - }; - Iterinfo.prototype.htimeset = function (hour, _, second, millisecond) { - var _this = this; - var set = []; - this.options.byminute.forEach(function (minute) { - set = set.concat(_this.mtimeset(hour, minute, second, millisecond)); - }); - dateutil.sort(set); - return set; - }; - Iterinfo.prototype.mtimeset = function (hour, minute, _, millisecond) { - var set = this.options.bysecond.map(function (second) { - return new Time(hour, minute, second, millisecond); - }); - dateutil.sort(set); - return set; - }; - Iterinfo.prototype.stimeset = function (hour, minute, second, millisecond) { - return [new Time(hour, minute, second, millisecond)]; - }; - Iterinfo.prototype.getdayset = function (freq) { - switch (freq) { - case Frequency.YEARLY: return this.ydayset.bind(this); - case Frequency.MONTHLY: return this.mdayset.bind(this); - case Frequency.WEEKLY: return this.wdayset.bind(this); - case Frequency.DAILY: return this.ddayset.bind(this); - default: return this.ddayset.bind(this); - } - }; - Iterinfo.prototype.gettimeset = function (freq) { - switch (freq) { - case Frequency.HOURLY: return this.htimeset.bind(this); - case Frequency.MINUTELY: return this.mtimeset.bind(this); - case Frequency.SECONDLY: return this.stimeset.bind(this); - } - }; - return Iterinfo; -}()); -export default Iterinfo; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/esm/src/iterinfo/index.js.map b/dist/esm/src/iterinfo/index.js.map deleted file mode 100644 index 76398a85..00000000 --- a/dist/esm/src/iterinfo/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/iterinfo/index.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,aAAa,CAAA;AAClC,OAAO,EACL,QAAQ,EACR,MAAM,EACN,KAAK,EACL,SAAS,EACV,MAAM,YAAY,CAAA;AACnB,OAAO,EAAiB,SAAS,EAAE,MAAM,UAAU,CAAA;AACnD,OAAO,EAAY,WAAW,EAAE,MAAM,YAAY,CAAA;AAClD,OAAO,EAAE,YAAY,EAAa,MAAM,aAAa,CAAA;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAKlC,gFAAgF;AAChF,WAAW;AACX,gFAAgF;AAEhF;IAKE,kBAAqB,OAAsB;QAAtB,YAAO,GAAP,OAAO,CAAe;IAAG,CAAC;IAE/C,0BAAO,GAAP,UAAS,IAAY,EAAE,KAAa;QAClC,IAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAA;QAE5B,IAAI,IAAI,KAAK,IAAI,CAAC,QAAQ,EAAE;YAC1B,IAAI,CAAC,QAAQ,GAAG,WAAW,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;SAC3C;QAED,IACE,QAAQ,CA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C,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;YACpD,OAAO,CAAC,CAAC,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;SACxC;IACH,CAAC;IAED,6BAAU,GAAV,UAAY,IAAgE;QAC1E,QAAQ,IAAI,EAAE;YACZ,KAAK,SAAS,CAAC,MAAM,CAAC,CAAC,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;YACtD,KAAK,SAAS,CAAC,QAAQ,CAAC,CAAC,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;YACxD,KAAK,SAAS,CAAC,QAAQ,CAAC,CAAC,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;SACzD;IACH,CAAC;IACH,eAAC;AAAD,CAAC,AAxJD,IAwJC"} \ No newline at end of file diff --git a/dist/esm/src/iterinfo/monthinfo.d.ts b/dist/esm/src/iterinfo/monthinfo.d.ts deleted file mode 100644 index 7d6c0240..00000000 --- a/dist/esm/src/iterinfo/monthinfo.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { ParsedOptions } from '../types'; -export interface MonthInfo { - lastyear: number; - lastmonth: number; - nwdaymask: number[]; -} -export declare function rebuildMonth(year: number, month: number, yearlen: number, mrange: number[], wdaymask: number[], options: ParsedOptions): MonthInfo; -//# sourceMappingURL=monthinfo.d.ts.map \ No newline at end of file diff --git a/dist/esm/src/iterinfo/monthinfo.d.ts.map b/dist/esm/src/iterinfo/monthinfo.d.ts.map deleted file mode 100644 index 591b89c5..00000000 --- a/dist/esm/src/iterinfo/monthinfo.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"monthinfo.d.ts","sourceRoot":"","sources":["../../../../src/iterinfo/monthinfo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAIxC,MAAM,WAAW,SAAS;IACxB,QAAQ,EAAE,MAAM,CAAA;IAChB,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,EAAE,CAAA;CACpB;AAED,wBAAgB,YAAY,CAC1B,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,EAAE,EAChB,QAAQ,EAAE,MAAM,EAAE,EAClB,OAAO,EAAE,aAAa,aAkDvB"} \ No newline at end of file diff --git a/dist/esm/src/iterinfo/monthinfo.js b/dist/esm/src/iterinfo/monthinfo.js deleted file mode 100644 index 3c11f2d2..00000000 --- a/dist/esm/src/iterinfo/monthinfo.js +++ /dev/null @@ -1,51 +0,0 @@ -import RRule from '../rrule'; -import { empty, repeat, pymod } from '../helpers'; -export function rebuildMonth(year, month, yearlen, mrange, wdaymask, options) { - var result = { - lastyear: year, - lastmonth: month, - nwdaymask: [] - }; - var ranges = []; - if (options.freq === RRule.YEARLY) { - if (empty(options.bymonth)) { - ranges = [[0, yearlen]]; - } - else { - for (var j = 0; j < options.bymonth.length; j++) { - month = options.bymonth[j]; - ranges.push(mrange.slice(month - 1, month + 1)); - } - } - } - else if (options.freq === RRule.MONTHLY) { - ranges = [mrange.slice(month - 1, month + 1)]; - } - if (empty(ranges)) { - return result; - } - // Weekly frequency won't get here, so we may not - // care about cross-year weekly periods. - result.nwdaymask = repeat(0, yearlen); - for (var j = 0; j < ranges.length; j++) { - var rang = ranges[j]; - var first = rang[0]; - var last = rang[1] - 1; - for (var k = 0; k < options.bynweekday.length; k++) { - var i = void 0; - var _a = options.bynweekday[k], wday = _a[0], n = _a[1]; - if (n < 0) { - i = last + (n + 1) * 7; - i -= pymod(wdaymask[i] - wday, 7); - } - else { - i = first + (n - 1) * 7; - i += pymod(7 - wdaymask[i] + wday, 7); - } - if (first <= i && i <= last) - result.nwdaymask[i] = 1; - } - } - return result; -} -//# sourceMappingURL=monthinfo.js.map \ No newline at end of file diff --git a/dist/esm/src/iterinfo/monthinfo.js.map b/dist/esm/src/iterinfo/monthinfo.js.map deleted file mode 100644 index 40fad804..00000000 --- a/dist/esm/src/iterinfo/monthinfo.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"monthinfo.js","sourceRoot":"","sources":["../../../../src/iterinfo/monthinfo.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,UAAU,CAAA;AAC5B,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAQjD,MAAM,UAAU,YAAY,CAC1B,IAAY,EACZ,KAAa,EACb,OAAe,EACf,MAAgB,EAChB,QAAkB,EAClB,OAAsB;IAEtB,IAAM,MAAM,GAAc;QACxB,QAAQ,EAAE,IAAI;QACd,SAAS,EAAE,KAAK;QAChB,SAAS,EAAE,EAAE;KACd,CAAA;IAED,IAAI,MAAM,GAAe,EAAE,CAAA;IAC3B,IAAI,OAAO,CAAC,IAAI,KAAK,KAAK,CAAC,MAAM,EAAE;QACjC,IAAI,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE;YAC1B,MAAM,GAAG,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAA;SACxB;aAAM;YACL,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;gBAC/C,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;gBAC1B,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC,CAAA;aAChD;SACF;KACF;SAAM,IAAI,OAAO,CAAC,IAAI,KAAK,KAAK,CAAC,OAAO,EAAE;QACzC,MAAM,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC,CAAA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esm/src/iterinfo/yearinfo.d.ts b/dist/esm/src/iterinfo/yearinfo.d.ts deleted file mode 100644 index 917f6a94..00000000 --- a/dist/esm/src/iterinfo/yearinfo.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { ParsedOptions } from '../types'; -export interface YearInfo { - yearlen: 365 | 366; - nextyearlen: 365 | 366; - yearordinal: number; - yearweekday: number; - mmask: number[]; - mrange: number[]; - mdaymask: number[]; - nmdaymask: number[]; - wdaymask: number[]; - wnomask: number[] | null; -} -export declare function rebuildYear(year: number, options: ParsedOptions): YearInfo; -//# sourceMappingURL=yearinfo.d.ts.map \ No newline at end of file diff --git a/dist/esm/src/iterinfo/yearinfo.d.ts.map b/dist/esm/src/iterinfo/yearinfo.d.ts.map deleted file mode 100644 index cb2f6e68..00000000 --- a/dist/esm/src/iterinfo/yearinfo.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"yearinfo.d.ts","sourceRoot":"","sources":["../../../../src/iterinfo/yearinfo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAKxC,MAAM,WAAW,QAAQ;IACvB,OAAO,EAAE,GAAG,GAAG,GAAG,CAAA;IAClB,WAAW,EAAE,GAAG,GAAG,GAAG,CAAA;IACtB,WAAW,EAAE,MAAM,CAAA;IACnB,WAAW,EAAE,MAAM,CAAA;IACnB,KAAK,EAAE,MAAM,EAAE,CAAA;IACf,MAAM,EAAE,MAAM,EAAE,CAAA;IAChB,QAAQ,EAAE,MAAM,EAAE,CAAA;IAClB,SAAS,EAAE,MAAM,EAAE,CAAA;IACnB,QAAQ,EAAE,MAAM,EAAE,CAAA;IAClB,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,CAAA;CACzB;AAED,wBAAgB,WAAW,CAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,YA0HhE"} \ No newline at end of file diff --git a/dist/esm/src/iterinfo/yearinfo.js b/dist/esm/src/iterinfo/yearinfo.js deleted file mode 100644 index 77484f15..00000000 --- a/dist/esm/src/iterinfo/yearinfo.js +++ /dev/null @@ -1,132 +0,0 @@ -import { __assign } from "tslib"; -import dateutil from '../dateutil'; -import { empty, repeat, pymod, includes } from '../helpers'; -import { M365MASK, MDAY365MASK, NMDAY365MASK, WDAYMASK, M365RANGE, M366MASK, MDAY366MASK, NMDAY366MASK, M366RANGE } from '../masks'; -export function rebuildYear(year, options) { - var firstyday = new Date(Date.UTC(year, 0, 1)); - var yearlen = dateutil.isLeapYear(year) ? 366 : 365; - var nextyearlen = dateutil.isLeapYear(year + 1) ? 366 : 365; - var yearordinal = dateutil.toOrdinal(firstyday); - var yearweekday = dateutil.getWeekday(firstyday); - var result = __assign(__assign({ yearlen: yearlen, - nextyearlen: nextyearlen, - yearordinal: yearordinal, - yearweekday: yearweekday }, baseYearMasks(year)), { wnomask: null }); - if (empty(options.byweekno)) { - return result; - } - result.wnomask = repeat(0, yearlen + 7); - var firstwkst; - var wyearlen; - var no1wkst = firstwkst = pymod(7 - yearweekday + options.wkst, 7); - if (no1wkst >= 4) { - no1wkst = 0; - // Number of days in the year, plus the days we got - // from last year. - wyearlen = - result.yearlen + pymod(yearweekday - options.wkst, 7); - } - else { - // Number of days in the year, minus the days we - // left in last year. - wyearlen = yearlen - no1wkst; - } - var div = Math.floor(wyearlen / 7); - var mod = pymod(wyearlen, 7); - var numweeks = Math.floor(div + mod / 4); - for (var j = 0; j < options.byweekno.length; j++) { - var n = options.byweekno[j]; - if (n < 0) { - n += numweeks + 1; - } - if (!(n > 0 && n <= numweeks)) { - continue; - } - var i = void 0; - if (n > 1) { - i = no1wkst + (n - 1) * 7; - if (no1wkst !== firstwkst) { - i -= 7 - firstwkst; - } - } - else { - i = no1wkst; - } - for (var k = 0; k < 7; k++) { - result.wnomask[i] = 1; - i++; - if (result.wdaymask[i] === options.wkst) - break; - } - } - if (includes(options.byweekno, 1)) { - // Check week number 1 of next year as well - // orig-TODO : Check -numweeks for next year. - var i = no1wkst + numweeks * 7; - if (no1wkst !== firstwkst) - i -= 7 - firstwkst; - if (i < yearlen) { - // If week starts in next year, we - // don't care about it. - for (var j = 0; j < 7; j++) { - result.wnomask[i] = 1; - i += 1; - if (result.wdaymask[i] === options.wkst) - break; - } - } - } - if (no1wkst) { - // Check last week number of last year as - // well. If no1wkst is 0, either the year - // started on week start, or week number 1 - // got days from last year, so there are no - // days from last year's last week number in - // this year. - var lnumweeks = void 0; - if (!includes(options.byweekno, -1)) { - var lyearweekday = dateutil.getWeekday(new Date(Date.UTC(year - 1, 0, 1))); - var lno1wkst = pymod(7 - lyearweekday.valueOf() + options.wkst, 7); - var lyearlen = dateutil.isLeapYear(year - 1) ? 366 : 365; - var weekst = void 0; - if (lno1wkst >= 4) { - lno1wkst = 0; - weekst = lyearlen + pymod(lyearweekday - options.wkst, 7); - } - else { - weekst = yearlen - no1wkst; - } - lnumweeks = Math.floor(52 + pymod(weekst, 7) / 4); - } - else { - lnumweeks = -1; - } - if (includes(options.byweekno, lnumweeks)) { - for (var i = 0; i < no1wkst; i++) - result.wnomask[i] = 1; - } - } - return result; -} -function baseYearMasks(year) { - var yearlen = dateutil.isLeapYear(year) ? 366 : 365; - var firstyday = new Date(Date.UTC(year, 0, 1)); - var wday = dateutil.getWeekday(firstyday); - if (yearlen === 365) { - return { - mmask: M365MASK, - mdaymask: MDAY365MASK, - nmdaymask: NMDAY365MASK, - wdaymask: WDAYMASK.slice(wday), - mrange: M365RANGE - }; - } - return { - mmask: M366MASK, - mdaymask: MDAY366MASK, - nmdaymask: NMDAY366MASK, - wdaymask: WDAYMASK.slice(wday), - mrange: M366RANGE - }; -} -//# sourceMappingURL=yearinfo.js.map \ No newline at end of file diff --git a/dist/esm/src/iterinfo/yearinfo.js.map b/dist/esm/src/iterinfo/yearinfo.js.map deleted file mode 100644 index 688559ea..00000000 --- a/dist/esm/src/iterinfo/yearinfo.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"yearinfo.js","sourceRoot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IAAM,IAAI,GAAG,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC,CAAA;IAE3C,IAAI,OAAO,KAAK,GAAG,EAAE;QACnB,OAAO;YACL,KAAK,EAAE,QAAoB;YAC3B,QAAQ,EAAE,WAAW;YACrB,SAAS,EAAE,YAAY;YACvB,QAAQ,EAAE,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC;YAC9B,MAAM,EAAE,SAAS;SAClB,CAAA;KACF;IAED,OAAO;QACL,KAAK,EAAE,QAAoB;QAC3B,QAAQ,EAAE,WAAW;QACrB,SAAS,EAAE,YAAY;QACvB,QAAQ,EAAE,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC;QAC9B,MAAM,EAAE,SAAS;KAClB,CAAA;AACH,CAAC"} \ No newline at end of file diff --git a/dist/esm/src/iterresult.d.ts b/dist/esm/src/iterresult.d.ts deleted file mode 100644 index ebb04fbc..00000000 --- a/dist/esm/src/iterresult.d.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { QueryMethodTypes, IterResultType } from './types'; -export interface IterArgs { - inc: boolean; - before: Date; - after: Date; - dt: Date; - _value: Date | Date[] | null; -} -/** - * This class helps us to emulate python's generators, sorta. - */ -export default class IterResult { - readonly method: M; - readonly args: Partial; - readonly minDate: Date | null; - readonly maxDate: Date | null; - _result: Date[]; - total: number; - constructor(method: M, args: Partial); - /** - * Possibly adds a date into the result. - * - * @param {Date} date - the date isn't necessarly added to the result - * list (if it is too late/too early) - * @return {Boolean} true if it makes sense to continue the iteration - * false if we're done. - */ - accept(date: Date): boolean; - /** - * - * @param {Date} date that is part of the result. - * @return {Boolean} whether we are interested in more values. - */ - add(date: Date): boolean; - /** - * 'before' and 'after' return only one date, whereas 'all' - * and 'between' an array. - * @return {Date,Array?} - */ - getValue(): IterResultType; - clone(): IterResult; -} -//# sourceMappingURL=iterresult.d.ts.map \ No newline at end of file diff --git a/dist/esm/src/iterresult.d.ts.map b/dist/esm/src/iterresult.d.ts.map deleted file mode 100644 index 24a063f2..00000000 --- a/dist/esm/src/iterresult.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"iterresult.d.ts","sourceRoot":"","sources":["../../../src/iterresult.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAM1D,MAAM,WAAW,QAAQ;IACvB,GAAG,EAAE,OAAO,CAAA;IACZ,MAAM,EAAE,IAAI,CAAA;IACZ,KAAK,EAAE,IAAI,CAAA;IACX,EAAE,EAAE,IAAI,CAAA;IACR,MAAM,EAAE,IAAI,GAAG,IAAI,EAAE,GAAG,IAAI,CAAA;CAC7B;AAED;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,UAAU,CAAC,CAAC,SAAS,gBAAgB;IACxD,SAAgB,MAAM,EAAE,CAAC,CAAA;IACzB,SAAgB,IAAI,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAA;IACvC,SAAgB,OAAO,EAAE,IAAI,GAAG,IAAI,CAAO;IAC3C,SAAgB,OAAO,EAAE,IAAI,GAAG,IAAI,CAAO;IACpC,OAAO,EAAE,IAAI,EAAE,CAAK;IACpB,KAAK,SAAI;gBAEH,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,QAAQ,CAAC;IAgB/C;;;;;;;OAOG;IACH,MAAM,CAAE,IAAI,EAAE,IAAI;IAmBlB;;;;OAIG;IACH,GAAG,CAAE,IAAI,EAAE,IAAI;IAKf;;;;OAIG;IACH,QAAQ,IAAK,cAAc,CAAC,CAAC,CAAC;IAa9B,KAAK;CAGN"} \ No newline at end of file diff --git a/dist/esm/src/iterresult.js b/dist/esm/src/iterresult.js deleted file mode 100644 index 18b040c9..00000000 --- a/dist/esm/src/iterresult.js +++ /dev/null @@ -1,87 +0,0 @@ -/** - * This class helps us to emulate python's generators, sorta. - */ -var IterResult = /** @class */ (function () { - function IterResult(method, args) { - this.minDate = null; - this.maxDate = null; - this._result = []; - this.total = 0; - this.method = method; - this.args = args; - if (method === 'between') { - this.maxDate = args.inc - ? args.before - : new Date(args.before.getTime() - 1); - this.minDate = args.inc ? args.after : new Date(args.after.getTime() + 1); - } - else if (method === 'before') { - this.maxDate = args.inc ? args.dt : new Date(args.dt.getTime() - 1); - } - else if (method === 'after') { - this.minDate = args.inc ? args.dt : new Date(args.dt.getTime() + 1); - } - } - /** - * Possibly adds a date into the result. - * - * @param {Date} date - the date isn't necessarly added to the result - * list (if it is too late/too early) - * @return {Boolean} true if it makes sense to continue the iteration - * false if we're done. - */ - IterResult.prototype.accept = function (date) { - ++this.total; - var tooEarly = this.minDate && date < this.minDate; - var tooLate = this.maxDate && date > this.maxDate; - if (this.method === 'between') { - if (tooEarly) - return true; - if (tooLate) - return false; - } - else if (this.method === 'before') { - if (tooLate) - return false; - } - else if (this.method === 'after') { - if (tooEarly) - return true; - this.add(date); - return false; - } - return this.add(date); - }; - /** - * - * @param {Date} date that is part of the result. - * @return {Boolean} whether we are interested in more values. - */ - IterResult.prototype.add = function (date) { - this._result.push(date); - return true; - }; - /** - * 'before' and 'after' return only one date, whereas 'all' - * and 'between' an array. - * @return {Date,Array?} - */ - IterResult.prototype.getValue = function () { - var res = this._result; - switch (this.method) { - case 'all': - case 'between': - return res; - case 'before': - case 'after': - default: - return (res.length ? res[res.length - 1] : null); - } - }; - IterResult.prototype.clone = function () { - return new IterResult(this.method, this.args); - }; - return IterResult; -}()); -export default IterResult; -//# sourceMappingURL=iterresult.js.map \ No newline at end of file diff --git a/dist/esm/src/iterresult.js.map b/dist/esm/src/iterresult.js.map deleted file mode 100644 index 75f4711d..00000000 --- a/dist/esm/src/iterresult.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"iterresult.js","sourceRoot":"","sources":["../../../src/iterresult.ts"],"names":[],"mappings":"AAcA;;GAEG;AACH;IAQE,oBAAa,MAAS,EAAE,IAAuB;QAL/B,YAAO,GAAgB,IAAI,CAAA;QAC3B,YAAO,GAAgB,IAAI,CAAA;Q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.ts b/dist/esm/src/iterset.d.ts deleted file mode 100644 index c95de93a..00000000 --- a/dist/esm/src/iterset.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import IterResult from './iterresult'; -import RRule from './rrule'; -import { QueryMethodTypes, IterResultType } from './types'; -export declare function iterSet(iterResult: IterResult, _rrule: RRule[], _exrule: RRule[], _rdate: Date[], _exdate: Date[], tzid: string | undefined): IterResultType; -//# sourceMappingURL=iterset.d.ts.map \ No newline at end of file diff --git a/dist/esm/src/iterset.d.ts.map b/dist/esm/src/iterset.d.ts.map deleted file mode 100644 index e06af1f8..00000000 --- a/dist/esm/src/iterset.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"iterset.d.ts","sourceRoot":"","sources":["../../../src/iterset.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,cAAc,CAAA;AACrC,OAAO,KAAK,MAAM,SAAS,CAAA;AAI3B,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAE1D,wBAAgB,OAAO,CAAE,CAAC,SAAS,gBAAgB,EACjD,UAAU,EAAE,UAAU,CAAC,CAAC,CAAC,EACzB,MAAM,EAAE,KAAK,EAAE,EACf,OAAO,EAAE,KAAK,EAAE,EAChB,MAAM,EAAE,IAAI,EAAE,EACd,OAAO,EAAE,IAAI,EAAE,EACf,IAAI,EAAE,MAAM,GAAG,SAAS,qBAgEzB"} \ No newline at end of file diff --git a/dist/esm/src/iterset.js b/dist/esm/src/iterset.js deleted file mode 100644 index 49230403..00000000 --- a/dist/esm/src/iterset.js +++ /dev/null @@ -1,63 +0,0 @@ -import { DateWithZone } from './datewithzone'; -import { iter } from './iter/index'; -import dateutil from './dateutil'; -export function iterSet(iterResult, _rrule, _exrule, _rdate, _exdate, tzid) { - var _exdateHash = {}; - var _accept = iterResult.accept; - function evalExdate(after, before) { - _exrule.forEach(function (rrule) { - rrule.between(after, before, true).forEach(function (date) { - _exdateHash[Number(date)] = true; - }); - }); - } - _exdate.forEach(function (date) { - var zonedDate = new DateWithZone(date, tzid).rezonedDate(); - _exdateHash[Number(zonedDate)] = true; - }); - iterResult.accept = function (date) { - var dt = Number(date); - if (isNaN(dt)) - return _accept.call(this, date); - if (!_exdateHash[dt]) { - evalExdate(new Date(dt - 1), new Date(dt + 1)); - if (!_exdateHash[dt]) { - _exdateHash[dt] = true; - return _accept.call(this, date); - } - } - return true; - }; - if (iterResult.method === 'between') { - evalExdate(iterResult.args.after, iterResult.args.before); - iterResult.accept = function (date) { - var dt = Number(date); - if (!_exdateHash[dt]) { - _exdateHash[dt] = true; - return _accept.call(this, date); - } - return true; - }; - } - for (var i = 0; i < _rdate.length; i++) { - var zonedDate = new DateWithZone(_rdate[i], tzid).rezonedDate(); - if (!iterResult.accept(new Date(zonedDate.getTime()))) - break; - } - _rrule.forEach(function (rrule) { - iter(iterResult, rrule.options); - }); - var res = iterResult._result; - dateutil.sort(res); - switch (iterResult.method) { - case 'all': - case 'between': - return res; - case 'before': - return ((res.length && res[res.length - 1]) || null); - case 'after': - default: - return ((res.length && res[0]) || null); - } -} -//# sourceMappingURL=iterset.js.map \ No newline at end of file diff --git a/dist/esm/src/iterset.js.map b/dist/esm/src/iterset.js.map deleted file mode 100644 index 7ba6842c..00000000 --- a/dist/esm/src/iterset.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"iterset.js","sourceRoot":"","sources":["../../../src/iterset.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AACnC,OAAO,QAAQ,MAAM,YAAY,CAAA;AAGjC,MAAM,UAAU,OAAO,CACrB,UAAyB,EACzB,MAAe,EACf,OAAgB,EAChB,MAAc,EACd,OAAe,EACf,IAAwB;IAExB,IAAM,WAAW,GAA6B,EAAE,CAAA;IAChD,IAAM,OAAO,GAAG,UAAU,CAAC,MAAM,CAAA;IAEjC,SAAS,U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AI,IAAI,CAAsB,CAAA;KAC/D;AACH,CAAC"} \ No newline at end of file diff --git a/dist/esm/src/masks.d.ts b/dist/esm/src/masks.d.ts deleted file mode 100644 index 0085cd4b..00000000 --- a/dist/esm/src/masks.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -declare const M365MASK: (number | number[])[]; -declare const M366MASK: (number | number[])[]; -declare const MDAY366MASK: number[]; -declare const MDAY365MASK: number[]; -declare const NMDAY366MASK: number[]; -declare const NMDAY365MASK: number[]; -declare const M366RANGE: number[]; -declare const M365RANGE: number[]; -declare const WDAYMASK: number[]; -export { WDAYMASK, M365MASK, M365RANGE, M366MASK, M366RANGE, MDAY365MASK, MDAY366MASK, NMDAY365MASK, NMDAY366MASK }; -//# sourceMappingURL=masks.d.ts.map \ No newline at end of file diff --git a/dist/esm/src/masks.d.ts.map b/dist/esm/src/masks.d.ts.map deleted file mode 100644 index 1f3e90d1..00000000 --- a/dist/esm/src/masks.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"masks.d.ts","sourceRoot":"","sources":["../../../src/masks.ts"],"names":[],"mappings":"AAQA,QAAA,MAAM,QAAQ,uBAcb,CAAA;AAED,QAAA,MAAM,QAAQ,uBAcb,CAAA;AAOD,QAAA,MAAM,WAAW,UAchB,CAAA;AAED,QAAA,MAAM,WAAW,UAchB,CAAA;AAOD,QAAA,MAAM,YAAY,UAcjB,CAAA;AAED,QAAA,MAAM,YAAY,UAcjB,CAAA;AAED,QAAA,MAAM,SAAS,UAA+D,CAAA;AAC9E,QAAA,MAAM,SAAS,UAA+D,CAAA;AAE9E,QAAA,MAAM,QAAQ,UAIV,CAAA;AAEJ,OAAO,EACL,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,SAAS,EACT,WAAW,EACX,WAAW,EACX,YAAY,EACZ,YAAY,EACb,CAAA"} \ No newline at end of file diff --git a/dist/esm/src/masks.js b/dist/esm/src/masks.js deleted file mode 100644 index f8bc1c76..00000000 --- a/dist/esm/src/masks.js +++ /dev/null @@ -1,30 +0,0 @@ -import { __spreadArrays } from "tslib"; -import { range, repeat } from './helpers'; -// ============================================================================= -// Date masks -// ============================================================================= -// Every mask is 7 days longer to handle cross-year weekly periods. -var M365MASK = __spreadArrays(repeat(1, 31), repeat(2, 28), repeat(3, 31), repeat(4, 30), repeat(5, 31), repeat(6, 30), repeat(7, 31), repeat(8, 31), repeat(9, 30), repeat(10, 31), repeat(11, 30), repeat(12, 31), repeat(1, 7)); -var M366MASK = __spreadArrays(repeat(1, 31), repeat(2, 29), repeat(3, 31), repeat(4, 30), repeat(5, 31), repeat(6, 30), repeat(7, 31), repeat(8, 31), repeat(9, 30), repeat(10, 31), repeat(11, 30), repeat(12, 31), repeat(1, 7)); -var M28 = range(1, 29); -var M29 = range(1, 30); -var M30 = range(1, 31); -var M31 = range(1, 32); -var MDAY366MASK = __spreadArrays(M31, M29, M31, M30, M31, M30, M31, M31, M30, M31, M30, M31, M31.slice(0, 7)); -var MDAY365MASK = __spreadArrays(M31, M28, M31, M30, M31, M30, M31, M31, M30, M31, M30, M31, M31.slice(0, 7)); -var NM28 = range(-28, 0); -var NM29 = range(-29, 0); -var NM30 = range(-30, 0); -var NM31 = range(-31, 0); -var NMDAY366MASK = __spreadArrays(NM31, NM29, NM31, NM30, NM31, NM30, NM31, NM31, NM30, NM31, NM30, NM31, NM31.slice(0, 7)); -var NMDAY365MASK = __spreadArrays(NM31, NM28, NM31, NM30, NM31, NM30, NM31, NM31, NM30, NM31, NM30, NM31, NM31.slice(0, 7)); -var M366RANGE = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366]; -var M365RANGE = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365]; -var WDAYMASK = (function () { - var wdaymask = []; - for (var i = 0; i < 55; i++) - wdaymask = wdaymask.concat(range(7)); - return wdaymask; -})(); -export { WDAYMASK, M365MASK, M365RANGE, M366MASK, M366RANGE, MDAY365MASK, MDAY366MASK, NMDAY365MASK, NMDAY366MASK }; -//# sourceMappingURL=masks.js.map \ No newline at end of file diff --git a/dist/esm/src/masks.js.map b/dist/esm/src/masks.js.map deleted file mode 100644 index 53b7fe11..00000000 --- a/dist/esm/src/masks.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"masks.js","sourceRoot":"","sources":["../../../src/masks.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,EAAS,MAAM,WAAW,CAAA;AAEhD,gFAAgF;AAChF,aAAa;AACb,gFAAgF;AAEhF,mEAAmE;AAEnE,IAAM,QAAQ,kBACT,MAAM,CAAC,CAAC,EAAE,EAAE,CAAC,EACb,MAAM,CAAC,CAAC,EAAE,EAAE,CAAC,EACb,MAAM,CAAC,CAAC,EAAE,EAAE,CAAC,EACb,MAAM,CAAC,CAAC,EAAE,EAAE,CAAC,EACb,MAAM,CAAC,CAAC,EAAE,EAAE,CAAC,EACb,MAAM,CAAC,CAAC,EAAE,EAAE,CAAC,EACb,MAAM,CAAC,CAAC,EAAE,EAAE,CAAC,EACb,MAAM,CAAC,CAAC,EAAE,EAAE,CAAC,EACb,MAAM,CAAC,CAAC,EAAE,EAAE,CAAC,EACb,MAAM,CAAC,EAAE,EAAE,EAAE,CAAC,EACd,MAAM,CAAC,EAAE,EAAE,EAAE,CAAC,EACd,MAAM,CAAC,EAAE,EAAE,EAAE,CAAC,EACd,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAChB,CAAA;AAED,IAAM,QAAQ,kBACT,MAAM,CAAC,CAAC,EAAE,EAAE,CAAC,EACb,MAAM,CAAC,CAAC,EAAE,EAAE,CAAC,EACb,MAAM,CAAC,CAAC,EAAE,EAAE,CAAC,EACb,MAAM,CAAC,CAAC,EAAE,EAAE,CAAC,EACb,MAAM,CAAC,CAAC,EAAE,EAAE,CAAC,EACb,MAAM,CAAC,CAAC,EAAE,EAAE,CAAC,EACb,MAAM,CAAC,CAAC,EAAE,EAAE,CAAC,EACb,MA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,EACZ,YAAY,EACb,CAAA"} \ No newline at end of file diff --git a/dist/esm/src/nlp/i18n.d.ts b/dist/esm/src/nlp/i18n.d.ts deleted file mode 100644 index 5996ab86..00000000 --- a/dist/esm/src/nlp/i18n.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -export interface Language { - dayNames: string[]; - monthNames: string[]; - tokens: { - [k: string]: RegExp; - }; -} -declare const ENGLISH: Language; -export default ENGLISH; -//# sourceMappingURL=i18n.d.ts.map \ No newline at end of file diff --git a/dist/esm/src/nlp/i18n.d.ts.map b/dist/esm/src/nlp/i18n.d.ts.map deleted file mode 100644 index 07bc4c9e..00000000 --- a/dist/esm/src/nlp/i18n.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../../../../src/nlp/i18n.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,QAAQ;IACvB,QAAQ,EAAE,MAAM,EAAE,CAAA;IAClB,UAAU,EAAE,MAAM,EAAE,CAAA;IACpB,MAAM,EAAE;QACN,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;KACpB,CAAA;CACF;AAED,QAAA,MAAM,OAAO,EAAE,QAsDd,CAAA;AAED,eAAe,OAAO,CAAA"} \ No newline at end of file diff --git a/dist/esm/src/nlp/i18n.js b/dist/esm/src/nlp/i18n.js deleted file mode 100644 index 8dab6613..00000000 --- a/dist/esm/src/nlp/i18n.js +++ /dev/null @@ -1,60 +0,0 @@ -// ============================================================================= -// i18n -// ============================================================================= -var ENGLISH = { - dayNames: [ - 'Sunday', 'Monday', 'Tuesday', 'Wednesday', - 'Thursday', 'Friday', 'Saturday' - ], - monthNames: [ - 'January', 'February', 'March', 'April', 'May', - 'June', 'July', 'August', 'September', 'October', - 'November', 'December' - ], - tokens: { - 'SKIP': /^[ \r\n\t]+|^\.$/, - 'number': /^[1-9][0-9]*/, - 'numberAsText': /^(one|two|three)/i, - 'every': /^every/i, - 'day(s)': /^days?/i, - 'weekday(s)': /^weekdays?/i, - 'week(s)': /^weeks?/i, - 'hour(s)': /^hours?/i, - 'minute(s)': /^minutes?/i, - 'month(s)': /^months?/i, - 'year(s)': /^years?/i, - 'on': /^(on|in)/i, - 'at': /^(at)/i, - 'the': /^the/i, - 'first': /^first/i, - 'second': /^second/i, - 'third': /^third/i, - 'nth': /^([1-9][0-9]*)(\.|th|nd|rd|st)/i, - 'last': /^last/i, - 'for': /^for/i, - 'time(s)': /^times?/i, - 'until': /^(un)?til/i, - 'monday': /^mo(n(day)?)?/i, - 'tuesday': /^tu(e(s(day)?)?)?/i, - 'wednesday': /^we(d(n(esday)?)?)?/i, - 'thursday': /^th(u(r(sday)?)?)?/i, - 'friday': /^fr(i(day)?)?/i, - 'saturday': /^sa(t(urday)?)?/i, - 'sunday': /^su(n(day)?)?/i, - 'january': /^jan(uary)?/i, - 'february': /^feb(ruary)?/i, - 'march': /^mar(ch)?/i, - 'april': /^apr(il)?/i, - 'may': /^may/i, - 'june': /^june?/i, - 'july': /^july?/i, - 'august': /^aug(ust)?/i, - 'september': /^sep(t(ember)?)?/i, - 'october': /^oct(ober)?/i, - 'november': /^nov(ember)?/i, - 'december': /^dec(ember)?/i, - 'comma': /^(,\s*|(and|or)\s*)+/i - } -}; -export default ENGLISH; -//# sourceMappingURL=i18n.js.map \ No newline at end of file diff --git a/dist/esm/src/nlp/i18n.js.map b/dist/esm/src/nlp/i18n.js.map deleted file mode 100644 index 56612b01..00000000 --- a/dist/esm/src/nlp/i18n.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"i18n.js","sourceRoot":"","sources":["../../../../src/nlp/i18n.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,OAAO;AACP,gFAAgF;AAUhF,IAAM,OAAO,GAAa;IACxB,QAAQ,EAAE;QACR,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW;QAC1C,UAAU,EAAE,QAAQ,EAAE,UAAU;KACjC;IACD,UAAU,EAAE;QACV,SAAS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AAED,eAAe,OAAO,CAAA"} \ No newline at end of file diff --git a/dist/esm/src/nlp/index.d.ts b/dist/esm/src/nlp/index.d.ts deleted file mode 100644 index 6ee7c792..00000000 --- a/dist/esm/src/nlp/index.d.ts +++ /dev/null @@ -1,101 +0,0 @@ -import ToText, { DateFormatter, GetText } from './totext'; -import parseText from './parsetext'; -import RRule from '../index'; -import { Language } from './i18n'; -/*! -* rrule.js - Library for working with recurrence rules for calendar dates. -* https://github.com/jakubroztocil/rrule -* -* Copyright 2010, Jakub Roztocil and Lars Schoning -* Licenced under the BSD licence. -* https://github.com/jakubroztocil/rrule/blob/master/LICENCE -* -*/ -/** - * - * Implementation of RRule.fromText() and RRule::toText(). - * - * - * On the client side, this file needs to be included - * when those functions are used. - * - */ -/** - * Will be able to convert some of the below described rules from - * text format to a rule object. - * - * - * RULES - * - * Every ([n]) - * day(s) - * | [weekday], ..., (and) [weekday] - * | weekday(s) - * | week(s) - * | month(s) - * | [month], ..., (and) [month] - * | year(s) - * - * - * Plus 0, 1, or multiple of these: - * - * on [weekday], ..., (or) [weekday] the [monthday], [monthday], ... (or) [monthday] - * - * on [weekday], ..., (and) [weekday] - * - * on the [monthday], [monthday], ... (and) [monthday] (day of the month) - * - * on the [nth-weekday], ..., (and) [nth-weekday] (of the month/year) - * - * - * Plus 0 or 1 of these: - * - * for [n] time(s) - * - * until [date] - * - * Plus (.) - * - * - * Definitely no supported for parsing: - * - * (for year): - * in week(s) [n], ..., (and) [n] - * - * on the [yearday], ..., (and) [n] day of the year - * on day [yearday], ..., (and) [n] - * - * - * NON-TERMINALS - * - * [n]: 1, 2 ..., one, two, three .. - * [month]: January, February, March, April, May, ... December - * [weekday]: Monday, ... Sunday - * [nth-weekday]: first [weekday], 2nd [weekday], ... last [weekday], ... - * [monthday]: first, 1., 2., 1st, 2nd, second, ... 31st, last day, 2nd last day, .. - * [date]: - * [month] (0-31(,) ([year])), - * (the) 0-31.(1-12.([year])), - * (the) 0-31/(1-12/([year])), - * [weekday] - * - * [year]: 0000, 0001, ... 01, 02, .. - * - * Definitely not supported for parsing: - * - * [yearday]: first, 1., 2., 1st, 2nd, second, ... 366th, last day, 2nd last day, .. - * - * @param {String} text - * @return {Object, Boolean} the rule, or null. - */ -declare const fromText: (text: string, language?: Language) => RRule; -declare const toText: (rrule: RRule, gettext?: GetText | undefined, language?: Language | undefined, dateFormatter?: DateFormatter | undefined) => string; -declare const isFullyConvertible: typeof ToText.isFullyConvertible; -export interface Nlp { - fromText: typeof fromText; - parseText: typeof parseText; - isFullyConvertible: typeof isFullyConvertible; - toText: typeof toText; -} -export { fromText, parseText, isFullyConvertible, toText }; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/dist/esm/src/nlp/index.d.ts.map b/dist/esm/src/nlp/index.d.ts.map deleted file mode 100644 index a5171ca0..00000000 --- a/dist/esm/src/nlp/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/nlp/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,UAAU,CAAA;AACzD,OAAO,SAAS,MAAM,aAAa,CAAA;AACnC,OAAO,KAAK,MAAM,UAAU,CAAA;AAC5B,OAAgB,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAA;AAE1C;;;;;;;;EAQE;AAEF;;;;;;;;GAQG;AAKH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmEG;AACH,QAAA,MAAM,QAAQ,8CAEb,CAAA;AAuBD,QAAA,MAAM,MAAM,qIAEX,CAAA;AAED,QAAA,MAAQ,kBAAkB,kCAAW,CAAA;AAErC,MAAM,WAAW,GAAG;IAClB,QAAQ,EAAE,OAAO,QAAQ,CAAA;IACzB,SAAS,EAAE,OAAO,SAAS,CAAA;IAC3B,kBAAkB,EAAE,OAAO,kBAAkB,CAAA;IAC7C,MAAM,EAAE,OAAO,MAAM,CAAA;CACtB;AAED,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,EAAE,CAAA"} \ No newline at end of file diff --git a/dist/esm/src/nlp/index.js b/dist/esm/src/nlp/index.js deleted file mode 100644 index f89ce918..00000000 --- a/dist/esm/src/nlp/index.js +++ /dev/null @@ -1,121 +0,0 @@ -import ToText from './totext'; -import parseText from './parsetext'; -import RRule from '../index'; -import ENGLISH from './i18n'; -/*! -* rrule.js - Library for working with recurrence rules for calendar dates. -* https://github.com/jakubroztocil/rrule -* -* Copyright 2010, Jakub Roztocil and Lars Schoning -* Licenced under the BSD licence. -* https://github.com/jakubroztocil/rrule/blob/master/LICENCE -* -*/ -/** - * - * Implementation of RRule.fromText() and RRule::toText(). - * - * - * On the client side, this file needs to be included - * when those functions are used. - * - */ -// ============================================================================= -// fromText -// ============================================================================= -/** - * Will be able to convert some of the below described rules from - * text format to a rule object. - * - * - * RULES - * - * Every ([n]) - * day(s) - * | [weekday], ..., (and) [weekday] - * | weekday(s) - * | week(s) - * | month(s) - * | [month], ..., (and) [month] - * | year(s) - * - * - * Plus 0, 1, or multiple of these: - * - * on [weekday], ..., (or) [weekday] the [monthday], [monthday], ... (or) [monthday] - * - * on [weekday], ..., (and) [weekday] - * - * on the [monthday], [monthday], ... (and) [monthday] (day of the month) - * - * on the [nth-weekday], ..., (and) [nth-weekday] (of the month/year) - * - * - * Plus 0 or 1 of these: - * - * for [n] time(s) - * - * until [date] - * - * Plus (.) - * - * - * Definitely no supported for parsing: - * - * (for year): - * in week(s) [n], ..., (and) [n] - * - * on the [yearday], ..., (and) [n] day of the year - * on day [yearday], ..., (and) [n] - * - * - * NON-TERMINALS - * - * [n]: 1, 2 ..., one, two, three .. - * [month]: January, February, March, April, May, ... December - * [weekday]: Monday, ... Sunday - * [nth-weekday]: first [weekday], 2nd [weekday], ... last [weekday], ... - * [monthday]: first, 1., 2., 1st, 2nd, second, ... 31st, last day, 2nd last day, .. - * [date]: - * [month] (0-31(,) ([year])), - * (the) 0-31.(1-12.([year])), - * (the) 0-31/(1-12/([year])), - * [weekday] - * - * [year]: 0000, 0001, ... 01, 02, .. - * - * Definitely not supported for parsing: - * - * [yearday]: first, 1., 2., 1st, 2nd, second, ... 366th, last day, 2nd last day, .. - * - * @param {String} text - * @return {Object, Boolean} the rule, or null. - */ -var fromText = function (text, language) { - if (language === void 0) { language = ENGLISH; } - return new RRule(parseText(text, language) || undefined); -}; -var common = [ - 'count', - 'until', - 'interval', - 'byweekday', - 'bymonthday', - 'bymonth' -]; -ToText.IMPLEMENTED = []; -ToText.IMPLEMENTED[RRule.HOURLY] = common; -ToText.IMPLEMENTED[RRule.MINUTELY] = common; -ToText.IMPLEMENTED[RRule.DAILY] = ['byhour'].concat(common); -ToText.IMPLEMENTED[RRule.WEEKLY] = common; -ToText.IMPLEMENTED[RRule.MONTHLY] = common; -ToText.IMPLEMENTED[RRule.YEARLY] = ['byweekno', 'byyearday'].concat(common); -// ============================================================================= -// Export -// ============================================================================= -var toText = function (rrule, gettext, language, dateFormatter) { - return new ToText(rrule, gettext, language, dateFormatter).toString(); -}; -var isFullyConvertible = ToText.isFullyConvertible; -export { fromText, parseText, isFullyConvertible, toText }; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/esm/src/nlp/index.js.map b/dist/esm/src/nlp/index.js.map deleted file mode 100644 index e92dc699..00000000 --- a/dist/esm/src/nlp/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/nlp/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAkC,MAAM,UAAU,CAAA;AACzD,OAAO,SAAS,MAAM,aAAa,CAAA;AACnC,OAAO,KAAK,MAAM,UAAU,CAAA;AAC5B,OAAO,OAAqB,MAAM,QAAQ,CAAA;AAE1C;;;;;;;;EAQE;AAEF;;;;;;;;GAQG;AAEH,gFAAgF;AAChF,WAAW;AACX,gFAAgF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,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,EAAE,CAAA"} \ No newline at end of file diff --git a/dist/esm/src/nlp/parsetext.d.ts b/dist/esm/src/nlp/parsetext.d.ts deleted file mode 100644 index e9c3cc72..00000000 --- a/dist/esm/src/nlp/parsetext.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { Language } from './i18n'; -import { Options } from '../types'; -export default function parseText(text: string, language?: Language): Partial | null; -//# sourceMappingURL=parsetext.d.ts.map \ No newline at end of file diff --git a/dist/esm/src/nlp/parsetext.d.ts.map b/dist/esm/src/nlp/parsetext.d.ts.map deleted file mode 100644 index 0fe344e6..00000000 --- a/dist/esm/src/nlp/parsetext.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"parsetext.d.ts","sourceRoot":"","sources":["../../../../src/nlp/parsetext.ts"],"names":[],"mappings":"AAAA,OAAgB,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAA;AAE1C,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAA;AAkGlC,MAAM,CAAC,OAAO,UAAU,SAAS,CAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,GAAE,QAAkB,2BAuV5E"} \ No newline at end of file diff --git a/dist/esm/src/nlp/parsetext.js b/dist/esm/src/nlp/parsetext.js deleted file mode 100644 index e7f3f30d..00000000 --- a/dist/esm/src/nlp/parsetext.js +++ /dev/null @@ -1,406 +0,0 @@ -import ENGLISH from './i18n'; -import RRule from '../index'; -// ============================================================================= -// Parser -// ============================================================================= -var Parser = /** @class */ (function () { - function Parser(rules) { - this.done = true; - this.rules = rules; - } - Parser.prototype.start = function (text) { - this.text = text; - this.done = false; - return this.nextSymbol(); - }; - Parser.prototype.isDone = function () { - return this.done && this.symbol === null; - }; - Parser.prototype.nextSymbol = function () { - var best; - var bestSymbol; - var p = this; - this.symbol = null; - this.value = null; - do { - if (this.done) - return false; - var rule = void 0; - best = null; - for (var name_1 in this.rules) { - rule = this.rules[name_1]; - var match = rule.exec(p.text); - if (match) { - if (best === null || match[0].length > best[0].length) { - best = match; - bestSymbol = name_1; - } - } - } - if (best != null) { - this.text = this.text.substr(best[0].length); - if (this.text === '') - this.done = true; - } - if (best == null) { - this.done = true; - this.symbol = null; - this.value = null; - return; - } - // @ts-ignore - } while (bestSymbol === 'SKIP'); - // @ts-ignore - this.symbol = bestSymbol; - this.value = best; - return true; - }; - Parser.prototype.accept = function (name) { - if (this.symbol === name) { - if (this.value) { - var v = this.value; - this.nextSymbol(); - return v; - } - this.nextSymbol(); - return true; - } - return false; - }; - Parser.prototype.acceptNumber = function () { - return this.accept('number'); - }; - Parser.prototype.expect = function (name) { - if (this.accept(name)) - return true; - throw new Error('expected ' + name + ' but found ' + this.symbol); - }; - return Parser; -}()); -export default function parseText(text, language) { - if (language === void 0) { language = ENGLISH; } - var options = {}; - var ttr = new Parser(language.tokens); - if (!ttr.start(text)) - return null; - S(); - return options; - function S() { - // every [n] - ttr.expect('every'); - var n = ttr.acceptNumber(); - if (n) - options.interval = parseInt(n[0], 10); - if (ttr.isDone()) - throw new Error('Unexpected end'); - switch (ttr.symbol) { - case 'day(s)': - options.freq = RRule.DAILY; - if (ttr.nextSymbol()) { - AT(); - F(); - } - break; - // FIXME Note: every 2 weekdays != every two weeks on weekdays. - // DAILY on weekdays is not a valid rule - case 'weekday(s)': - options.freq = RRule.WEEKLY; - options.byweekday = [ - RRule.MO, - RRule.TU, - RRule.WE, - RRule.TH, - RRule.FR - ]; - ttr.nextSymbol(); - F(); - break; - case 'week(s)': - options.freq = RRule.WEEKLY; - if (ttr.nextSymbol()) { - ON(); - F(); - } - break; - case 'hour(s)': - options.freq = RRule.HOURLY; - if (ttr.nextSymbol()) { - ON(); - F(); - } - break; - case 'minute(s)': - options.freq = RRule.MINUTELY; - if (ttr.nextSymbol()) { - ON(); - F(); - } - break; - case 'month(s)': - options.freq = RRule.MONTHLY; - if (ttr.nextSymbol()) { - ON(); - F(); - } - break; - case 'year(s)': - options.freq = RRule.YEARLY; - if (ttr.nextSymbol()) { - ON(); - F(); - } - break; - case 'monday': - case 'tuesday': - case 'wednesday': - case 'thursday': - case 'friday': - case 'saturday': - case 'sunday': - options.freq = RRule.WEEKLY; - var key = ttr.symbol.substr(0, 2).toUpperCase(); - options.byweekday = [RRule[key]]; - if (!ttr.nextSymbol()) - return; - // TODO check for duplicates - while (ttr.accept('comma')) { - if (ttr.isDone()) - throw new Error('Unexpected end'); - var wkd = decodeWKD(); - if (!wkd) { - throw new Error('Unexpected symbol ' + ttr.symbol + ', expected weekday'); - } - // @ts-ignore - options.byweekday.push(RRule[wkd]); - ttr.nextSymbol(); - } - MDAYs(); - F(); - break; - case 'january': - case 'february': - case 'march': - case 'april': - case 'may': - case 'june': - case 'july': - case 'august': - case 'september': - case 'october': - case 'november': - case 'december': - options.freq = RRule.YEARLY; - options.bymonth = [decodeM()]; - if (!ttr.nextSymbol()) - return; - // TODO check for duplicates - while (ttr.accept('comma')) { - if (ttr.isDone()) - throw new Error('Unexpected end'); - var m = decodeM(); - if (!m) { - throw new Error('Unexpected symbol ' + ttr.symbol + ', expected month'); - } - options.bymonth.push(m); - ttr.nextSymbol(); - } - ON(); - F(); - break; - default: - throw new Error('Unknown symbol'); - } - } - function ON() { - var on = ttr.accept('on'); - var the = ttr.accept('the'); - if (!(on || the)) - return; - do { - var nth = decodeNTH(); - var wkd = decodeWKD(); - var m = decodeM(); - // nth | - if (nth) { - // ttr.nextSymbol() - if (wkd) { - ttr.nextSymbol(); - if (!options.byweekday) - options.byweekday = []; - // @ts-ignore - options.byweekday.push(RRule[wkd].nth(nth)); - } - else { - if (!options.bymonthday) - options.bymonthday = []; - // @ts-ignore - options.bymonthday.push(nth); - ttr.accept('day(s)'); - } - // - } - else if (wkd) { - ttr.nextSymbol(); - if (!options.byweekday) - options.byweekday = []; - // @ts-ignore - options.byweekday.push(RRule[wkd]); - } - else if (ttr.symbol === 'weekday(s)') { - ttr.nextSymbol(); - if (!options.byweekday) { - options.byweekday = [ - RRule.MO, - RRule.TU, - RRule.WE, - RRule.TH, - RRule.FR - ]; - } - } - else if (ttr.symbol === 'week(s)') { - ttr.nextSymbol(); - var n = ttr.acceptNumber(); - if (!n) { - throw new Error('Unexpected symbol ' + ttr.symbol + ', expected week number'); - } - options.byweekno = [parseInt(n[0], 10)]; - while (ttr.accept('comma')) { - n = ttr.acceptNumber(); - if (!n) { - throw new Error('Unexpected symbol ' + ttr.symbol + '; expected monthday'); - } - options.byweekno.push(parseInt(n[0], 10)); - } - } - else if (m) { - ttr.nextSymbol(); - if (!options.bymonth) - options.bymonth = []; - // @ts-ignore - options.bymonth.push(m); - } - else { - return; - } - } while (ttr.accept('comma') || ttr.accept('the') || ttr.accept('on')); - } - function AT() { - var at = ttr.accept('at'); - if (!at) - return; - do { - var n = ttr.acceptNumber(); - if (!n) { - throw new Error('Unexpected symbol ' + ttr.symbol + ', expected hour'); - } - options.byhour = [parseInt(n[0], 10)]; - while (ttr.accept('comma')) { - n = ttr.acceptNumber(); - if (!n) { - throw new Error('Unexpected symbol ' + ttr.symbol + '; expected hour'); - } - options.byhour.push(parseInt(n[0], 10)); - } - } while (ttr.accept('comma') || ttr.accept('at')); - } - function decodeM() { - switch (ttr.symbol) { - case 'january': - return 1; - case 'february': - return 2; - case 'march': - return 3; - case 'april': - return 4; - case 'may': - return 5; - case 'june': - return 6; - case 'july': - return 7; - case 'august': - return 8; - case 'september': - return 9; - case 'october': - return 10; - case 'november': - return 11; - case 'december': - return 12; - default: - return false; - } - } - function decodeWKD() { - switch (ttr.symbol) { - case 'monday': - case 'tuesday': - case 'wednesday': - case 'thursday': - case 'friday': - case 'saturday': - case 'sunday': - return ttr.symbol.substr(0, 2).toUpperCase(); - default: - return false; - } - } - function decodeNTH() { - switch (ttr.symbol) { - case 'last': - ttr.nextSymbol(); - return -1; - case 'first': - ttr.nextSymbol(); - return 1; - case 'second': - ttr.nextSymbol(); - return ttr.accept('last') ? -2 : 2; - case 'third': - ttr.nextSymbol(); - return ttr.accept('last') ? -3 : 3; - case 'nth': - var v = parseInt(ttr.value[1], 10); - if (v < -366 || v > 366) - throw new Error('Nth out of range: ' + v); - ttr.nextSymbol(); - return ttr.accept('last') ? -v : v; - default: - return false; - } - } - function MDAYs() { - ttr.accept('on'); - ttr.accept('the'); - var nth = decodeNTH(); - if (!nth) - return; - options.bymonthday = [nth]; - ttr.nextSymbol(); - while (ttr.accept('comma')) { - nth = decodeNTH(); - if (!nth) { - throw new Error('Unexpected symbol ' + ttr.symbol + '; expected monthday'); - } - options.bymonthday.push(nth); - ttr.nextSymbol(); - } - } - function F() { - if (ttr.symbol === 'until') { - var date = Date.parse(ttr.text); - if (!date) - throw new Error('Cannot parse until date:' + ttr.text); - options.until = new Date(date); - } - else if (ttr.accept('for')) { - options.count = parseInt(ttr.value[0], 10); - ttr.expect('number'); - // ttr.expect('times') - } - } -} -//# sourceMappingURL=parsetext.js.map \ No newline at end of file diff --git a/dist/esm/src/nlp/parsetext.js.map b/dist/esm/src/nlp/parsetext.js.map deleted file mode 100644 index 026e4957..00000000 --- a/dist/esm/src/nlp/parsetext.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"parsetext.js","sourceRoot":"","sources":["../../../../src/nlp/parsetext.ts"],"names":[],"mappings":"AAAA,OAAO,OAAqB,MAAM,QAAQ,CAAA;AAC1C,OAAO,KAAK,MAAM,UAAU,CAAA;AAI5B,gFAAgF;AAChF,SAAS;AACT,gFAAgF;AAEhF;IAOE,gBAAa,KAA8B;QAFnC,SAAI,GAAG,IAAI,CAAA;QAGjB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;IACpB,CAAC;IAED,sBAAK,GAAL,UAAO,IAAY;QACjB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;QAChB,IAAI,CAAC,IAAI,GAAG,KAAK,CAAA;QACjB,OAAO,IAAI,CAAC,UAAU,EAAE,CAAA;IAC1B,CAAC;IAED,uBAAM,GAAN;QACE,OAAO,IAAI,CA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AK,OAAO,EAAE;YAC1B,IAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;YAEjC,IAAI,CAAC,IAAI;gBAAE,MAAM,IAAI,KAAK,CAAC,0BAA0B,GAAG,GAAG,CAAC,IAAI,CAAC,CAAA;YACjE,OAAO,CAAC,KAAK,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,CAAA;SAC/B;aAAM,IAAI,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE;YAC5B,OAAO,CAAC,KAAK,GAAG,QAAQ,CAAC,GAAG,CAAC,KAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAA;YAC3C,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAA;YACpB,sBAAsB;SACvB;IACH,CAAC;AACH,CAAC"} \ No newline at end of file diff --git a/dist/esm/src/nlp/totext.d.ts b/dist/esm/src/nlp/totext.d.ts deleted file mode 100644 index fdd43438..00000000 --- a/dist/esm/src/nlp/totext.d.ts +++ /dev/null @@ -1,58 +0,0 @@ -import { Language } from './i18n'; -import RRule from '../index'; -import { ByWeekday } from '../types'; -import { Weekday } from '../weekday'; -export declare type GetText = (id: string | number | Weekday) => string; -export declare type DateFormatter = (year: number, month: string, day: number) => string; -/** - * - * @param {RRule} rrule - * Optional: - * @param {Function} gettext function - * @param {Object} language definition - * @constructor - */ -export default class ToText { - static IMPLEMENTED: string[][]; - private rrule; - private text; - private gettext; - private dateFormatter; - private language; - private options; - private origOptions; - private bymonthday; - private byweekday; - constructor(rrule: RRule, gettext?: GetText, language?: Language, dateFormatter?: DateFormatter); - /** - * Test whether the rrule can be fully converted to text. - * @param {RRule} rrule - * @return {Boolean} - */ - static isFullyConvertible(rrule: RRule): boolean; - isFullyConvertible(): boolean; - /** - * Perform the conversion. Only some of the frequencies are supported. - * If some of the rrule's options aren't supported, they'll - * be omitted from the output an "(~ approximate)" will be appended. - * @return {*} - */ - toString(): string; - HOURLY(): void; - MINUTELY(): void; - DAILY(): void; - WEEKLY(): void; - MONTHLY(): void; - YEARLY(): void; - private _bymonthday; - private _byweekday; - private _byhour; - private _bymonth; - nth(n: number | string): string; - monthtext(m: number): string; - weekdaytext(wday: Weekday | number): string; - plural(n: number): boolean; - add(s: string): this; - list(arr: ByWeekday | ByWeekday[], callback?: GetText, finalDelim?: string, delim?: string): string; -} -//# sourceMappingURL=totext.d.ts.map \ No newline at end of file diff --git a/dist/esm/src/nlp/totext.d.ts.map b/dist/esm/src/nlp/totext.d.ts.map deleted file mode 100644 index b656d58b..00000000 --- a/dist/esm/src/nlp/totext.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"totext.d.ts","sourceRoot":"","sources":["../../../../src/nlp/totext.ts"],"names":[],"mappings":"AAAA,OAAgB,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAA;AAC1C,OAAO,KAAK,MAAM,UAAU,CAAA;AAC5B,OAAO,EAAW,SAAS,EAAE,MAAM,UAAU,CAAA;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAkBpC,oBAAY,OAAO,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,KAAK,MAAM,CAAA;AAI/D,oBAAY,aAAa,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,KAAK,MAAM,CAAA;AAIhF;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,OAAO,MAAM;IACzB,MAAM,CAAC,WAAW,EAAE,MAAM,EAAE,EAAE,CAAA;IAC9B,OAAO,CAAC,KAAK,CAAO;IACpB,OAAO,CAAC,IAAI,CAAU;IACtB,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,aAAa,CAAe;IACpC,OAAO,CAAC,QAAQ,CAAU;IAC1B,OAAO,CAAC,OAAO,CAAkB;IACjC,OAAO,CAAC,WAAW,CAAkB;IACrC,OAAO,CAAC,UAAU,CAA8B;IAChD,OAAO,CAAC,SAAS,CAKT;gBAEK,KAAK,EAAE,KAAK,EAAE,OAAO,GAAE,OAAwB,EAAE,QAAQ,GAAE,QAAkB,EAAE,aAAa,GAAE,aAAoC;IAiE/I;;;;OAIG;IACH,MAAM,CAAC,kBAAkB,CAAE,KAAK,EAAE,KAAK;IAcvC,kBAAkB;IAIlB;;;;;OAKG;IACH,QAAQ;IA4BR,MAAM;IAUN,QAAQ;IAYR,KAAK;IAgCL,MAAM;IAuCN,OAAO;IA4BP,MAAM;IAyCN,OAAO,CAAC,WAAW;IAiBnB,OAAO,CAAC,UAAU;IAiBlB,OAAO,CAAC,OAAO;IAQf,OAAO,CAAC,QAAQ;IAMhB,GAAG,CAAE,CAAC,EAAE,MAAM,GAAG,MAAM;IA8BvB,SAAS,CAAE,CAAC,EAAE,MAAM;IAIpB,WAAW,CAAE,IAAI,EAAE,OAAO,GAAG,MAAM;IAQnC,MAAM,CAAE,CAAC,EAAE,MAAM;IAIjB,GAAG,CAAE,CAAC,EAAE,MAAM;IAMd,IAAI,CAAE,GAAG,EAAE,SAAS,GAAG,SAAS,EAAE,EAAE,QAAQ,CAAC,EAAE,OAAO,EAAE,UAAU,CAAC,EAAE,MAAM,EAAE,KAAK,GAAE,MAAY;CAwCjG"} \ No newline at end of file diff --git a/dist/esm/src/nlp/totext.js b/dist/esm/src/nlp/totext.js deleted file mode 100644 index 174846c6..00000000 --- a/dist/esm/src/nlp/totext.js +++ /dev/null @@ -1,387 +0,0 @@ -import ENGLISH from './i18n'; -import RRule from '../index'; -import { isArray, isNumber, isPresent } from '../helpers'; -// ============================================================================= -// Helper functions -// ============================================================================= -/** - * Return true if a value is in an array - */ -var contains = function (arr, val) { - return arr.indexOf(val) !== -1; -}; -var defaultGetText = function (id) { return id.toString(); }; -var defaultDateFormatter = function (year, month, day) { return month + " " + day + ", " + year; }; -/** - * - * @param {RRule} rrule - * Optional: - * @param {Function} gettext function - * @param {Object} language definition - * @constructor - */ -var ToText = /** @class */ (function () { - function ToText(rrule, gettext, language, dateFormatter) { - if (gettext === void 0) { gettext = defaultGetText; } - if (language === void 0) { language = ENGLISH; } - if (dateFormatter === void 0) { dateFormatter = defaultDateFormatter; } - this.text = []; - this.language = language || ENGLISH; - this.gettext = gettext; - this.dateFormatter = dateFormatter; - this.rrule = rrule; - this.options = rrule.options; - this.origOptions = rrule.origOptions; - if (this.origOptions.bymonthday) { - var bymonthday = [].concat(this.options.bymonthday); - var bynmonthday = [].concat(this.options.bynmonthday); - bymonthday.sort(function (a, b) { return a - b; }); - bynmonthday.sort(function (a, b) { return b - a; }); - // 1, 2, 3, .., -5, -4, -3, .. - this.bymonthday = bymonthday.concat(bynmonthday); - if (!this.bymonthday.length) - this.bymonthday = null; - } - if (isPresent(this.origOptions.byweekday)) { - var byweekday = !isArray(this.origOptions.byweekday) - ? [this.origOptions.byweekday] - : this.origOptions.byweekday; - var days = String(byweekday); - this.byweekday = { - allWeeks: byweekday.filter(function (weekday) { - return !weekday.n; - }), - someWeeks: byweekday.filter(function (weekday) { - return Boolean(weekday.n); - }), - isWeekdays: days.indexOf('MO') !== -1 && - days.indexOf('TU') !== -1 && - days.indexOf('WE') !== -1 && - days.indexOf('TH') !== -1 && - days.indexOf('FR') !== -1 && - days.indexOf('SA') === -1 && - days.indexOf('SU') === -1, - isEveryDay: days.indexOf('MO') !== -1 && - days.indexOf('TU') !== -1 && - days.indexOf('WE') !== -1 && - days.indexOf('TH') !== -1 && - days.indexOf('FR') !== -1 && - days.indexOf('SA') !== -1 && - days.indexOf('SU') !== -1 - }; - var sortWeekDays = function (a, b) { - return a.weekday - b.weekday; - }; - this.byweekday.allWeeks.sort(sortWeekDays); - this.byweekday.someWeeks.sort(sortWeekDays); - if (!this.byweekday.allWeeks.length) - this.byweekday.allWeeks = null; - if (!this.byweekday.someWeeks.length) - this.byweekday.someWeeks = null; - } - else { - this.byweekday = null; - } - } - /** - * Test whether the rrule can be fully converted to text. - * @param {RRule} rrule - * @return {Boolean} - */ - ToText.isFullyConvertible = function (rrule) { - var canConvert = true; - if (!(rrule.options.freq in ToText.IMPLEMENTED)) - return false; - if (rrule.origOptions.until && rrule.origOptions.count) - return false; - for (var key in rrule.origOptions) { - if (contains(['dtstart', 'wkst', 'freq'], key)) - return true; - if (!contains(ToText.IMPLEMENTED[rrule.options.freq], key)) - return false; - } - return canConvert; - }; - ToText.prototype.isFullyConvertible = function () { - return ToText.isFullyConvertible(this.rrule); - }; - /** - * Perform the conversion. Only some of the frequencies are supported. - * If some of the rrule's options aren't supported, they'll - * be omitted from the output an "(~ approximate)" will be appended. - * @return {*} - */ - ToText.prototype.toString = function () { - var gettext = this.gettext; - if (!(this.options.freq in ToText.IMPLEMENTED)) { - return gettext('RRule error: Unable to fully convert this rrule to text'); - } - this.text = [gettext('every')]; - // @ts-ignore - this[RRule.FREQUENCIES[this.options.freq]](); - if (this.options.until) { - this.add(gettext('until')); - var until = this.options.until; - this.add(this.dateFormatter(until.getUTCFullYear(), this.language.monthNames[until.getUTCMonth()], until.getUTCDate())); - } - else if (this.options.count) { - this.add(gettext('for')) - .add(this.options.count.toString()) - .add(this.plural(this.options.count) ? gettext('times') : gettext('time')); - } - if (!this.isFullyConvertible()) - this.add(gettext('(~ approximate)')); - return this.text.join(''); - }; - ToText.prototype.HOURLY = function () { - var gettext = this.gettext; - if (this.options.interval !== 1) - this.add(this.options.interval.toString()); - this.add(this.plural(this.options.interval) ? gettext('hours') : gettext('hour')); - }; - ToText.prototype.MINUTELY = function () { - var gettext = this.gettext; - if (this.options.interval !== 1) - this.add(this.options.interval.toString()); - this.add(this.plural(this.options.interval) - ? gettext('minutes') - : gettext('minute')); - }; - ToText.prototype.DAILY = function () { - var gettext = this.gettext; - if (this.options.interval !== 1) - this.add(this.options.interval.toString()); - if (this.byweekday && this.byweekday.isWeekdays) { - this.add(this.plural(this.options.interval) - ? gettext('weekdays') - : gettext('weekday')); - } - else { - this.add(this.plural(this.options.interval) ? gettext('days') : gettext('day')); - } - if (this.origOptions.bymonth) { - this.add(gettext('in')); - this._bymonth(); - } - if (this.bymonthday) { - this._bymonthday(); - } - else if (this.byweekday) { - this._byweekday(); - } - else if (this.origOptions.byhour) { - this._byhour(); - } - }; - ToText.prototype.WEEKLY = function () { - var gettext = this.gettext; - if (this.options.interval !== 1) { - this.add(this.options.interval.toString()).add(this.plural(this.options.interval) ? gettext('weeks') : gettext('week')); - } - if (this.byweekday && this.byweekday.isWeekdays) { - if (this.options.interval === 1) { - this.add(this.plural(this.options.interval) - ? gettext('weekdays') - : gettext('weekday')); - } - else { - this.add(gettext('on')).add(gettext('weekdays')); - } - } - else if (this.byweekday && this.byweekday.isEveryDay) { - this.add(this.plural(this.options.interval) ? gettext('days') : gettext('day')); - } - else { - if (this.options.interval === 1) - this.add(gettext('week')); - if (this.origOptions.bymonth) { - this.add(gettext('in')); - this._bymonth(); - } - if (this.bymonthday) { - this._bymonthday(); - } - else if (this.byweekday) { - this._byweekday(); - } - } - }; - ToText.prototype.MONTHLY = function () { - var gettext = this.gettext; - if (this.origOptions.bymonth) { - if (this.options.interval !== 1) { - this.add(this.options.interval.toString()).add(gettext('months')); - if (this.plural(this.options.interval)) - this.add(gettext('in')); - } - else { - // this.add(gettext('MONTH')) - } - this._bymonth(); - } - else { - if (this.options.interval !== 1) - this.add(this.options.interval.toString()); - this.add(this.plural(this.options.interval) - ? gettext('months') - : gettext('month')); - } - if (this.bymonthday) { - this._bymonthday(); - } - else if (this.byweekday && this.byweekday.isWeekdays) { - this.add(gettext('on')).add(gettext('weekdays')); - } - else if (this.byweekday) { - this._byweekday(); - } - }; - ToText.prototype.YEARLY = function () { - var gettext = this.gettext; - if (this.origOptions.bymonth) { - if (this.options.interval !== 1) { - this.add(this.options.interval.toString()); - this.add(gettext('years')); - } - else { - // this.add(gettext('YEAR')) - } - this._bymonth(); - } - else { - if (this.options.interval !== 1) - this.add(this.options.interval.toString()); - this.add(this.plural(this.options.interval) ? gettext('years') : gettext('year')); - } - if (this.bymonthday) { - this._bymonthday(); - } - else if (this.byweekday) { - this._byweekday(); - } - if (this.options.byyearday) { - this.add(gettext('on the')) - .add(this.list(this.options.byyearday, this.nth, gettext('and'))) - .add(gettext('day')); - } - if (this.options.byweekno) { - this.add(gettext('in')) - .add(this.plural(this.options.byweekno.length) - ? gettext('weeks') - : gettext('week')) - .add(this.list(this.options.byweekno, undefined, gettext('and'))); - } - }; - ToText.prototype._bymonthday = function () { - var gettext = this.gettext; - if (this.byweekday && this.byweekday.allWeeks) { - this.add(gettext('on')) - .add(this.list(this.byweekday.allWeeks, this.weekdaytext, gettext('or'))) - .add(gettext('the')) - .add(this.list(this.bymonthday, this.nth, gettext('or'))); - } - else { - this.add(gettext('on the')).add(this.list(this.bymonthday, this.nth, gettext('and'))); - } - // this.add(gettext('DAY')) - }; - ToText.prototype._byweekday = function () { - var gettext = this.gettext; - if (this.byweekday.allWeeks && !this.byweekday.isWeekdays) { - this.add(gettext('on')).add(this.list(this.byweekday.allWeeks, this.weekdaytext)); - } - if (this.byweekday.someWeeks) { - if (this.byweekday.allWeeks) - this.add(gettext('and')); - this.add(gettext('on the')).add(this.list(this.byweekday.someWeeks, this.weekdaytext, gettext('and'))); - } - }; - ToText.prototype._byhour = function () { - var gettext = this.gettext; - this.add(gettext('at')).add(this.list(this.origOptions.byhour, undefined, gettext('and'))); - }; - ToText.prototype._bymonth = function () { - this.add(this.list(this.options.bymonth, this.monthtext, this.gettext('and'))); - }; - ToText.prototype.nth = function (n) { - n = parseInt(n.toString(), 10); - var nth; - var npos; - var gettext = this.gettext; - if (n === -1) - return gettext('last'); - npos = Math.abs(n); - switch (npos) { - case 1: - case 21: - case 31: - nth = npos + gettext('st'); - break; - case 2: - case 22: - nth = npos + gettext('nd'); - break; - case 3: - case 23: - nth = npos + gettext('rd'); - break; - default: - nth = npos + gettext('th'); - } - return n < 0 ? nth + ' ' + gettext('last') : nth; - }; - ToText.prototype.monthtext = function (m) { - return this.language.monthNames[m - 1]; - }; - ToText.prototype.weekdaytext = function (wday) { - var weekday = isNumber(wday) ? (wday + 1) % 7 : wday.getJsWeekday(); - return ((wday.n ? this.nth(wday.n) + ' ' : '') + this.language.dayNames[weekday]); - }; - ToText.prototype.plural = function (n) { - return n % 100 !== 1; - }; - ToText.prototype.add = function (s) { - this.text.push(' '); - this.text.push(s); - return this; - }; - ToText.prototype.list = function (arr, callback, finalDelim, delim) { - if (delim === void 0) { delim = ','; } - if (!isArray(arr)) { - arr = [arr]; - } - var delimJoin = function (array, delimiter, finalDelimiter) { - var list = ''; - for (var i = 0; i < array.length; i++) { - if (i !== 0) { - if (i === array.length - 1) { - list += ' ' + finalDelimiter + ' '; - } - else { - list += delimiter + ' '; - } - } - list += array[i]; - } - return list; - }; - callback = - callback || - function (o) { - return o.toString(); - }; - var self = this; - var realCallback = function (arg) { - return callback && callback.call(self, arg); - }; - if (finalDelim) { - return delimJoin(arr.map(realCallback), delim, finalDelim); - } - else { - return arr.map(realCallback).join(delim + ' '); - } - }; - return ToText; -}()); -export default ToText; -//# sourceMappingURL=totext.js.map \ No newline at end of file diff --git a/dist/esm/src/nlp/totext.js.map b/dist/esm/src/nlp/totext.js.map deleted file mode 100644 index ac52bcd6..00000000 --- a/dist/esm/src/nlp/totext.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"totext.js","sourceRoot":"","sources":["../../../../src/nlp/totext.ts"],"names":[],"mappings":"AAAA,OAAO,OAAqB,MAAM,QAAQ,CAAA;AAC1C,OAAO,KAAK,MAAM,UAAU,CAAA;AAG5B,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAY,MAAM,YAAY,CAAA;AAEnE,gFAAgF;AAChF,mBAAmB;AACnB,gFAAgF;AAEhF;;GAEG;AACH,IAAM,QAAQ,GAAG,UAAU,GAAa,EAAE,GAAW;IACnD,OAAO,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAA;AAChC,CAAC,CAAA;AAQD,IAAM,cAAc,GAA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,IAAI,CAAC,KAAK,CAAC,EAAE;oBACX,IAAI,CAAC,KAAK,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE;wBAC1B,IAAI,IAAI,GAAG,GAAG,cAAc,GAAG,GAAG,CAAA;qBACnC;yBAAM;wBACL,IAAI,IAAI,SAAS,GAAG,GAAG,CAAA;qBACxB;iBACF;gBACD,IAAI,IAAI,KAAK,CAAC,CAAC,CAAC,CAAA;aACjB;YACD,OAAO,IAAI,CAAA;QACb,CAAC,CAAA;QAED,QAAQ;YACN,QAAQ;gBACR,UAAU,CAAC;oBACT,OAAO,CAAC,CAAC,QAAQ,EAAE,CAAA;gBACrB,CAAC,CAAA;QACH,IAAM,IAAI,GAAG,IAAI,CAAA;QACjB,IAAM,YAAY,GAAG,UAAU,GAAc;YAC3C,OAAO,QAAQ,IAAI,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,CAAC,CAAA;QAC7C,CAAC,CAAA;QAED,IAAI,UAAU,EAAE;YACd,OAAO,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE,KAAK,EAAE,UAAU,CAAC,CAAA;SAC3D;aAAM;YACL,OAAO,GAAG,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,KAAK,GAAG,GAAG,CAAC,CAAA;SAC/C;IACH,CAAC;IACH,aAAC;AAAD,CAAC,AAzbD,IAybC"} \ No newline at end of file diff --git a/dist/esm/src/optionstostring.d.ts b/dist/esm/src/optionstostring.d.ts deleted file mode 100644 index 9a3f66a6..00000000 --- a/dist/esm/src/optionstostring.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { Options } from './types'; -export declare function optionsToString(options: Partial): string; -//# sourceMappingURL=optionstostring.d.ts.map \ No newline at end of file diff --git a/dist/esm/src/optionstostring.d.ts.map b/dist/esm/src/optionstostring.d.ts.map deleted file mode 100644 index a9953f8f..00000000 --- a/dist/esm/src/optionstostring.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"optionstostring.d.ts","sourceRoot":"","sources":["../../../src/optionstostring.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAOjC,wBAAgB,eAAe,CAAE,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,UAqFzD"} \ No newline at end of file diff --git a/dist/esm/src/optionstostring.js b/dist/esm/src/optionstostring.js deleted file mode 100644 index f23ddb9d..00000000 --- a/dist/esm/src/optionstostring.js +++ /dev/null @@ -1,94 +0,0 @@ -import RRule, { DEFAULT_OPTIONS } from './rrule'; -import { includes, isPresent, isArray, isNumber, toArray } from './helpers'; -import { Weekday } from './weekday'; -import dateutil from './dateutil'; -import { DateWithZone } from './datewithzone'; -export function optionsToString(options) { - var rrule = []; - var dtstart = ''; - var keys = Object.keys(options); - var defaultKeys = Object.keys(DEFAULT_OPTIONS); - for (var i = 0; i < keys.length; i++) { - if (keys[i] === 'tzid') - continue; - if (!includes(defaultKeys, keys[i])) - continue; - var key = keys[i].toUpperCase(); - var value = options[keys[i]]; - var outValue = ''; - if (!isPresent(value) || (isArray(value) && !value.length)) - continue; - switch (key) { - case 'FREQ': - outValue = RRule.FREQUENCIES[options.freq]; - break; - case 'WKST': - if (isNumber(value)) { - outValue = new Weekday(value).toString(); - } - else { - outValue = value.toString(); - } - break; - case 'BYWEEKDAY': - /* - NOTE: BYWEEKDAY is a special case. - RRule() deconstructs the rule.options.byweekday array - into an array of Weekday arguments. - On the other hand, rule.origOptions is an array of Weekdays. - We need to handle both cases here. - It might be worth change RRule to keep the Weekdays. - - Also, BYWEEKDAY (used by RRule) vs. BYDAY (RFC) - - */ - key = 'BYDAY'; - outValue = toArray(value).map(function (wday) { - if (wday instanceof Weekday) { - return wday; - } - if (isArray(wday)) { - return new Weekday(wday[0], wday[1]); - } - return new Weekday(wday); - }).toString(); - break; - case 'DTSTART': - dtstart = buildDtstart(value, options.tzid); - break; - case 'UNTIL': - outValue = dateutil.timeToUntilString(value, !options.tzid); - break; - default: - if (isArray(value)) { - var strValues = []; - for (var j = 0; j < value.length; j++) { - strValues[j] = String(value[j]); - } - outValue = strValues.toString(); - } - else { - outValue = String(value); - } - } - if (outValue) { - rrule.push([key, outValue]); - } - } - var rules = rrule.map(function (_a) { - var key = _a[0], value = _a[1]; - return key + "=" + value.toString(); - }).join(';'); - var ruleString = ''; - if (rules !== '') { - ruleString = "RRULE:" + rules; - } - return [dtstart, ruleString].filter(function (x) { return !!x; }).join('\n'); -} -function buildDtstart(dtstart, tzid) { - if (!dtstart) { - return ''; - } - return 'DTSTART' + new DateWithZone(new Date(dtstart), tzid).toString(); -} -//# sourceMappingURL=optionstostring.js.map \ No newline at end of file diff --git a/dist/esm/src/optionstostring.js.map b/dist/esm/src/optionstostring.js.map deleted file mode 100644 index 33ba6c9e..00000000 --- a/dist/esm/src/optionstostring.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"optionstostring.js","sourceRoot":"","sources":["../../../src/optionstostring.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAChD,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAC3E,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,QAAQ,MAAM,YAAY,CAAA;AACjC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAE7C,MAAM,UAAU,eAAe,CAAE,OAAyB;IACxD,IAAI,KAAK,GAAe,EAAE,CAAA;IAC1B,IAAI,OAAO,GAAW,EAAE,CAAA;IACxB,IAAM,IAAI,GAAsB,MAAM,CAAC,IAAI,CAAC,OAAO,CAAsB,CAAA;IACzE,IAAM,WAAW,GAAG,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,CAAA;IAEhD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IA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AC,CAAC,CAAC,EAAH,CAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AAC5D,CAAC;AAED,SAAS,YAAY,CAAE,OAAgB,EAAE,IAAoB;IAC3D,IAAI,CAAC,OAAO,EAAE;QACZ,OAAO,EAAE,CAAA;KACV;IAED,OAAO,SAAS,GAAG,IAAI,YAAY,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAA;AACzE,CAAC"} \ No newline at end of file diff --git a/dist/esm/src/parseoptions.d.ts b/dist/esm/src/parseoptions.d.ts deleted file mode 100644 index fe0d23ac..00000000 --- a/dist/esm/src/parseoptions.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { Options, ParsedOptions } from './types'; -import { Weekday } from './weekday'; -import { Time } from './datetime'; -export declare function initializeOptions(options: Partial): { - freq?: import("./types").Frequency | undefined; - dtstart?: Date | null | undefined; - interval?: number | undefined; - wkst?: number | Weekday | null | undefined; - count?: number | null | undefined; - until?: Date | null | undefined; - tzid?: string | null | undefined; - bysetpos?: number | number[] | null | undefined; - bymonth?: number | number[] | null | undefined; - bymonthday?: number | number[] | null | undefined; - bynmonthday?: number[] | null | undefined; - byyearday?: number | number[] | null | undefined; - byweekno?: number | number[] | null | undefined; - byweekday?: number | Weekday | "MO" | "TU" | "WE" | "TH" | "FR" | "SA" | "SU" | import("./types").ByWeekday[] | null | undefined; - bynweekday?: number[][] | null | undefined; - byhour?: number | number[] | null | undefined; - byminute?: number | number[] | null | undefined; - bysecond?: number | number[] | null | undefined; - byeaster?: number | null | undefined; -}; -export declare function parseOptions(options: Partial): { - parsedOptions: ParsedOptions; -}; -export declare function buildTimeset(opts: ParsedOptions): Time[]; -//# sourceMappingURL=parseoptions.d.ts.map \ No newline at end of file diff --git a/dist/esm/src/parseoptions.d.ts.map b/dist/esm/src/parseoptions.d.ts.map deleted file mode 100644 index 59b34252..00000000 --- a/dist/esm/src/parseoptions.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"parseoptions.d.ts","sourceRoot":"","sources":["../../../src/parseoptions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,aAAa,EAAwB,MAAM,SAAS,CAAA;AAItE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AAEjC,wBAAgB,iBAAiB,CAAE,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC;;;;;;;;;;;;;;;;;;;;EAe3D;AAED,wBAAgB,YAAY,CAAE,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC;;EAyKtD;AAED,wBAAgB,YAAY,CAAE,IAAI,EAAE,aAAa,UAgBhD"} \ No newline at end of file diff --git a/dist/esm/src/parseoptions.js b/dist/esm/src/parseoptions.js deleted file mode 100644 index e4e66b66..00000000 --- a/dist/esm/src/parseoptions.js +++ /dev/null @@ -1,201 +0,0 @@ -import { __assign } from "tslib"; -import { freqIsDailyOrGreater } from './types'; -import { includes, notEmpty, isPresent, isNumber, isArray, isWeekdayStr } from './helpers'; -import RRule, { defaultKeys, DEFAULT_OPTIONS } from './rrule'; -import dateutil from './dateutil'; -import { Weekday } from './weekday'; -import { Time } from './datetime'; -export function initializeOptions(options) { - var invalid = []; - var keys = Object.keys(options); - // Shallow copy for options and origOptions and check for invalid - for (var _i = 0, keys_1 = keys; _i < keys_1.length; _i++) { - var key = keys_1[_i]; - if (!includes(defaultKeys, key)) - invalid.push(key); - if (dateutil.isDate(options[key]) && !dateutil.isValidDate(options[key])) - invalid.push(key); - } - if (invalid.length) { - throw new Error('Invalid options: ' + invalid.join(', ')); - } - return __assign({}, options); -} -export function parseOptions(options) { - var opts = __assign(__assign({}, DEFAULT_OPTIONS), initializeOptions(options)); - if (isPresent(opts.byeaster)) - opts.freq = RRule.YEARLY; - if (!(isPresent(opts.freq) && RRule.FREQUENCIES[opts.freq])) { - throw new Error("Invalid frequency: " + opts.freq + " " + options.freq); - } - if (!opts.dtstart) - opts.dtstart = new Date(new Date().setMilliseconds(0)); - if (!isPresent(opts.wkst)) { - opts.wkst = RRule.MO.weekday; - } - else if (isNumber(opts.wkst)) { - // cool, just keep it like that - } - else { - opts.wkst = opts.wkst.weekday; - } - if (isPresent(opts.bysetpos)) { - if (isNumber(opts.bysetpos)) - opts.bysetpos = [opts.bysetpos]; - for (var i = 0; i < opts.bysetpos.length; i++) { - var v = opts.bysetpos[i]; - if (v === 0 || !(v >= -366 && v <= 366)) { - throw new Error('bysetpos must be between 1 and 366,' + ' or between -366 and -1'); - } - } - } - if (!(Boolean(opts.byweekno) || - notEmpty(opts.byweekno) || - notEmpty(opts.byyearday) || - Boolean(opts.bymonthday) || - notEmpty(opts.bymonthday) || - isPresent(opts.byweekday) || - isPresent(opts.byeaster))) { - switch (opts.freq) { - case RRule.YEARLY: - if (!opts.bymonth) - opts.bymonth = opts.dtstart.getUTCMonth() + 1; - opts.bymonthday = opts.dtstart.getUTCDate(); - break; - case RRule.MONTHLY: - opts.bymonthday = opts.dtstart.getUTCDate(); - break; - case RRule.WEEKLY: - opts.byweekday = [dateutil.getWeekday(opts.dtstart)]; - break; - } - } - // bymonth - if (isPresent(opts.bymonth) && !isArray(opts.bymonth)) { - opts.bymonth = [opts.bymonth]; - } - // byyearday - if (isPresent(opts.byyearday) && - !isArray(opts.byyearday) && - isNumber(opts.byyearday)) { - opts.byyearday = [opts.byyearday]; - } - // bymonthday - if (!isPresent(opts.bymonthday)) { - opts.bymonthday = []; - opts.bynmonthday = []; - } - else if (isArray(opts.bymonthday)) { - var bymonthday = []; - var bynmonthday = []; - for (var i = 0; i < opts.bymonthday.length; i++) { - var v = opts.bymonthday[i]; - if (v > 0) { - bymonthday.push(v); - } - else if (v < 0) { - bynmonthday.push(v); - } - } - opts.bymonthday = bymonthday; - opts.bynmonthday = bynmonthday; - } - else if (opts.bymonthday < 0) { - opts.bynmonthday = [opts.bymonthday]; - opts.bymonthday = []; - } - else { - opts.bynmonthday = []; - opts.bymonthday = [opts.bymonthday]; - } - // byweekno - if (isPresent(opts.byweekno) && !isArray(opts.byweekno)) { - opts.byweekno = [opts.byweekno]; - } - // byweekday / bynweekday - if (!isPresent(opts.byweekday)) { - opts.bynweekday = null; - } - else if (isNumber(opts.byweekday)) { - opts.byweekday = [opts.byweekday]; - opts.bynweekday = null; - } - else if (isWeekdayStr(opts.byweekday)) { - opts.byweekday = [Weekday.fromStr(opts.byweekday).weekday]; - opts.bynweekday = null; - } - else if (opts.byweekday instanceof Weekday) { - if (!opts.byweekday.n || opts.freq > RRule.MONTHLY) { - opts.byweekday = [opts.byweekday.weekday]; - opts.bynweekday = null; - } - else { - opts.bynweekday = [[opts.byweekday.weekday, opts.byweekday.n]]; - opts.byweekday = null; - } - } - else { - var byweekday = []; - var bynweekday = []; - for (var i = 0; i < opts.byweekday.length; i++) { - var wday = opts.byweekday[i]; - if (isNumber(wday)) { - byweekday.push(wday); - continue; - } - else if (isWeekdayStr(wday)) { - byweekday.push(Weekday.fromStr(wday).weekday); - continue; - } - if (!wday.n || opts.freq > RRule.MONTHLY) { - byweekday.push(wday.weekday); - } - else { - bynweekday.push([wday.weekday, wday.n]); - } - } - opts.byweekday = notEmpty(byweekday) ? byweekday : null; - opts.bynweekday = notEmpty(bynweekday) ? bynweekday : null; - } - // byhour - if (!isPresent(opts.byhour)) { - opts.byhour = - opts.freq < RRule.HOURLY ? [opts.dtstart.getUTCHours()] : null; - } - else if (isNumber(opts.byhour)) { - opts.byhour = [opts.byhour]; - } - // byminute - if (!isPresent(opts.byminute)) { - opts.byminute = - opts.freq < RRule.MINUTELY ? [opts.dtstart.getUTCMinutes()] : null; - } - else if (isNumber(opts.byminute)) { - opts.byminute = [opts.byminute]; - } - // bysecond - if (!isPresent(opts.bysecond)) { - opts.bysecond = - opts.freq < RRule.SECONDLY ? [opts.dtstart.getUTCSeconds()] : null; - } - else if (isNumber(opts.bysecond)) { - opts.bysecond = [opts.bysecond]; - } - return { parsedOptions: opts }; -} -export function buildTimeset(opts) { - var millisecondModulo = opts.dtstart.getTime() % 1000; - if (!freqIsDailyOrGreater(opts.freq)) { - return []; - } - var timeset = []; - opts.byhour.forEach(function (hour) { - opts.byminute.forEach(function (minute) { - opts.bysecond.forEach(function (second) { - timeset.push(new Time(hour, minute, second, millisecondModulo)); - }); - }); - }); - return timeset; -} -//# sourceMappingURL=parseoptions.js.map \ No newline at end of file diff --git a/dist/esm/src/parseoptions.js.map b/dist/esm/src/parseoptions.js.map deleted file mode 100644 index e97ca48b..00000000 --- a/dist/esm/src/parseoptions.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"parseoptions.js","sourceRoot":"","sources":["../../../src/parseoptions.ts"],"names":[],"mappings":";AAAA,OAAO,EAA0B,oBAAoB,EAAE,MAAM,SAAS,CAAA;AACtE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAC1F,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAC7D,OAAO,QAAQ,MAAM,YAAY,CAAA;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AAEjC,MAAM,UAAU,iBAAiB,CAAE,OAAyB;IAC1D,IAAM,OAAO,GAAa,EAAE,CAAA;IAC5B,IAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAsB,CAAA;IAEtD,iEAAiE;IACjE,KAAkB,UAAI,EAAJ,aAAI,EAAJ,kBAAI,EAAJ,IAAI,EAAE;QAAnB,IAAM,GAAG,aAAA;QACZ,IAAI,CAAC,QAAQ,CAAC,WAAW,EAAE,GAAG,CAAC;YAAE,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;QAClD,IAAI,QAAQ,CAAC,MAAM,C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E,IAAqB,EAAE,CAAA;AACjD,CAAC;AAED,MAAM,UAAU,YAAY,CAAE,IAAmB;IAC/C,IAAM,iBAAiB,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG,IAAI,CAAA;IACvD,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;QACpC,OAAO,EAAE,CAAA;KACV;IAED,IAAM,OAAO,GAAW,EAAE,CAAA;IAC1B,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,UAAA,IAAI;QACtB,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,UAAA,MAAM;YAC1B,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,UAAA,MAAM;gBAC1B,OAAO,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,iBAAiB,CAAC,CAAC,CAAA;YACjE,CAAC,CAAC,CAAA;QACJ,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;IAEF,OAAO,OAAO,CAAA;AAChB,CAAC"} \ No newline at end of file diff --git a/dist/esm/src/parsestring.d.ts b/dist/esm/src/parsestring.d.ts deleted file mode 100644 index 9fcd4cc2..00000000 --- a/dist/esm/src/parsestring.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { Options } from './types'; -export declare function parseString(rfcString: string): Partial; -export declare function parseDtstart(line: string): Partial; -//# sourceMappingURL=parsestring.d.ts.map \ No newline at end of file diff --git a/dist/esm/src/parsestring.d.ts.map b/dist/esm/src/parsestring.d.ts.map deleted file mode 100644 index 0dc49380..00000000 --- a/dist/esm/src/parsestring.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"parsestring.d.ts","sourceRoot":"","sources":["../../../src/parsestring.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAa,MAAM,SAAS,CAAA;AAK5C,wBAAgB,WAAW,CAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAGhE;AAED,wBAAgB,YAAY,CAAE,IAAI,EAAE,MAAM,oBAgBzC"} \ No newline at end of file diff --git a/dist/esm/src/parsestring.js b/dist/esm/src/parsestring.js deleted file mode 100644 index bce7ae89..00000000 --- a/dist/esm/src/parsestring.js +++ /dev/null @@ -1,121 +0,0 @@ -import { __assign } from "tslib"; -import { Frequency } from './types'; -import { Weekday } from './weekday'; -import dateutil from './dateutil'; -import { Days } from './rrule'; -export function parseString(rfcString) { - var options = rfcString.split('\n').map(parseLine).filter(function (x) { return x !== null; }); - return __assign(__assign({}, options[0]), options[1]); -} -export function parseDtstart(line) { - var options = {}; - var dtstartWithZone = /DTSTART(?:;TZID=([^:=]+?))?(?::|=)([^;\s]+)/i.exec(line); - if (!dtstartWithZone) { - return options; - } - var _ = dtstartWithZone[0], tzid = dtstartWithZone[1], dtstart = dtstartWithZone[2]; - if (tzid) { - options.tzid = tzid; - } - options.dtstart = dateutil.untilStringToDate(dtstart); - return options; -} -function parseLine(rfcString) { - rfcString = rfcString.replace(/^\s+|\s+$/, ''); - if (!rfcString.length) - return null; - var header = /^([A-Z]+?)[:;]/.exec(rfcString.toUpperCase()); - if (!header) { - return parseRrule(rfcString); - } - var _ = header[0], key = header[1]; - switch (key.toUpperCase()) { - case 'RRULE': - case 'EXRULE': - return parseRrule(rfcString); - case 'DTSTART': - return parseDtstart(rfcString); - default: - throw new Error("Unsupported RFC prop " + key + " in " + rfcString); - } -} -function parseRrule(line) { - var strippedLine = line.replace(/^RRULE:/i, ''); - var options = parseDtstart(strippedLine); - var attrs = line.replace(/^(?:RRULE|EXRULE):/i, '').split(';'); - attrs.forEach(function (attr) { - var _a = attr.split('='), key = _a[0], value = _a[1]; - switch (key.toUpperCase()) { - case 'FREQ': - options.freq = Frequency[value.toUpperCase()]; - break; - case 'WKST': - options.wkst = Days[value.toUpperCase()]; - break; - case 'COUNT': - case 'INTERVAL': - case 'BYSETPOS': - case 'BYMONTH': - case 'BYMONTHDAY': - case 'BYYEARDAY': - case 'BYWEEKNO': - case 'BYHOUR': - case 'BYMINUTE': - case 'BYSECOND': - var num = parseNumber(value); - var optionKey = key.toLowerCase(); - // @ts-ignore - options[optionKey] = num; - break; - case 'BYWEEKDAY': - case 'BYDAY': - options.byweekday = parseWeekday(value); - break; - case 'DTSTART': - case 'TZID': - // for backwards compatibility - var dtstart = parseDtstart(line); - options.tzid = dtstart.tzid; - options.dtstart = dtstart.dtstart; - break; - case 'UNTIL': - options.until = dateutil.untilStringToDate(value); - break; - case 'BYEASTER': - options.byeaster = Number(value); - break; - default: - throw new Error("Unknown RRULE property '" + key + "'"); - } - }); - return options; -} -function parseNumber(value) { - if (value.indexOf(',') !== -1) { - var values = value.split(','); - return values.map(parseIndividualNumber); - } - return parseIndividualNumber(value); -} -function parseIndividualNumber(value) { - if (/^[+-]?\d+$/.test(value)) { - return Number(value); - } - return value; -} -function parseWeekday(value) { - var days = value.split(','); - return days.map(function (day) { - if (day.length === 2) { - // MO, TU, ... - return Days[day]; // wday instanceof Weekday - } - // -1MO, +3FR, 1SO, 13TU ... - var parts = day.match(/^([+-]?\d{1,2})([A-Z]{2})$/); - var n = Number(parts[1]); - var wdaypart = parts[2]; - var wday = Days[wdaypart].weekday; - return new Weekday(wday, n); - }); -} -//# sourceMappingURL=parsestring.js.map \ No newline at end of file diff --git a/dist/esm/src/parsestring.js.map b/dist/esm/src/parsestring.js.map deleted file mode 100644 index 69bf051c..00000000 --- a/dist/esm/src/parsestring.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"parsestring.js","sourceRoot":"","sources":["../../../src/parsestring.ts"],"names":[],"mappings":";AAAA,OAAO,EAAW,SAAS,EAAE,MAAM,SAAS,CAAA;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,QAAQ,MAAM,YAAY,CAAA;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAE9B,MAAM,UAAU,WAAW,CAAE,SAA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B,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC,EAAE;YACpB,cAAc;YACd,OAAO,IAAI,CAAC,GAAwB,CAAC,CAAA,CAAC,0BAA0B;SACjE;QAED,4BAA4B;QAC5B,IAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,4BAA4B,CAAE,CAAA;QACtD,IAAM,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAA;QAC1B,IAAM,QAAQ,GAAG,KAAK,CAAC,CAAC,CAAsB,CAAA;QAC9C,IAAM,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAA;QACnC,OAAO,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,CAAA;IAC7B,CAAC,CAAC,CAAA;AACJ,CAAC"} \ No newline at end of file diff --git a/dist/esm/src/rrule.d.ts b/dist/esm/src/rrule.d.ts deleted file mode 100644 index c9da82f9..00000000 --- a/dist/esm/src/rrule.d.ts +++ /dev/null @@ -1,106 +0,0 @@ -import IterResult, { IterArgs } from './iterresult'; -import { Language } from './nlp/i18n'; -import { DateFormatter, GetText } from './nlp/totext'; -import { ParsedOptions, Options, Frequency, QueryMethods, QueryMethodTypes, IterResultType } from './types'; -import { parseString } from './parsestring'; -import { optionsToString } from './optionstostring'; -import { Cache, CacheKeys } from './cache'; -import { Weekday } from './weekday'; -export declare const Days: { - MO: Weekday; - TU: Weekday; - WE: Weekday; - TH: Weekday; - FR: Weekday; - SA: Weekday; - SU: Weekday; -}; -export declare const DEFAULT_OPTIONS: Options; -export declare const defaultKeys: ("freq" | "dtstart" | "interval" | "wkst" | "count" | "until" | "tzid" | "bysetpos" | "bymonth" | "bymonthday" | "bynmonthday" | "byyearday" | "byweekno" | "byweekday" | "bynweekday" | "byhour" | "byminute" | "bysecond" | "byeaster")[]; -/** - * - * @param {Options?} options - see - * The only required option is `freq`, one of RRule.YEARLY, RRule.MONTHLY, ... - * @constructor - */ -export default class RRule implements QueryMethods { - _cache: Cache | null; - origOptions: Partial; - options: ParsedOptions; - static readonly FREQUENCIES: (keyof typeof Frequency)[]; - static readonly YEARLY = Frequency.YEARLY; - static readonly MONTHLY = Frequency.MONTHLY; - static readonly WEEKLY = Frequency.WEEKLY; - static readonly DAILY = Frequency.DAILY; - static readonly HOURLY = Frequency.HOURLY; - static readonly MINUTELY = Frequency.MINUTELY; - static readonly SECONDLY = Frequency.SECONDLY; - static readonly MO: Weekday; - static readonly TU: Weekday; - static readonly WE: Weekday; - static readonly TH: Weekday; - static readonly FR: Weekday; - static readonly SA: Weekday; - static readonly SU: Weekday; - constructor(options?: Partial, noCache?: boolean); - static parseText(text: string, language?: Language): Partial | null; - static fromText(text: string, language?: Language): RRule; - static parseString: typeof parseString; - static fromString(str: string): RRule; - static optionsToString: typeof optionsToString; - protected _iter(iterResult: IterResult): IterResultType; - private _cacheGet; - _cacheAdd(what: CacheKeys | 'all', value: Date[] | Date | null, args?: Partial): void; - /** - * @param {Function} iterator - optional function that will be called - * on each date that is added. It can return false - * to stop the iteration. - * @return Array containing all recurrences. - */ - all(iterator?: (d: Date, len: number) => boolean): Date[]; - /** - * Returns all the occurrences of the rrule between after and before. - * The inc keyword defines what happens if after and/or before are - * themselves occurrences. With inc == True, they will be included in the - * list, if they are found in the recurrence set. - * @return Array - */ - between(after: Date, before: Date, inc?: boolean, iterator?: (d: Date, len: number) => boolean): Date[]; - /** - * Returns the last recurrence before the given datetime instance. - * The inc keyword defines what happens if dt is an occurrence. - * With inc == True, if dt itself is an occurrence, it will be returned. - * @return Date or null - */ - before(dt: Date, inc?: boolean): Date; - /** - * Returns the first recurrence after the given datetime instance. - * The inc keyword defines what happens if dt is an occurrence. - * With inc == True, if dt itself is an occurrence, it will be returned. - * @return Date or null - */ - after(dt: Date, inc?: boolean): Date; - /** - * Returns the number of recurrences in this set. It will have go trough - * the whole recurrence, if this hasn't been done before. - */ - count(): number; - /** - * Converts the rrule into its string representation - * @see - * @return String - */ - toString(): string; - /** - * Will convert all rules described in nlp:ToText - * to text. - */ - toText(gettext?: GetText, language?: Language, dateFormatter?: DateFormatter): string; - isFullyConvertibleToText(): boolean; - /** - * @return a RRule instance with the same freq and options - * as this one (cache is not cloned) - */ - clone(): RRule; -} -//# sourceMappingURL=rrule.d.ts.map \ No newline at end of file diff --git a/dist/esm/src/rrule.d.ts.map b/dist/esm/src/rrule.d.ts.map deleted file mode 100644 index 0ea3a052..00000000 --- a/dist/esm/src/rrule.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"rrule.d.ts","sourceRoot":"","sources":["../../../src/rrule.ts"],"names":[],"mappings":"AAEA,OAAO,UAAU,EAAE,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AAEnD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAErC,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACrD,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAE3G,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAC1C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAoBnC,eAAO,MAAM,IAAI;;;;;;;;CAQhB,CAAA;AAED,eAAO,MAAM,eAAe,EAAE,OAoB7B,CAAA;AAED,eAAO,MAAM,WAAW,6OAAoD,CAAA;AAE5E;;;;;GAKG;AACH,MAAM,CAAC,OAAO,OAAO,KAAM,YAAW,YAAY;IACzC,MAAM,EAAE,KAAK,GAAG,IAAI,CAAA;IACpB,WAAW,EAAE,OAAO,CAAC,OAAO,CAAC,CAAA;IAC7B,OAAO,EAAE,aAAa,CAAA;IAI7B,MAAM,CAAC,QAAQ,CAAC,WAA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B,KAAK,EAAE,IAAI,EAAE,GAAG,IAAI,GAAG,IAAI,EAC3B,IAAI,CAAC,EAAE,OAAO,CAAC,QAAQ,CAAC;IAM1B;;;;;OAKG;IACH,GAAG,CAAE,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,KAAK,OAAO,GAAG,IAAI,EAAE;IAa1D;;;;;;OAMG;IACH,OAAO,CACL,KAAK,EAAE,IAAI,EACX,MAAM,EAAE,IAAI,EACZ,GAAG,GAAE,OAAe,EACpB,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,KAAK,OAAO,GAC3C,IAAI,EAAE;IAsBT;;;;;OAKG;IACH,MAAM,CAAE,EAAE,EAAE,IAAI,EAAE,GAAG,UAAQ,GAAG,IAAI;IAWpC;;;;;OAKG;IACH,KAAK,CAAE,EAAE,EAAE,IAAI,EAAE,GAAG,UAAQ,GAAG,IAAI;IAWnC;;;OAGG;IACH,KAAK,IAAK,MAAM;IAIhB;;;;OAIG;IACH,QAAQ;IAIR;;;OAGG;IACH,MAAM,CAAE,OAAO,CAAC,EAAE,OAAO,EAAE,QAAQ,CAAC,EAAE,QAAQ,EAAE,aAAa,CAAC,EAAE,aAAa;IAI7E,wBAAwB;IAIxB;;;OAGG;IACH,KAAK,IAAK,KAAK;CAGhB"} \ No newline at end of file diff --git a/dist/esm/src/rrule.js b/dist/esm/src/rrule.js deleted file mode 100644 index b1ae4bf6..00000000 --- a/dist/esm/src/rrule.js +++ /dev/null @@ -1,231 +0,0 @@ -import dateutil from './dateutil'; -import IterResult from './iterresult'; -import CallbackIterResult from './callbackiterresult'; -import { Frequency } from './types'; -import { parseOptions, initializeOptions } from './parseoptions'; -import { parseString } from './parsestring'; -import { optionsToString } from './optionstostring'; -import { Cache } from './cache'; -import { Weekday } from './weekday'; -import { iter } from './iter/index'; -var getnlp = function () { - // Lazy, runtime import to avoid circular refs. - if (!getnlp._nlp) { - getnlp._nlp = require('./nlp'); - } - return getnlp._nlp; -}; -// ============================================================================= -// RRule -// ============================================================================= -export var Days = { - MO: new Weekday(0), - TU: new Weekday(1), - WE: new Weekday(2), - TH: new Weekday(3), - FR: new Weekday(4), - SA: new Weekday(5), - SU: new Weekday(6) -}; -export var DEFAULT_OPTIONS = { - freq: Frequency.YEARLY, - dtstart: null, - interval: 1, - wkst: Days.MO, - count: null, - until: null, - tzid: null, - bysetpos: null, - bymonth: null, - bymonthday: null, - bynmonthday: null, - byyearday: null, - byweekno: null, - byweekday: null, - bynweekday: null, - byhour: null, - byminute: null, - bysecond: null, - byeaster: null -}; -export var defaultKeys = Object.keys(DEFAULT_OPTIONS); -/** - * - * @param {Options?} options - see - * The only required option is `freq`, one of RRule.YEARLY, RRule.MONTHLY, ... - * @constructor - */ -var RRule = /** @class */ (function () { - function RRule(options, noCache) { - if (options === void 0) { options = {}; } - if (noCache === void 0) { noCache = false; } - // RFC string - this._cache = noCache ? null : new Cache(); - // used by toString() - this.origOptions = initializeOptions(options); - var parsedOptions = parseOptions(options).parsedOptions; - this.options = parsedOptions; - } - RRule.parseText = function (text, language) { - return getnlp().parseText(text, language); - }; - RRule.fromText = function (text, language) { - return getnlp().fromText(text, language); - }; - RRule.fromString = function (str) { - return new RRule(RRule.parseString(str) || undefined); - }; - RRule.prototype._iter = function (iterResult) { - return iter(iterResult, this.options); - }; - RRule.prototype._cacheGet = function (what, args) { - if (!this._cache) - return false; - return this._cache._cacheGet(what, args); - }; - RRule.prototype._cacheAdd = function (what, value, args) { - if (!this._cache) - return; - return this._cache._cacheAdd(what, value, args); - }; - /** - * @param {Function} iterator - optional function that will be called - * on each date that is added. It can return false - * to stop the iteration. - * @return Array containing all recurrences. - */ - RRule.prototype.all = function (iterator) { - if (iterator) { - return this._iter(new CallbackIterResult('all', {}, iterator)); - } - var result = this._cacheGet('all'); - if (result === false) { - result = this._iter(new IterResult('all', {})); - this._cacheAdd('all', result); - } - return result; - }; - /** - * Returns all the occurrences of the rrule between after and before. - * The inc keyword defines what happens if after and/or before are - * themselves occurrences. With inc == True, they will be included in the - * list, if they are found in the recurrence set. - * @return Array - */ - RRule.prototype.between = function (after, before, inc, iterator) { - if (inc === void 0) { inc = false; } - if (!dateutil.isValidDate(after) || !dateutil.isValidDate(before)) - throw new Error('Invalid date passed in to RRule.between'); - var args = { - before: before, - after: after, - inc: inc - }; - if (iterator) { - return this._iter(new CallbackIterResult('between', args, iterator)); - } - var result = this._cacheGet('between', args); - if (result === false) { - result = this._iter(new IterResult('between', args)); - this._cacheAdd('between', result, args); - } - return result; - }; - /** - * Returns the last recurrence before the given datetime instance. - * The inc keyword defines what happens if dt is an occurrence. - * With inc == True, if dt itself is an occurrence, it will be returned. - * @return Date or null - */ - RRule.prototype.before = function (dt, inc) { - if (inc === void 0) { inc = false; } - if (!dateutil.isValidDate(dt)) - throw new Error('Invalid date passed in to RRule.before'); - var args = { dt: dt, inc: inc }; - var result = this._cacheGet('before', args); - if (result === false) { - result = this._iter(new IterResult('before', args)); - this._cacheAdd('before', result, args); - } - return result; - }; - /** - * Returns the first recurrence after the given datetime instance. - * The inc keyword defines what happens if dt is an occurrence. - * With inc == True, if dt itself is an occurrence, it will be returned. - * @return Date or null - */ - RRule.prototype.after = function (dt, inc) { - if (inc === void 0) { inc = false; } - if (!dateutil.isValidDate(dt)) - throw new Error('Invalid date passed in to RRule.after'); - var args = { dt: dt, inc: inc }; - var result = this._cacheGet('after', args); - if (result === false) { - result = this._iter(new IterResult('after', args)); - this._cacheAdd('after', result, args); - } - return result; - }; - /** - * Returns the number of recurrences in this set. It will have go trough - * the whole recurrence, if this hasn't been done before. - */ - RRule.prototype.count = function () { - return this.all().length; - }; - /** - * Converts the rrule into its string representation - * @see - * @return String - */ - RRule.prototype.toString = function () { - return optionsToString(this.origOptions); - }; - /** - * Will convert all rules described in nlp:ToText - * to text. - */ - RRule.prototype.toText = function (gettext, language, dateFormatter) { - return getnlp().toText(this, gettext, language, dateFormatter); - }; - RRule.prototype.isFullyConvertibleToText = function () { - return getnlp().isFullyConvertible(this); - }; - /** - * @return a RRule instance with the same freq and options - * as this one (cache is not cloned) - */ - RRule.prototype.clone = function () { - return new RRule(this.origOptions); - }; - // RRule class 'constants' - RRule.FREQUENCIES = [ - 'YEARLY', - 'MONTHLY', - 'WEEKLY', - 'DAILY', - 'HOURLY', - 'MINUTELY', - 'SECONDLY' - ]; - RRule.YEARLY = Frequency.YEARLY; - RRule.MONTHLY = Frequency.MONTHLY; - RRule.WEEKLY = Frequency.WEEKLY; - RRule.DAILY = Frequency.DAILY; - RRule.HOURLY = Frequency.HOURLY; - RRule.MINUTELY = Frequency.MINUTELY; - RRule.SECONDLY = Frequency.SECONDLY; - RRule.MO = Days.MO; - RRule.TU = Days.TU; - RRule.WE = Days.WE; - RRule.TH = Days.TH; - RRule.FR = Days.FR; - RRule.SA = Days.SA; - RRule.SU = Days.SU; - RRule.parseString = parseString; - RRule.optionsToString = optionsToString; - return RRule; -}()); -export default RRule; -//# sourceMappingURL=rrule.js.map \ No newline at end of file diff --git a/dist/esm/src/rrule.js.map b/dist/esm/src/rrule.js.map deleted file mode 100644 index b89b95c4..00000000 --- a/dist/esm/src/rrule.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"rrule.js","sourceRoot":"","sources":["../../../src/rrule.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,YAAY,CAAA;AAEjC,OAAO,UAAwB,MAAM,cAAc,CAAA;AACnD,OAAO,kBAAkB,MAAM,sBAAsB,CAAA;AAIrD,OAAO,EAA0B,SAAS,EAAkD,MAAM,SAAS,CAAA;AAC3G,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,KAAK,EAAa,MAAM,SAAS,CAAA;AAC1C,OAA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AI,CAAC,EAAE,CAAA;IACZ,QAAE,GAAG,IAAI,CAAC,EAAE,CAAA;IACZ,QAAE,GAAG,IAAI,CAAC,EAAE,CAAA;IACZ,QAAE,GAAG,IAAI,CAAC,EAAE,CAAA;IACZ,QAAE,GAAG,IAAI,CAAC,EAAE,CAAA;IACZ,QAAE,GAAG,IAAI,CAAC,EAAE,CAAA;IACZ,QAAE,GAAG,IAAI,CAAC,EAAE,CAAA;IAoBrB,iBAAW,GAAG,WAAW,CAAA;IAMzB,qBAAe,GAAG,eAAe,CAAA;IA+I1C,YAAC;CAAA,AAxMD,IAwMC;eAxMoB,KAAK"} \ No newline at end of file diff --git a/dist/esm/src/rruleset.d.ts b/dist/esm/src/rruleset.d.ts deleted file mode 100644 index b044c68e..00000000 --- a/dist/esm/src/rruleset.d.ts +++ /dev/null @@ -1,82 +0,0 @@ -import RRule from './rrule'; -import IterResult from './iterresult'; -import { QueryMethodTypes, IterResultType } from './types'; -export default class RRuleSet extends RRule { - readonly _rrule: RRule[]; - readonly _rdate: Date[]; - readonly _exrule: RRule[]; - readonly _exdate: Date[]; - private _dtstart?; - private _tzid?; - /** - * - * @param {Boolean?} noCache - * The same stratagy as RRule on cache, default to false - * @constructor - */ - constructor(noCache?: boolean); - dtstart: any; - tzid: any; - _iter(iterResult: IterResult): IterResultType; - /** - * Adds an RRule to the set - * - * @param {RRule} - */ - rrule(rrule: RRule): void; - /** - * Adds an EXRULE to the set - * - * @param {RRule} - */ - exrule(rrule: RRule): void; - /** - * Adds an RDate to the set - * - * @param {Date} - */ - rdate(date: Date): void; - /** - * Adds an EXDATE to the set - * - * @param {Date} - */ - exdate(date: Date): void; - /** - * Get list of included rrules in this recurrence set. - * - * @return List of rrules - */ - rrules(): (RRule | RRuleSet)[]; - /** - * Get list of excluded rrules in this recurrence set. - * - * @return List of exrules - */ - exrules(): (RRule | RRuleSet)[]; - /** - * Get list of included datetimes in this recurrence set. - * - * @return List of rdates - */ - rdates(): Date[]; - /** - * Get list of included datetimes in this recurrence set. - * - * @return List of exdates - */ - exdates(): Date[]; - valueOf(): string[]; - /** - * to generate recurrence field such as: - * DTSTART:19970902T010000Z - * RRULE:FREQ=YEARLY;COUNT=2;BYDAY=TU - * RRULE:FREQ=YEARLY;COUNT=1;BYDAY=TH - */ - toString(): string; - /** - * Create a new RRuleSet Object completely base on current instance - */ - clone(): RRuleSet; -} -//# sourceMappingURL=rruleset.d.ts.map \ No newline at end of file diff --git a/dist/esm/src/rruleset.d.ts.map b/dist/esm/src/rruleset.d.ts.map deleted file mode 100644 index 93921538..00000000 --- a/dist/esm/src/rruleset.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"rruleset.d.ts","sourceRoot":"","sources":["../../../src/rruleset.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,SAAS,CAAA;AAG3B,OAAO,UAAU,MAAM,cAAc,CAAA;AAErC,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAuB1D,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,KAAK;IACzC,SAAgB,MAAM,EAAE,KAAK,EAAE,CAAA;IAC/B,SAAgB,MAAM,EAAE,IAAI,EAAE,CAAA;IAC9B,SAAgB,OAAO,EAAE,KAAK,EAAE,CAAA;IAChC,SAAgB,OAAO,EAAE,IAAI,EAAE,CAAA;IAE/B,OAAO,CAAC,QAAQ,CAAC,CAAyB;IAC1C,OAAO,CAAC,KAAK,CAAC,CAAQ;IAEtB;;;;;OAKG;gBACU,OAAO,GAAE,OAAe;IASrC,OAAO,MAA8C;IACrD,IAAI,MAA2C;IAE/C,KAAK,CAAE,CAAC,SAAS,gBAAgB,EAAG,UAAU,EAAE,UAAU,CAAC,CAAC,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC;IAWjF;;;;OAIG;IACH,KAAK,CAAE,KAAK,EAAE,KAAK;IAInB;;;;OAIG;IACH,MAAM,CAAE,KAAK,EAAE,KAAK;IAIpB;;;;OAIG;IACH,KAAK,CAAE,IAAI,EAAE,IAAI;IAIjB;;;;OAIG;IACH,MAAM,CAAE,IAAI,EAAE,IAAI;IAIlB;;;;OAIG;IACH,MAAM;IAIN;;;;OAIG;IACH,OAAO;IAIP;;;;OAIG;IACH,MAAM;IAIN;;;;OAIG;IACH,OAAO;IAIP,OAAO;IAkCP;;;;;OAKG;IACH,QAAQ;IAIR;;OAEG;IACH,KAAK,IAAK,QAAQ;CAUnB"} \ No newline at end of file diff --git a/dist/esm/src/rruleset.js b/dist/esm/src/rruleset.js deleted file mode 100644 index dd3a6213..00000000 --- a/dist/esm/src/rruleset.js +++ /dev/null @@ -1,180 +0,0 @@ -import { __extends } from "tslib"; -import RRule from './rrule'; -import dateutil from './dateutil'; -import { includes } from './helpers'; -import { iterSet } from './iterset'; -import { rrulestr } from './rrulestr'; -import { optionsToString } from './optionstostring'; -function createGetterSetter(fieldName) { - var _this = this; - return function (field) { - if (field !== undefined) { - _this["_" + fieldName] = field; - } - if (_this["_" + fieldName] !== undefined) { - return _this["_" + fieldName]; - } - for (var i = 0; i < _this._rrule.length; i++) { - var field_1 = _this._rrule[i].origOptions[fieldName]; - if (field_1) { - return field_1; - } - } - }; -} -var RRuleSet = /** @class */ (function (_super) { - __extends(RRuleSet, _super); - /** - * - * @param {Boolean?} noCache - * The same stratagy as RRule on cache, default to false - * @constructor - */ - function RRuleSet(noCache) { - if (noCache === void 0) { noCache = false; } - var _this = _super.call(this, {}, noCache) || this; - _this.dtstart = createGetterSetter.apply(_this, ['dtstart']); - _this.tzid = createGetterSetter.apply(_this, ['tzid']); - _this._rrule = []; - _this._rdate = []; - _this._exrule = []; - _this._exdate = []; - return _this; - } - RRuleSet.prototype._iter = function (iterResult) { - return iterSet(iterResult, this._rrule, this._exrule, this._rdate, this._exdate, this.tzid()); - }; - /** - * Adds an RRule to the set - * - * @param {RRule} - */ - RRuleSet.prototype.rrule = function (rrule) { - _addRule(rrule, this._rrule); - }; - /** - * Adds an EXRULE to the set - * - * @param {RRule} - */ - RRuleSet.prototype.exrule = function (rrule) { - _addRule(rrule, this._exrule); - }; - /** - * Adds an RDate to the set - * - * @param {Date} - */ - RRuleSet.prototype.rdate = function (date) { - _addDate(date, this._rdate); - }; - /** - * Adds an EXDATE to the set - * - * @param {Date} - */ - RRuleSet.prototype.exdate = function (date) { - _addDate(date, this._exdate); - }; - /** - * Get list of included rrules in this recurrence set. - * - * @return List of rrules - */ - RRuleSet.prototype.rrules = function () { - return this._rrule.map(function (e) { return rrulestr(e.toString()); }); - }; - /** - * Get list of excluded rrules in this recurrence set. - * - * @return List of exrules - */ - RRuleSet.prototype.exrules = function () { - return this._exrule.map(function (e) { return rrulestr(e.toString()); }); - }; - /** - * Get list of included datetimes in this recurrence set. - * - * @return List of rdates - */ - RRuleSet.prototype.rdates = function () { - return this._rdate.map(function (e) { return new Date(e.getTime()); }); - }; - /** - * Get list of included datetimes in this recurrence set. - * - * @return List of exdates - */ - RRuleSet.prototype.exdates = function () { - return this._exdate.map(function (e) { return new Date(e.getTime()); }); - }; - RRuleSet.prototype.valueOf = function () { - var result = []; - if (!this._rrule.length && this._dtstart) { - result = result.concat(optionsToString({ dtstart: this._dtstart })); - } - this._rrule.forEach(function (rrule) { - result = result.concat(rrule.toString().split('\n')); - }); - this._exrule.forEach(function (exrule) { - result = result.concat(exrule.toString().split('\n') - .map(function (line) { return line.replace(/^RRULE:/, 'EXRULE:'); }) - .filter(function (line) { return !/^DTSTART/.test(line); })); - }); - if (this._rdate.length) { - result.push(rdatesToString('RDATE', this._rdate, this.tzid())); - } - if (this._exdate.length) { - result.push(rdatesToString('EXDATE', this._exdate, this.tzid())); - } - return result; - }; - /** - * to generate recurrence field such as: - * DTSTART:19970902T010000Z - * RRULE:FREQ=YEARLY;COUNT=2;BYDAY=TU - * RRULE:FREQ=YEARLY;COUNT=1;BYDAY=TH - */ - RRuleSet.prototype.toString = function () { - return this.valueOf().join('\n'); - }; - /** - * Create a new RRuleSet Object completely base on current instance - */ - RRuleSet.prototype.clone = function () { - var rrs = new RRuleSet(!!this._cache); - this._rrule.forEach(function (rule) { return rrs.rrule(rule.clone()); }); - this._exrule.forEach(function (rule) { return rrs.exrule(rule.clone()); }); - this._rdate.forEach(function (date) { return rrs.rdate(new Date(date.getTime())); }); - this._exdate.forEach(function (date) { return rrs.exdate(new Date(date.getTime())); }); - return rrs; - }; - return RRuleSet; -}(RRule)); -export default RRuleSet; -function _addRule(rrule, collection) { - if (!(rrule instanceof RRule)) { - throw new TypeError(String(rrule) + ' is not RRule instance'); - } - if (!includes(collection.map(String), String(rrule))) { - collection.push(rrule); - } -} -function _addDate(date, collection) { - if (!(date instanceof Date)) { - throw new TypeError(String(date) + ' is not Date instance'); - } - if (!includes(collection.map(Number), Number(date))) { - collection.push(date); - dateutil.sort(collection); - } -} -function rdatesToString(param, rdates, tzid) { - var isUTC = !tzid || tzid.toUpperCase() === 'UTC'; - var header = isUTC ? param + ":" : param + ";TZID=" + tzid + ":"; - var dateString = rdates - .map(function (rdate) { return dateutil.timeToUntilString(rdate.valueOf(), isUTC); }) - .join(','); - return "" + header + dateString; -} -//# sourceMappingURL=rruleset.js.map \ No newline at end of file diff --git a/dist/esm/src/rruleset.js.map b/dist/esm/src/rruleset.js.map deleted file mode 100644 index 1445380f..00000000 --- a/dist/esm/src/rruleset.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"rruleset.js","sourceRoot":"","sources":["../../../src/rruleset.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,SAAS,CAAA;AAC3B,OAAO,QAAQ,MAAM,YAAY,CAAA;AACjC,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AAEpC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAEnC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAEnD,SAAS,kBAAkB,CAAM,SAAiB;IAAlD,iBAiBC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AE;QACpD,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;KACvB;AACH,CAAC;AAED,SAAS,QAAQ,CAAE,IAAU,EAAE,UAAkB;IAC/C,IAAI,CAAC,CAAC,IAAI,YAAY,IAAI,CAAC,EAAE;QAC3B,MAAM,IAAI,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,uBAAuB,CAAC,CAAA;KAC5D;IACD,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC,EAAE;QACnD,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QACrB,QAAQ,CAAC,IAAI,CAAC,UAAU,CAAC,CAAA;KAC1B;AACH,CAAC;AAED,SAAS,cAAc,CAAE,KAAa,EAAE,MAAc,EAAE,IAAwB;IAC9E,IAAM,KAAK,GAAG,CAAC,IAAI,IAAI,IAAI,CAAC,WAAW,EAAE,KAAK,KAAK,CAAA;IACnD,IAAM,MAAM,GAAG,KAAK,CAAC,CAAC,CAAI,KAAK,MAAG,CAAC,CAAC,CAAI,KAAK,cAAS,IAAI,MAAG,CAAA;IAE7D,IAAM,UAAU,GAAG,MAAM;SACpB,GAAG,CAAC,UAAA,KAAK,IAAI,OAAA,QAAQ,CAAC,iBAAiB,CAAC,KAAK,CAAC,OAAO,EAAE,EAAE,KAAK,CAAC,EAAlD,CAAkD,CAAC;SAChE,IAAI,CAAC,GAAG,CAAC,CAAA;IAEd,OAAO,KAAG,MAAM,GAAG,UAAY,CAAA;AACjC,CAAC"} \ No newline at end of file diff --git a/dist/esm/src/rrulestr.d.ts b/dist/esm/src/rrulestr.d.ts deleted file mode 100644 index 9c1d8582..00000000 --- a/dist/esm/src/rrulestr.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -import RRule from './rrule'; -import RRuleSet from './rruleset'; -import { Options } from './types'; -export interface RRuleStrOptions { - dtstart: Date | null; - cache: boolean; - unfold: boolean; - forceset: boolean; - compatible: boolean; - tzid: string | null; -} -export declare function parseInput(s: string, options: Partial): { - dtstart: Date | null | undefined; - tzid: string | null | undefined; - rrulevals: Partial[]; - rdatevals: Date[]; - exrulevals: Partial[]; - exdatevals: Date[]; -}; -export declare function rrulestr(s: string, options?: Partial): RRule | RRuleSet; -//# sourceMappingURL=rrulestr.d.ts.map \ No newline at end of file diff --git a/dist/esm/src/rrulestr.d.ts.map b/dist/esm/src/rrulestr.d.ts.map deleted file mode 100644 index 225ba432..00000000 --- a/dist/esm/src/rrulestr.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"rrulestr.d.ts","sourceRoot":"","sources":["../../../src/rrulestr.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,SAAS,CAAA;AAC3B,OAAO,QAAQ,MAAM,YAAY,CAAA;AAGjC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAGjC,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,IAAI,GAAG,IAAI,CAAA;IACpB,KAAK,EAAE,OAAO,CAAA;IACd,MAAM,EAAE,OAAO,CAAA;IACf,QAAQ,EAAE,OAAO,CAAA;IACjB,UAAU,EAAE,OAAO,CAAA;IACnB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;CACpB;AAeD,wBAAgB,UAAU,CAAE,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,eAAe,CAAC;;;;;;;EA2DvE;AAqED,wBAAgB,QAAQ,CACtB,CAAC,EAAE,MAAM,EACT,OAAO,GAAE,OAAO,CAAC,eAAe,CAAM,GACrC,KAAK,GAAG,QAAQ,CAElB"} \ No newline at end of file diff --git a/dist/esm/src/rrulestr.js b/dist/esm/src/rrulestr.js deleted file mode 100644 index 28ae3b01..00000000 --- a/dist/esm/src/rrulestr.js +++ /dev/null @@ -1,188 +0,0 @@ -import { __assign } from "tslib"; -import RRule from './rrule'; -import RRuleSet from './rruleset'; -import dateutil from './dateutil'; -import { includes, split } from './helpers'; -import { parseString, parseDtstart } from './parsestring'; -/** - * RRuleStr - * To parse a set of rrule strings - */ -var DEFAULT_OPTIONS = { - dtstart: null, - cache: false, - unfold: false, - forceset: false, - compatible: false, - tzid: null -}; -export function parseInput(s, options) { - var rrulevals = []; - var rdatevals = []; - var exrulevals = []; - var exdatevals = []; - var _a = parseDtstart(s), dtstart = _a.dtstart, tzid = _a.tzid; - var lines = splitIntoLines(s, options.unfold); - lines.forEach(function (line) { - if (!line) - return; - var _a = breakDownLine(line), name = _a.name, parms = _a.parms, value = _a.value; - switch (name.toUpperCase()) { - case 'RRULE': - if (parms.length) { - throw new Error("unsupported RRULE parm: " + parms.join(',')); - } - rrulevals.push(parseString(line)); - break; - case 'RDATE': - var _b = /RDATE(?:;TZID=([^:=]+))?/i.exec(line), _ = _b[0], rdateTzid = _b[1]; - if (rdateTzid && !tzid) { - tzid = rdateTzid; - } - rdatevals = rdatevals.concat(parseRDate(value, parms)); - break; - case 'EXRULE': - if (parms.length) { - throw new Error("unsupported EXRULE parm: " + parms.join(',')); - } - exrulevals.push(parseString(value)); - break; - case 'EXDATE': - exdatevals = exdatevals.concat(parseRDate(value, parms)); - break; - case 'DTSTART': - break; - default: - throw new Error('unsupported property: ' + name); - } - }); - return { - dtstart: dtstart, - tzid: tzid, - rrulevals: rrulevals, - rdatevals: rdatevals, - exrulevals: exrulevals, - exdatevals: exdatevals - }; -} -function buildRule(s, options) { - var _a = parseInput(s, options), rrulevals = _a.rrulevals, rdatevals = _a.rdatevals, exrulevals = _a.exrulevals, exdatevals = _a.exdatevals, dtstart = _a.dtstart, tzid = _a.tzid; - var noCache = options.cache === false; - if (options.compatible) { - options.forceset = true; - options.unfold = true; - } - if (options.forceset || - rrulevals.length > 1 || - rdatevals.length || - exrulevals.length || - exdatevals.length) { - var rset_1 = new RRuleSet(noCache); - rset_1.dtstart(dtstart); - rset_1.tzid(tzid || undefined); - rrulevals.forEach(function (val) { - rset_1.rrule(new RRule(groomRruleOptions(val, dtstart, tzid), noCache)); - }); - rdatevals.forEach(function (date) { - rset_1.rdate(date); - }); - exrulevals.forEach(function (val) { - rset_1.exrule(new RRule(groomRruleOptions(val, dtstart, tzid), noCache)); - }); - exdatevals.forEach(function (date) { - rset_1.exdate(date); - }); - if (options.compatible && options.dtstart) - rset_1.rdate(dtstart); - return rset_1; - } - var val = rrulevals[0] || {}; - return new RRule(groomRruleOptions(val, val.dtstart || options.dtstart || dtstart, val.tzid || options.tzid || tzid), noCache); -} -export function rrulestr(s, options) { - if (options === void 0) { options = {}; } - return buildRule(s, initializeOptions(options)); -} -function groomRruleOptions(val, dtstart, tzid) { - return __assign(__assign({}, val), { dtstart: dtstart, - tzid: tzid }); -} -function initializeOptions(options) { - var invalid = []; - var keys = Object.keys(options); - var defaultKeys = Object.keys(DEFAULT_OPTIONS); - keys.forEach(function (key) { - if (!includes(defaultKeys, key)) - invalid.push(key); - }); - if (invalid.length) { - throw new Error('Invalid options: ' + invalid.join(', ')); - } - return __assign(__assign({}, DEFAULT_OPTIONS), options); -} -function extractName(line) { - if (line.indexOf(':') === -1) { - return { - name: 'RRULE', - value: line - }; - } - var _a = split(line, ':', 1), name = _a[0], value = _a[1]; - return { - name: name, - value: value - }; -} -function breakDownLine(line) { - var _a = extractName(line), name = _a.name, value = _a.value; - var parms = name.split(';'); - if (!parms) - throw new Error('empty property name'); - return { - name: parms[0].toUpperCase(), - parms: parms.slice(1), - value: value - }; -} -function splitIntoLines(s, unfold) { - if (unfold === void 0) { unfold = false; } - s = s && s.trim(); - if (!s) - throw new Error('Invalid empty string'); - // More info about 'unfold' option - // Go head to http://www.ietf.org/rfc/rfc2445.txt - if (!unfold) { - return s.split(/\s/); - } - var lines = s.split('\n'); - var i = 0; - while (i < lines.length) { - // TODO - var line = (lines[i] = lines[i].replace(/\s+$/g, '')); - if (!line) { - lines.splice(i, 1); - } - else if (i > 0 && line[0] === ' ') { - lines[i - 1] += line.slice(1); - lines.splice(i, 1); - } - else { - i += 1; - } - } - return lines; -} -function validateDateParm(parms) { - parms.forEach(function (parm) { - if (!/(VALUE=DATE(-TIME)?)|(TZID=)/.test(parm)) { - throw new Error('unsupported RDATE/EXDATE parm: ' + parm); - } - }); -} -function parseRDate(rdateval, parms) { - validateDateParm(parms); - return rdateval - .split(',') - .map(function (datestr) { return dateutil.untilStringToDate(datestr); }); -} -//# sourceMappingURL=rrulestr.js.map \ No newline at end of file diff --git a/dist/esm/src/rrulestr.js.map b/dist/esm/src/rrulestr.js.map deleted file mode 100644 index 4f1cbf11..00000000 --- a/dist/esm/src/rrulestr.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"rrulestr.js","sourceRoot":"","sources":["../../../src/rrulestr.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,SAAS,CAAA;AAC3B,OAAO,QAAQ,MAAM,YAAY,CAAA;AACjC,OAAO,QAAQ,MAAM,YAAY,CAAA;AACjC,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,WAAW,CAAA;AAE3C,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAWzD;;;GAGG;AACH,IAAM,eAAe,GAAoB;IACvC,OAAO,EAAE,IAAI;IACb,KAAK,EAAE,KAAK;IACZ,MAAM,EAAE,KAAK;IACb,QAAQ,EAAE,KAAK;IACf,UAAU,EAAE,KAAK;IACjB,IAAI,EAAE,IAAI;CACX,CAAA;AAED,MAAM,UAAU,UAAU,CAAE,CAAS,EAAE,OAAiC;IACtE,IAAI,SAAS,GAAuB,EAAE,CAAA;IACtC,IAAI,SAAS,GAAW,EAAE,CAAA;IAC1B,IAAI,UAAU,GAAuB,EAAE,CAAA;IACvC,IAAI,UAAU,GAAW,EAAE,CAAA;IAEvB,IAAA,oBAAmC,EAAjC,oBAAO,EAAE,cAAwB,CAAA;IAEvC,IAAM,KAAK,GAAG,cAAc,CAAC,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,CAAA;IAE/C,KAAK,CAA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G,KAAK,CAAC,MAAM,EAAE;QACvB,OAAO;QACP,IAAM,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAA;QACvD,IAAI,CAAC,IAAI,EAAE;YACT,KAAK,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;SACnB;aAAM,IAAI,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE;YACnC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;YAC7B,KAAK,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;SACnB;aAAM;YACL,CAAC,IAAI,CAAC,CAAA;SACP;KACF;IAED,OAAO,KAAK,CAAA;AACd,CAAC;AAED,SAAS,gBAAgB,CAAE,KAAe;IACxC,KAAK,CAAC,OAAO,CAAC,UAAA,IAAI;QAChB,IAAI,CAAC,8BAA8B,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;YAC9C,MAAM,IAAI,KAAK,CAAC,iCAAiC,GAAG,IAAI,CAAC,CAAA;SAC1D;IACH,CAAC,CAAC,CAAA;AACJ,CAAC;AAED,SAAS,UAAU,CAAE,QAAgB,EAAE,KAAe;IACpD,gBAAgB,CAAC,KAAK,CAAC,CAAA;IAEvB,OAAO,QAAQ;SACZ,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,UAAA,OAAO,IAAI,OAAA,QAAQ,CAAC,iBAAiB,CAAC,OAAO,CAAC,EAAnC,CAAmC,CAAC,CAAA;AACxD,CAAC"} \ No newline at end of file diff --git a/dist/esm/src/types.d.ts b/dist/esm/src/types.d.ts deleted file mode 100644 index 1abcd2e1..00000000 --- a/dist/esm/src/types.d.ts +++ /dev/null @@ -1,56 +0,0 @@ -import { Weekday, WeekdayStr } from './weekday'; -export interface QueryMethods { - all(): Date[]; - between(after: Date, before: Date, inc: boolean): Date[]; - before(date: Date, inc: boolean): Date; - after(date: Date, inc: boolean): Date; -} -export declare type QueryMethodTypes = keyof QueryMethods; -export declare type IterResultType = M extends 'all' | 'between' ? Date[] : (Date | null); -export declare enum Frequency { - YEARLY = 0, - MONTHLY = 1, - WEEKLY = 2, - DAILY = 3, - HOURLY = 4, - MINUTELY = 5, - SECONDLY = 6 -} -export declare function freqIsDailyOrGreater(freq: Frequency): freq is Frequency.YEARLY | Frequency.MONTHLY | Frequency.WEEKLY | Frequency.DAILY; -export interface Options { - freq: Frequency; - dtstart: Date | null; - interval: number; - wkst: Weekday | number | null; - count: number | null; - until: Date | null; - tzid: string | null; - bysetpos: number | number[] | null; - bymonth: number | number[] | null; - bymonthday: number | number[] | null; - bynmonthday: number[] | null; - byyearday: number | number[] | null; - byweekno: number | number[] | null; - byweekday: ByWeekday | ByWeekday[] | null; - bynweekday: number[][] | null; - byhour: number | number[] | null; - byminute: number | number[] | null; - bysecond: number | number[] | null; - byeaster: number | null; -} -export interface ParsedOptions extends Options { - dtstart: Date; - wkst: number; - bysetpos: number[]; - bymonth: number[]; - bymonthday: number[]; - bynmonthday: number[]; - byyearday: number[]; - byweekno: number[]; - byweekday: number[]; - byhour: number[]; - byminute: number[]; - bysecond: number[]; -} -export declare type ByWeekday = WeekdayStr | number | Weekday; -//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/dist/esm/src/types.d.ts.map b/dist/esm/src/types.d.ts.map deleted file mode 100644 index 6d5981e3..00000000 --- a/dist/esm/src/types.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA;AAE/C,MAAM,WAAW,YAAY;IAC3B,GAAG,IAAK,IAAI,EAAE,CAAA;IACd,OAAO,CAAE,K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A;IACpC,WAAW,EAAE,MAAM,EAAE,GAAG,IAAI,CAAA;IAC5B,SAAS,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,IAAI,CAAA;IACnC,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,IAAI,CAAA;IAClC,SAAS,EAAE,SAAS,GAAG,SAAS,EAAE,GAAG,IAAI,CAAA;IACzC,UAAU,EAAE,MAAM,EAAE,EAAE,GAAG,IAAI,CAAA;IAC7B,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,IAAI,CAAA;IAChC,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,IAAI,CAAA;IAClC,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,IAAI,CAAA;IAClC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;CACxB;AAED,MAAM,WAAW,aAAc,SAAQ,OAAO;IAC5C,OAAO,EAAE,IAAI,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,MAAM,EAAE,CAAA;IAClB,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,UAAU,EAAE,MAAM,EAAE,CAAA;IACpB,WAAW,EAAE,MAAM,EAAE,CAAA;IACrB,SAAS,EAAE,MAAM,EAAE,CAAA;IACnB,QAAQ,EAAE,MAAM,EAAE,CAAA;IAClB,SAAS,EAAE,MAAM,EAAE,CAAA;IACnB,MAAM,EAAE,MAAM,EAAE,CAAA;IAChB,QAAQ,EAAE,MAAM,EAAE,CAAA;IAClB,QAAQ,EAAE,MAAM,EAAE,CAAA;CACnB;AAED,oBAAY,SAAS,GAAG,UAAU,GAAG,MAAM,GAAG,OAAO,CAAA"} \ No newline at end of file diff --git a/dist/esm/src/types.js b/dist/esm/src/types.js deleted file mode 100644 index 9b394fe4..00000000 --- a/dist/esm/src/types.js +++ /dev/null @@ -1,14 +0,0 @@ -export var Frequency; -(function (Frequency) { - Frequency[Frequency["YEARLY"] = 0] = "YEARLY"; - Frequency[Frequency["MONTHLY"] = 1] = "MONTHLY"; - Frequency[Frequency["WEEKLY"] = 2] = "WEEKLY"; - Frequency[Frequency["DAILY"] = 3] = "DAILY"; - Frequency[Frequency["HOURLY"] = 4] = "HOURLY"; - Frequency[Frequency["MINUTELY"] = 5] = "MINUTELY"; - Frequency[Frequency["SECONDLY"] = 6] = "SECONDLY"; -})(Frequency || (Frequency = {})); -export function freqIsDailyOrGreater(freq) { - return freq < Frequency.HOURLY; -} -//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/dist/esm/src/types.js.map b/dist/esm/src/types.js.map deleted file mode 100644 index 906c3b78..00000000 --- a/dist/esm/src/types.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/types.ts"],"names":[],"mappings":"AAYA,MAAM,CAAN,IAAY,SAQX;AARD,WAAY,SAAS;IACnB,6CAAU,CAAA;IACV,+CAAW,CAAA;IACX,6CAAU,CAAA;IACV,2CAAS,CAAA;IACT,6CAAU,CAAA;IACV,iDAAY,CAAA;IACZ,iDAAY,CAAA;AACd,CAAC,EARW,SAAS,KAAT,SAAS,QAQpB;AAED,MAAM,UAAU,oBAAoB,CAAE,IAAe;IACnD,OAAO,IAAI,GAAG,SAAS,CAAC,MAAM,CAAA;AAChC,CAAC"} \ No newline at end of file diff --git a/dist/esm/src/weekday.d.ts b/dist/esm/src/weekday.d.ts deleted file mode 100644 index 1c566710..00000000 --- a/dist/esm/src/weekday.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -export declare type WeekdayStr = 'MO' | 'TU' | 'WE' | 'TH' | 'FR' | 'SA' | 'SU'; -export declare const ALL_WEEKDAYS: WeekdayStr[]; -export declare class Weekday { - readonly weekday: number; - readonly n?: number; - constructor(weekday: number, n?: number); - static fromStr(str: WeekdayStr): Weekday; - nth(n: number): Weekday; - equals(other: Weekday): boolean; - toString(): string; - getJsWeekday(): number; -} -//# sourceMappingURL=weekday.d.ts.map \ No newline at end of file diff --git a/dist/esm/src/weekday.d.ts.map b/dist/esm/src/weekday.d.ts.map deleted file mode 100644 index 4c04618b..00000000 --- a/dist/esm/src/weekday.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"weekday.d.ts","sourceRoot":"","sources":["../../../src/weekday.ts"],"names":[],"mappings":"AAIA,oBAAY,UAAU,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAA;AACvE,eAAO,MAAM,YAAY,EAAE,UAAU,EAA+C,CAAA;AAEpF,qBAAa,OAAO;IAClB,SAAgB,OAAO,EAAE,MAAM,CAAA;IAC/B,SAAgB,CAAC,CAAC,EAAE,MAAM,CAAA;gBAEb,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,MAAM;IAMxC,MAAM,CAAC,OAAO,CAAE,GAAG,EAAE,UAAU,GAAG,OAAO;IAMzC,GAAG,CAAE,CAAC,EAAE,MAAM;IAKd,MAAM,CAAE,KAAK,EAAE,OAAO;IAKtB,QAAQ;IAMR,YAAY;CAGb"} \ No newline at end of file diff --git a/dist/esm/src/weekday.js b/dist/esm/src/weekday.js deleted file mode 100644 index a3ca6271..00000000 --- a/dist/esm/src/weekday.js +++ /dev/null @@ -1,37 +0,0 @@ -// ============================================================================= -// Weekday -// ============================================================================= -export var ALL_WEEKDAYS = ['MO', 'TU', 'WE', 'TH', 'FR', 'SA', 'SU']; -var Weekday = /** @class */ (function () { - function Weekday(weekday, n) { - if (n === 0) - throw new Error("Can't create weekday with n == 0"); - this.weekday = weekday; - this.n = n; - } - Weekday.fromStr = function (str) { - return new Weekday(ALL_WEEKDAYS.indexOf(str)); - }; - // __call__ - Cannot call the object directly, do it through - // e.g. RRule.TH.nth(-1) instead, - Weekday.prototype.nth = function (n) { - return this.n === n ? this : new Weekday(this.weekday, n); - }; - // __eq__ - Weekday.prototype.equals = function (other) { - return this.weekday === other.weekday && this.n === other.n; - }; - // __repr__ - Weekday.prototype.toString = function () { - var s = ALL_WEEKDAYS[this.weekday]; - if (this.n) - s = (this.n > 0 ? '+' : '') + String(this.n) + s; - return s; - }; - Weekday.prototype.getJsWeekday = function () { - return this.weekday === 6 ? 0 : this.weekday + 1; - }; - return Weekday; -}()); -export { Weekday }; -//# sourceMappingURL=weekday.js.map \ No newline at end of file diff --git a/dist/esm/src/weekday.js.map b/dist/esm/src/weekday.js.map deleted file mode 100644 index 65de6af2..00000000 --- a/dist/esm/src/weekday.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"weekday.js","sourceRoot":"","sources":["../../../src/weekday.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,UAAU;AACV,gFAAgF;AAGhF,MAAM,CAAC,IAAM,YAAY,GAAiB,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA;AAEpF;IAIE,iBAAa,OAAe,EAAE,CAAU;QACtC,IAAI,CAAC,KAAK,CAAC;YAAE,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAA;QAChE,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;QACtB,IAAI,CAAC,CAAC,GAAG,CAAC,CAAA;IACZ,CAAC;IAEM,eAAO,GAAd,UAAgB,GAAe;QAC7B,OAAO,IAAI,OAAO,CAAC,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAA;IAC/C,CAAC;IAED,4DAA4D;IAC5D,iCAAiC;IACjC,qBAAG,GAAH,UAAK,CAAS;QACZ,OAAO,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,CAAA;IAC3D,CAAC;IAED,SAAS;IACT,wBAAM,GAAN,UAAQ,KAAc;QACpB,OAAO,IAAI,CAAC,OAAO,KAAK,KAAK,CAAC,OAAO,IAAI,IAAI,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,CAAA;IAC7D,CAAC;IAED,WAAW;IACX,0BAAQ,GAAR;QACE,IAAI,CAAC,GAAW,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;QAC1C,IAAI,IAAI,CAAC,CAAC;YAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA;QAC5D,OAAO,CAAC,CAAA;IACV,CAAC;IAED,8BAAY,GAAZ;QACE,OAAO,IAAI,CAAC,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,GAAG,CAAC,CAAA;IAClD,CAAC;IACH,cAAC;AAAD,CAAC,AAnCD,IAmCC"} \ No newline at end of file diff --git a/dist/index.html b/dist/index.html index 88067afb..b8db84e8 100644 --- a/dist/index.html +++ b/dist/index.html @@ -581,6 +581,6 @@

Text input

Fork me on GitHub - + diff --git a/index.html b/index.html deleted file mode 120000 index 5ad281df..00000000 --- a/index.html +++ /dev/null @@ -1 +0,0 @@ -demo/index.html \ No newline at end of file diff --git a/index.html b/index.html new file mode 100644 index 00000000..88067afb --- /dev/null +++ b/index.html @@ -0,0 +1,586 @@ + + + + + + rrule.js demo + + + + + +
+

+ Code and docs +

+

+ rrule.js demo

+ +
+

+ This is a demo and test app for + rrule.js, a JavaScript library for working with recurrence rules for calendar dates. +

+ +
+ +
+

Output

+ + + + + + + + + + + + + + + + + + + + + +
+ rule = + +

+          
+ rule.origOptions + +

+          
+ rule.toString() + +
+
+ rule.toText() + + + + +
+ rule.all() + +
+
+
+ + +
+

Input

+
+
+
+

Options

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ freq + +
Frequency
+
+
+ + + + + + + +
+
+ dtstart + +
The recurrence start. Besides being the base for the recurrence, missing parameters in the final recurrence + instances will also be extracted from this date. If not given, + new Date will be used instead. +
+
+
+ +
+
+ tzid + +
The timezone for the rule. If present, all recurrences will be interpreted as being in the local time + of the given timezone. If not present, UTC will be used instead. +
+
+
+ +
+
+ until + +
If given, this must be a + Date + instance, that will specify the limit of the recurrence. If a recurrence instance happens to be the same as the + Date instance given in the + until + argument, this will be the last occurrence. +
+
+
+ +
+
+ count + +
How many occurrences will be generated. +
+
+
+ +
+
+ interval + +
The interval between each freq iteration. For example, when using + RRule.YEARLY, an interval of + 2 means once every two years, but with + RRule.HOURLY, it means once every two hours. The default interval is + 1. +
+
+
+ +
+
+ wkst + +
The week start day. Must be one of the + RRule.MO, + RRule.TU, + RRule.WE + constants, or an integer, specifying the first day of the week. This will affect recurrences based on weekly periods. The + default week start is + RRule.MO. +
+
+
+ + + + + + + +
+
+ byweekday + +
If given, it must be either an integer ( + 0 == RRule.MO), a sequence of integers, one of the weekday constants ( + RRule.MO, + RRule.TU, etc), or a sequence of these constants. When given, these variables will define + the weekdays where the recurrence will be applied. It's also possible to use an argument n for the + weekday instances, which will mean the nth occurrence of this weekday in the period. For example, + with + RRule.MONTHLY, or with + RRule.YEARLY and + BYMONTH, using + RRule.FR.clone(+1) in + byweekday will specify the first friday of the month where the recurrence happens. Notice + that the RFC documentation, this is specified as + BYDAY, but was renamed to avoid the ambiguity of that argument. +
+
+
+ + + + + + + +
+
+ bymonth + +
If given, it must be either an integer, or a sequence of integers, meaning the months to apply the + recurrence to. +
+
+
+ + + + + + + + + + + + +
+
+ bysetpos + +
If given, it must be either an integer, or a sequence of integers, positive or negative. Each given + integer will specify an occurrence number, corresponding to the nth occurrence of the rule inside + the frequency period. For example, a + bysetpos of + -1 if combined with a + RRule.MONTHLY + frequency, and a byweekday of ( + RRule.MO, + RRule.TU, + RRule.WE, + RRule.TH, + RRule.FR), will result in the last work day of every month. +
+
+
+ +
+
+ bymonthday + +
If given, it must be either an integer, or a sequence of integers, meaning the month days to apply + the recurrence to. +
+
+
+ +
+
+ byyearday + +
If given, it must be either an integer, or a sequence of integers, meaning the year days to apply the + recurrence to. +
+
+
+ +
+
+ byweekno + +
If given, it must be either an integer, or a sequence of integers, meaning the week numbers to apply + the recurrence to. Week numbers have the meaning described in ISO8601, that is, the first week of + the year is that containing at least four days of the new year. +
+
+
+ +
+
+ byhour + +
If given, it must be either an integer, or a sequence of integers, meaning the hours to apply the recurrence + to. +
+
+
+ +
+
+ byminute + +
If given, it must be either an integer, or a sequence of integers, meaning the minutes to apply the + recurrence to. +
+
+
+ +
+
+ bysecond + +
If given, it must be either an integer, or a sequence of integers, meaning the seconds to apply the + recurrence to. +
+
+
+ +
+
+ byeaster + +
+ This is an extension to the RFC specification which the Python implementation provides. + Not implemented in the JavaScript version. + +
+
+
+ +
+
+
+ + +
+

+ RRULE string

+

+ +

+

+ Enter an + RRULE as per + iCalendar RFC. +

+

Examples:

+
    +
  • + FREQ=WEEKLY;BYDAY=MO,WE +
  • +
  • + FREQ=MONTHLY;BYMONTHDAY=10,15;COUNT=20 +
  • +
  • + FREQ=DAILY;INTERVAL=3;COUNT=10 +
  • +
  • + FREQ=MONTHLY;BYDAY=-2FR;COUNT=7 +
  • +
+
+ + + +
+

Text input

+

+ +

+

Examples:

+
    +
  • + Every weekday +
  • +
  • + Every 2 weeks on Tuesday +
  • +
  • + Every week on Monday, Wednesday +
  • +
  • + Every month on the 2nd last Friday for 7 times +
  • +
  • + Every 6 months +
  • +
+
+ + +
+
+
+ + Fork me on GitHub + + + + diff --git a/package.json b/package.json index 72de0f4b..28ce5237 100644 --- a/package.json +++ b/package.json @@ -1,39 +1,21 @@ { - "name": "rrule", - "version": "2.6.5", - "description": "JavaScript library for working with recurrence rules for calendar dates.", + "name": "rrule-demo", + "version": "2.7.0", + "description": "Demo page for rrule.js 2.7.0", "homepage": "http://jakubroztocil.github.io/rrule/", "license": "BSD-3-Clause", - "keywords": [ - "dates", - "recurrences", - "calendar", - "icalendar", - "rfc" - ], "author": "Jakub Roztocil, Lars Schöning, and David Golightly", - "main": "dist/es5/rrule.js", - "module": "dist/esm/src/index.js", - "typings": "dist/esm/src/index.d.ts", + "main": "", "repository": { "type": "git", "url": "git://github.com/jakubroztocil/rrule.git" }, - "husky": { - "hooks": { - "pre-commit": "yarn lint" - } - }, "scripts": { - "build": "yarn lint && tsc && webpack && tsc dist/esm/**/*.d.ts", - "lint": "yarn tslint --project . --fix --config tslint.json", - "test": "TS_NODE_PROJECT=tsconfig.test.json mocha **/*.test.ts", - "test-ci": "TS_NODE_PROJECT=tsconfig.test.json nyc mocha **/*.test.ts" + "build": "tsc && webpack" }, "nyc": { "extension": [ - ".ts", - ".tsx" + ".ts" ], "exclude": [ "**/*.d.ts" @@ -44,47 +26,18 @@ "all": true }, "devDependencies": { - "@types/assert": "^1.4.3", - "@types/chai": "^4.2.7", "@types/jquery": "^3.3.29", - "@types/luxon": "^1.21.0", - "@types/mocha": "^5.2.5", - "@types/mockdate": "^2.0.0", "@types/node": "^12.12.18", - "chai": "^4.2.0", "copy-webpack-plugin": "^5.1.1", - "coverage": "^0.4.1", "html-webpack-plugin": "^3.2.0", - "husky": "^3.1.0", "jquery": "^3.3.1", - "mocha": "^6.2.2", - "mockdate": "^2.0.5", - "nyc": "^14.1.1", + "rrule": "2.7.0", "source-map-loader": "^0.2.4", "source-map-support": "^0.5.16", "ts-loader": "^6.2.1", - "ts-node": "^8.5.4", - "tslint": "^5.20.1", - "tslint-eslint-rules": "^5.4.0", "typescript": "^3.7.3", "uglifyjs-webpack-plugin": "^2.2.0", "webpack": "^4.41.3", "webpack-cli": "^3.3.10" - }, - "standard": { - "ignore": [ - "demo" - ] - }, - "files": [ - "dist", - "README.md" - ], - "optionalDependencies": { - "luxon": "^1.21.3" - }, - "peerDependencies": {}, - "dependencies": { - "tslib": "^1.10.0" } } diff --git a/src/cache.ts b/src/cache.ts deleted file mode 100644 index 442f53ac..00000000 --- a/src/cache.ts +++ /dev/null @@ -1,93 +0,0 @@ -import IterResult, { IterArgs } from './iterresult' -import dateutil from './dateutil' -import { isArray } from './helpers' - -export type CacheKeys = 'before' | 'after' | 'between' - -export class Cache { - all: Date[] | Partial | false = false - before: IterArgs[] = [] - after: IterArgs[] = [] - between: IterArgs[] = [] - - /** - * @param {String} what - all/before/after/between - * @param {Array,Date} value - an array of dates, one date, or null - * @param {Object?} args - _iter arguments - */ - public _cacheAdd ( - what: CacheKeys | 'all', - value: Date[] | Date | null, - args?: Partial - ) { - if (value) { - value = - value instanceof Date - ? dateutil.clone(value) - : dateutil.cloneDates(value) - } - - if (what === 'all') { - this.all = value as Date[] - } else { - args!._value = value - this[what].push(args as IterArgs) - } - } - - /** - * @return false - not in the cache - * null - cached, but zero occurrences (before/after) - * Date - cached (before/after) - * [] - cached, but zero occurrences (all/between) - * [Date1, DateN] - cached (all/between) - */ - public _cacheGet ( - what: CacheKeys | 'all', - args?: Partial - ): Date | Date[] | false | null { - let cached: Date | Date[] | false | null = false - const argsKeys = args ? (Object.keys(args) as (keyof IterArgs)[]) : [] - const findCacheDiff = function (item: IterArgs) { - for (let i = 0; i < argsKeys.length; i++) { - const key = argsKeys[i] - if (String(args![key]) !== String(item[key])) { - return true - } - } - return false - } - - const cachedObject = this[what] - if (what === 'all') { - cached = this.all as Date[] - } else if (isArray(cachedObject)) { - // Let's see whether we've already called the - // 'what' method with the same 'args' - for (let i = 0; i < cachedObject.length; i++) { - const item = cachedObject[i] as IterArgs - if (argsKeys.length && findCacheDiff(item)) continue - cached = item._value - break - } - } - - if (!cached && this.all) { - // Not in the cache, but we already know all the occurrences, - // so we can find the correct dates from the cached ones. - const iterResult = new IterResult(what, args!) - for (let i = 0; i < (this.all as Date[]).length; i++) { - if (!iterResult.accept((this.all as Date[])[i])) break - } - cached = iterResult.getValue() as Date - this._cacheAdd(what, cached, args) - } - - return isArray(cached) - ? dateutil.cloneDates(cached) - : cached instanceof Date - ? dateutil.clone(cached) - : cached - } - -} diff --git a/src/callbackiterresult.ts b/src/callbackiterresult.ts deleted file mode 100644 index 8dfa1b68..00000000 --- a/src/callbackiterresult.ts +++ /dev/null @@ -1,29 +0,0 @@ -import IterResult, { IterArgs } from './iterresult' - -type Iterator = (d: Date, len: number) => boolean - -/** - * IterResult subclass that calls a callback function on each add, - * and stops iterating when the callback returns false. - */ -export default class CallbackIterResult extends IterResult<'all' | 'between'> { - private iterator: Iterator - - constructor ( - method: 'all' | 'between', - args: Partial, - iterator: Iterator - ) { - super(method, args) - - this.iterator = iterator - } - - add (date: Date) { - if (this.iterator(date, this._result.length)) { - this._result.push(date) - return true - } - return false - } -} diff --git a/src/datetime.ts b/src/datetime.ts deleted file mode 100644 index 09422f66..00000000 --- a/src/datetime.ts +++ /dev/null @@ -1,250 +0,0 @@ -import { ParsedOptions, Frequency } from './types' -import { pymod, divmod, empty, includes } from './helpers' -import { dateutil } from './dateutil' - -export class Time { - public hour: number - public minute: number - public second: number - public millisecond: number - - constructor ( - hour: number, - minute: number, - second: number, - millisecond: number - ) { - this.hour = hour - this.minute = minute - this.second = second - this.millisecond = millisecond || 0 - } - - getHours () { - return this.hour - } - - getMinutes () { - return this.minute - } - - getSeconds () { - return this.second - } - - getMilliseconds () { - return this.millisecond - } - - getTime () { - return ( - (this.hour * 60 * 60 + this.minute * 60 + this.second) * 1000 + - this.millisecond - ) - } -} - -export class DateTime extends Time { - public day: number - public month: number - public year: number - - static fromDate (date: Date) { - return new this( - date.getUTCFullYear(), - date.getUTCMonth() + 1, - date.getUTCDate(), - date.getUTCHours(), - date.getUTCMinutes(), - date.getUTCSeconds(), - date.valueOf() % 1000 - ) - } - - constructor ( - year: number, - month: number, - day: number, - hour: number, - minute: number, - second: number, - millisecond: number - ) { - super(hour, minute, second, millisecond) - this.year = year - this.month = month - this.day = day - } - - getWeekday () { - return dateutil.getWeekday(new Date(this.getTime())) - } - - getTime () { - return new Date( - Date.UTC( - this.year, this.month - 1, this.day, this.hour, this.minute, this.second, this.millisecond - ) - ).getTime() - } - - getDay () { - return this.day - } - - getMonth () { - return this.month - } - - getYear () { - return this.year - } - - public addYears (years: number) { - this.year += years - } - - public addMonths (months: number) { - this.month += months - if (this.month > 12) { - const yearDiv = Math.floor(this.month / 12) - const monthMod = pymod(this.month, 12) - this.month = monthMod - this.year += yearDiv - if (this.month === 0) { - this.month = 12 - --this.year - } - } - } - - public addWeekly (days: number, wkst: number) { - if (wkst > this.getWeekday()) { - this.day += -(this.getWeekday() + 1 + (6 - wkst)) + days * 7 - } else { - this.day += -(this.getWeekday() - wkst) + days * 7 - } - - this.fixDay() - } - - public addDaily (days: number) { - this.day += days - this.fixDay() - } - - public addHours (hours: number, filtered: boolean, byhour: number[]) { - if (filtered) { - // Jump to one iteration before next day - this.hour += Math.floor((23 - this.hour) / hours) * hours - } - - while (true) { - this.hour += hours - const { div: dayDiv, mod: hourMod } = divmod(this.hour, 24) - if (dayDiv) { - this.hour = hourMod - this.addDaily(dayDiv) - } - - if (empty(byhour) || includes(byhour, this.hour)) break - } - } - - public addMinutes (minutes: number, filtered: boolean, byhour: number[], byminute: number[]) { - if (filtered) { - // Jump to one iteration before next day - this.minute += - Math.floor((1439 - (this.hour * 60 + this.minute)) / minutes) * minutes - } - - while (true) { - this.minute += minutes - const { div: hourDiv, mod: minuteMod } = divmod(this.minute, 60) - if (hourDiv) { - this.minute = minuteMod - this.addHours(hourDiv, false, byhour) - } - - if ( - (empty(byhour) || includes(byhour, this.hour)) && - (empty(byminute) || includes(byminute, this.minute)) - ) { - break - } - } - } - - public addSeconds (seconds: number, filtered: boolean, byhour: number[], byminute: number[], bysecond: number[]) { - if (filtered) { - // Jump to one iteration before next day - this.second += - Math.floor( - (86399 - (this.hour * 3600 + this.minute * 60 + this.second)) / seconds - ) * seconds - } - - while (true) { - this.second += seconds - const { div: minuteDiv, mod: secondMod } = divmod(this.second, 60) - if (minuteDiv) { - this.second = secondMod - this.addMinutes(minuteDiv, false, byhour, byminute) - } - - if ( - (empty(byhour) || includes(byhour, this.hour)) && - (empty(byminute) || includes(byminute, this.minute)) && - (empty(bysecond) || includes(bysecond, this.second)) - ) { - break - } - } - } - - public fixDay () { - if (this.day <= 28) { - return - } - - let daysinmonth = dateutil.monthRange(this.year, this.month - 1)[1] - if (this.day <= daysinmonth) { - return - } - - while (this.day > daysinmonth) { - this.day -= daysinmonth - ++this.month - if (this.month === 13) { - this.month = 1 - ++this.year - if (this.year > dateutil.MAXYEAR) { - return - } - } - - daysinmonth = dateutil.monthRange(this.year, this.month - 1)[1] - } - } - - public add (options: ParsedOptions, filtered: boolean) { - const { - freq, - interval, - wkst, - byhour, - byminute, - bysecond - } = options - - switch (freq) { - case Frequency.YEARLY: return this.addYears(interval) - case Frequency.MONTHLY: return this.addMonths(interval) - case Frequency.WEEKLY: return this.addWeekly(interval, wkst) - case Frequency.DAILY: return this.addDaily(interval) - case Frequency.HOURLY: return this.addHours(interval, filtered, byhour) - case Frequency.MINUTELY: return this.addMinutes(interval, filtered, byhour, byminute) - case Frequency.SECONDLY: return this.addSeconds(interval, filtered, byhour, byminute, bysecond) - } - } -} diff --git a/src/dateutil.ts b/src/dateutil.ts deleted file mode 100644 index 9ed09b18..00000000 --- a/src/dateutil.ts +++ /dev/null @@ -1,198 +0,0 @@ -import { padStart } from './helpers' -import { Time } from './datetime' - -type Datelike = Pick - -/** - * General date-related utilities. - * Also handles several incompatibilities between JavaScript and Python - * - */ -export namespace dateutil { - export const MONTH_DAYS = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31] - - /** - * Number of milliseconds of one day - */ - export const ONE_DAY = 1000 * 60 * 60 * 24 - - /** - * @see: - */ - export const MAXYEAR = 9999 - - /** - * Python uses 1-Jan-1 as the base for calculating ordinals but we don't - * want to confuse the JS engine with milliseconds > Number.MAX_NUMBER, - * therefore we use 1-Jan-1970 instead - */ - export const ORDINAL_BASE = new Date(Date.UTC(1970, 0, 1)) - - /** - * Python: MO-SU: 0 - 6 - * JS: SU-SAT 0 - 6 - */ - export const PY_WEEKDAYS = [6, 0, 1, 2, 3, 4, 5] - - /** - * py_date.timetuple()[7] - */ - export const getYearDay = function (date: Date) { - const dateNoTime = new Date( - date.getUTCFullYear(), - date.getUTCMonth(), - date.getUTCDate() - ) - return ( - Math.ceil( - (dateNoTime.valueOf() - - new Date(date.getUTCFullYear(), 0, 1).valueOf()) / - ONE_DAY - ) + 1 - ) - } - - export const isLeapYear = function (year: number) { - return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0 - } - - export const isDate = function (value: any): value is Date { - return value instanceof Date - } - - export const isValidDate = function (value: any): value is Date { - return isDate(value) && !isNaN(value.getTime()) - } - - /** - * @return {Number} the date's timezone offset in ms - */ - export const tzOffset = function (date: Date) { - return date.getTimezoneOffset() * 60 * 1000 - } - - /** - * @see: - */ - export const daysBetween = function (date1: Date, date2: Date) { - // The number of milliseconds in one day - // Convert both dates to milliseconds - const date1ms = date1.getTime() - tzOffset(date1) - const date2ms = date2.getTime() - tzOffset(date2) - // Calculate the difference in milliseconds - const differencems = date1ms - date2ms - // Convert back to days and return - return Math.round(differencems / ONE_DAY) - } - - /** - * @see: - */ - export const toOrdinal = function (date: Date) { - return daysBetween(date, ORDINAL_BASE) - } - - /** - * @see - - */ - export const fromOrdinal = function (ordinal: number) { - return new Date(ORDINAL_BASE.getTime() + ordinal * ONE_DAY) - } - - export const getMonthDays = function (date: Date) { - const month = date.getUTCMonth() - return month === 1 && isLeapYear(date.getUTCFullYear()) - ? 29 - : MONTH_DAYS[month] - } - - /** - * @return {Number} python-like weekday - */ - export const getWeekday = function (date: Date) { - return PY_WEEKDAYS[date.getUTCDay()] - } - - /** - * @see: - */ - export const monthRange = function (year: number, month: number) { - const date = new Date(Date.UTC(year, month, 1)) - return [getWeekday(date), getMonthDays(date)] - } - - /** - * @see: - */ - export const combine = function (date: Date, time: Date | Time) { - time = time || date - return new Date( - Date.UTC( - date.getUTCFullYear(), - date.getUTCMonth(), - date.getUTCDate(), - time.getHours(), - time.getMinutes(), - time.getSeconds(), - time.getMilliseconds() - ) - ) - } - - export const clone = function (date: Date | Time) { - const dolly = new Date(date.getTime()) - return dolly - } - - export const cloneDates = function (dates: Date[] | Time[]) { - const clones = [] - for (let i = 0; i < dates.length; i++) { - clones.push(clone(dates[i])) - } - return clones - } - - /** - * Sorts an array of Date or dateutil.Time objects - */ - export const sort = function(dates: T[]) { - dates.sort(function (a, b) { - return a.getTime() - b.getTime() - }) - } - - export const timeToUntilString = function (time: number, utc = true) { - const date = new Date(time) - return [ - padStart(date.getUTCFullYear().toString(), 4, '0'), - padStart(date.getUTCMonth() + 1, 2, '0'), - padStart(date.getUTCDate(), 2, '0'), - 'T', - padStart(date.getUTCHours(), 2, '0'), - padStart(date.getUTCMinutes(), 2, '0'), - padStart(date.getUTCSeconds(), 2, '0'), - utc ? 'Z' : '' - ].join('') - } - - export const untilStringToDate = function (until: string) { - const re = /^(\d{4})(\d{2})(\d{2})(T(\d{2})(\d{2})(\d{2})Z?)?$/ - const bits = re.exec(until) - - if (!bits) throw new Error(`Invalid UNTIL value: ${until}`) - - return new Date( - Date.UTC( - parseInt(bits[1], 10), - parseInt(bits[2], 10) - 1, - parseInt(bits[3], 10), - parseInt(bits[5], 10) || 0, - parseInt(bits[6], 10) || 0, - parseInt(bits[7], 10) || 0 - ) - ) - } - -} - -export default dateutil diff --git a/src/datewithzone.ts b/src/datewithzone.ts deleted file mode 100644 index 8ae3ed09..00000000 --- a/src/datewithzone.ts +++ /dev/null @@ -1,49 +0,0 @@ -import dateutil from './dateutil' -import { DateTime } from 'luxon' - -export class DateWithZone { - public date: Date - public tzid?: string | null - - constructor (date: Date, tzid?: string | null) { - this.date = date - this.tzid = tzid - } - - private get isUTC () { - return !this.tzid || this.tzid.toUpperCase() === 'UTC' - } - - public toString () { - const datestr = dateutil.timeToUntilString(this.date.getTime(), this.isUTC) - if (!this.isUTC) { - return `;TZID=${this.tzid}:${datestr}` - } - - return `:${datestr}` - } - - public getTime () { - return this.date.getTime() - } - - public rezonedDate () { - if (this.isUTC) { - return this.date - } - - try { - const datetime = DateTime - .fromJSDate(this.date) - - const rezoned = datetime.setZone(this.tzid!, { keepLocalTime: true }) - - return rezoned.toJSDate() - } catch (e) { - if (e instanceof TypeError) { - console.error('Using TZID without Luxon available is unsupported. Returned times are in UTC, not the requested time zone') - } - return this.date - } - } -} diff --git a/src/fake-luxon.ts b/src/fake-luxon.ts deleted file mode 100644 index 6bdc8dde..00000000 --- a/src/fake-luxon.ts +++ /dev/null @@ -1,5 +0,0 @@ -export const DateTime = { - fromJSDate () { - throw new TypeError() - } -} diff --git a/src/helpers.ts b/src/helpers.ts deleted file mode 100644 index 33cc9cfd..00000000 --- a/src/helpers.ts +++ /dev/null @@ -1,130 +0,0 @@ -// ============================================================================= -// Helper functions -// ============================================================================= - -import { ALL_WEEKDAYS, WeekdayStr } from './weekday' - -export const isPresent = function(value?: T | null | undefined): value is T { - return value !== null && value !== undefined -} - -export const isNumber = function (value?: any): value is number { - return typeof value === 'number' -} - -export const isWeekdayStr = function (value?: any): value is WeekdayStr { - return ALL_WEEKDAYS.indexOf(value) >= 0 -} - -export const isArray = Array.isArray - -/** - * Simplified version of python's range() - */ -export const range = function (start: number, end: number = start): number[] { - if (arguments.length === 1) { - end = start - start = 0 - } - const rang = [] - for (let i = start; i < end; i++) rang.push(i) - return rang -} - -export const clone = function(array: T[]): T[] { - return ([] as T[]).concat(array) -} - -export const repeat = function(value: T | T[], times: number): (T | T[])[] { - let i = 0 - const array: (T | T[])[] = [] - - if (isArray(value)) { - for (; i < times; i++) array[i] = ([] as T[]).concat(value) - } else { - for (; i < times; i++) array[i] = value - } - return array -} - -export const toArray = function(item: T | T[]): T[] { - if (isArray(item)) { - return item - } - - return [ item ] -} - -export function padStart (item: string | number, targetLength: number, padString: string = ' ') { - const str = String(item) - targetLength = targetLength >> 0 - if (str.length > targetLength) { - return String(str) - } - - targetLength = targetLength - str.length - if (targetLength > padString.length) { - padString += repeat(padString, targetLength / padString.length) - } - - return padString.slice(0,targetLength) + String(str) -} - -/** - * Python like split - */ -export const split = function (str: string, sep: string, num: number) { - const splits = str.split(sep) - return num - ? splits.slice(0, num).concat([splits.slice(num).join(sep)]) - : splits -} - -/** - * closure/goog/math/math.js:modulo - * Copyright 2006 The Closure Library Authors. - * The % operator in JavaScript returns the remainder of a / b, but differs from - * some other languages in that the result will have the same sign as the - * dividend. For example, -1 % 8 == -1, whereas in some other languages - * (such as Python) the result would be 7. This function emulates the more - * correct modulo behavior, which is useful for certain applications such as - * calculating an offset index in a circular list. - * - * @param {number} a The dividend. - * @param {number} b The divisor. - * @return {number} a % b where the result is between 0 and b (either 0 <= x < b - * or b < x <= 0, depending on the sign of b). - */ -export const pymod = function (a: number, b: number) { - const r = a % b - // If r and b differ in sign, add b to wrap the result to the correct sign. - return r * b < 0 ? r + b : r -} - -/** - * @see: - */ -export const divmod = function (a: number, b: number) { - return { div: Math.floor(a / b), mod: pymod(a, b) } -} - -export const empty = function(obj: T[] | null | undefined) { - return !isPresent(obj) || obj.length === 0 -} - -/** - * Python-like boolean - * @return {Boolean} value of an object/primitive, taking into account - * the fact that in Python an empty list's/tuple's - * boolean value is False, whereas in JS it's true - */ -export const notEmpty = function(obj: T[] | null | undefined): obj is T[] { - return !empty(obj) -} - -/** - * Return true if a value is in an array - */ -export const includes = function(arr: T[] | null | undefined, val: T) { - return notEmpty(arr) && arr.indexOf(val) !== -1 -} diff --git a/src/index.ts b/src/index.ts deleted file mode 100644 index b9ae1eae..00000000 --- a/src/index.ts +++ /dev/null @@ -1,30 +0,0 @@ -/*! - * rrule.js - Library for working with recurrence rules for calendar dates. - * https://github.com/jakubroztocil/rrule - * - * Copyright 2010, Jakub Roztocil and Lars Schoning - * Licenced under the BSD licence. - * https://github.com/jakubroztocil/rrule/blob/master/LICENCE - * - * Based on: - * python-dateutil - Extensions to the standard Python datetime module. - * Copyright (c) 2003-2011 - Gustavo Niemeyer - * Copyright (c) 2012 - Tomi Pieviläinen - * https://github.com/jakubroztocil/rrule/blob/master/LICENCE - * - */ - -import RRule from './rrule' -import RRuleSet from './rruleset' - -export { rrulestr } from './rrulestr' -export { Frequency, ByWeekday, Options } from './types' -export { Weekday, WeekdayStr } from './weekday' -export { RRuleStrOptions } from './rrulestr' - -export { - RRule, - RRuleSet -} - -export default RRule diff --git a/src/iter/index.ts b/src/iter/index.ts deleted file mode 100644 index fef6562b..00000000 --- a/src/iter/index.ts +++ /dev/null @@ -1,206 +0,0 @@ -import IterResult from '../iterresult' -import { ParsedOptions, freqIsDailyOrGreater, QueryMethodTypes } from '../types' -import dateutil from '../dateutil' -import Iterinfo from '../iterinfo/index' -import RRule from '../rrule' -import { buildTimeset } from '../parseoptions' -import { notEmpty, includes, isPresent } from '../helpers' -import { DateWithZone } from '../datewithzone' -import { buildPoslist } from './poslist' -import { Time, DateTime } from '../datetime' - -export function iter (iterResult: IterResult, options: ParsedOptions) { - const { - dtstart, - freq, - interval, - until, - bysetpos - } = options - - let count = options.count - if (count === 0 || interval === 0) { - return emitResult(iterResult) - } - - let counterDate = DateTime.fromDate(dtstart) - - const ii = new Iterinfo(options) - ii.rebuild(counterDate.year, counterDate.month) - - let timeset = makeTimeset(ii, counterDate, options) - - while (true) { - let [dayset, start, end] = ii.getdayset(freq)( - counterDate.year, - counterDate.month, - counterDate.day - ) - - let filtered = removeFilteredDays(dayset, start, end, ii, options) - - if (notEmpty(bysetpos)) { - const poslist = buildPoslist(bysetpos, timeset!, start, end, ii, dayset) - - for (let j = 0; j < poslist.length; j++) { - const res = poslist[j] - if (until && res > until) { - return emitResult(iterResult) - } - - if (res >= dtstart) { - const rezonedDate = rezoneIfNeeded(res, options) - if (!iterResult.accept(rezonedDate)) { - return emitResult(iterResult) - } - - if (count) { - --count - if (!count) { - return emitResult(iterResult) - } - } - } - } - } else { - for (let j = start; j < end; j++) { - const currentDay = dayset[j] - if (!isPresent(currentDay)) { - continue - } - - const date = dateutil.fromOrdinal(ii.yearordinal + currentDay) - for (let k = 0; k < timeset!.length; k++) { - const time = timeset![k] - const res = dateutil.combine(date, time) - if (until && res > until) { - return emitResult(iterResult) - } - - if (res >= dtstart) { - const rezonedDate = rezoneIfNeeded(res, options) - if (!iterResult.accept(rezonedDate)) { - return emitResult(iterResult) - } - - if (count) { - --count - if (!count) { - return emitResult(iterResult) - } - } - } - } - } - } - if (options.interval === 0) { - return emitResult(iterResult) - } - - // Handle frequency and interval - counterDate.add(options, filtered) - - if (counterDate.year > dateutil.MAXYEAR) { - return emitResult(iterResult) - } - - if (!freqIsDailyOrGreater(freq)) { - timeset = ii.gettimeset(freq)(counterDate.hour, counterDate.minute, counterDate.second, 0) - } - - ii.rebuild(counterDate.year, counterDate.month) - } -} - -function isFiltered ( - ii: Iterinfo, - currentDay: number, - options: ParsedOptions -): boolean { - const { - bymonth, - byweekno, - byweekday, - byeaster, - bymonthday, - bynmonthday, - byyearday - } = options - - return ( - (notEmpty(bymonth) && !includes(bymonth, ii.mmask[currentDay])) || - (notEmpty(byweekno) && !ii.wnomask![currentDay]) || - (notEmpty(byweekday) && !includes(byweekday, ii.wdaymask[currentDay])) || - (notEmpty(ii.nwdaymask) && !ii.nwdaymask[currentDay]) || - (byeaster !== null && !includes(ii.eastermask!, currentDay)) || - ((notEmpty(bymonthday) || notEmpty(bynmonthday)) && - !includes(bymonthday, ii.mdaymask[currentDay]) && - !includes(bynmonthday, ii.nmdaymask[currentDay])) || - (notEmpty(byyearday) && - ((currentDay < ii.yearlen && - !includes(byyearday, currentDay + 1) && - !includes(byyearday, -ii.yearlen + currentDay)) || - (currentDay >= ii.yearlen && - !includes(byyearday, currentDay + 1 - ii.yearlen) && - !includes(byyearday, -ii.nextyearlen + currentDay - ii.yearlen)))) - ) -} - -function rezoneIfNeeded (date: Date, options: ParsedOptions) { - return new DateWithZone(date, options.tzid).rezonedDate() -} - -function emitResult (iterResult: IterResult) { - return iterResult.getValue() -} - -function removeFilteredDays (dayset: (number | null)[], start: number, end: number, ii: Iterinfo, options: ParsedOptions) { - let filtered = false - for (let dayCounter = start; dayCounter < end; dayCounter++) { - let currentDay = dayset[dayCounter] as number - - filtered = isFiltered( - ii, - currentDay, - options - ) - - if (filtered) dayset[currentDay] = null - } - - return filtered -} - -function makeTimeset (ii: Iterinfo, counterDate: DateTime, options: ParsedOptions): Time[] | null { - const { - freq, - byhour, - byminute, - bysecond - } = options - - if (freqIsDailyOrGreater(freq)) { - return buildTimeset(options) - } - - if ( - (freq >= RRule.HOURLY && - notEmpty(byhour) && - !includes(byhour, counterDate.hour)) || - (freq >= RRule.MINUTELY && - notEmpty(byminute) && - !includes(byminute, counterDate.minute)) || - (freq >= RRule.SECONDLY && - notEmpty(bysecond) && - !includes(bysecond, counterDate.second)) - ) { - return [] - } - - return ii.gettimeset(freq)( - counterDate.hour, - counterDate.minute, - counterDate.second, - counterDate.millisecond - ) -} diff --git a/src/iter/poslist.ts b/src/iter/poslist.ts deleted file mode 100644 index 575a2b85..00000000 --- a/src/iter/poslist.ts +++ /dev/null @@ -1,46 +0,0 @@ -import dateutil from '../dateutil' -import Iterinfo from '../iterinfo/index' -import { pymod, isPresent, includes } from '../helpers' -import { Time } from '../datetime' - -export function buildPoslist (bysetpos: number[], timeset: Time[], start: number, end: number, ii: Iterinfo, dayset: (number | null)[]) { - const poslist: Date[] = [] - - for (let j = 0; j < bysetpos.length; j++) { - let daypos: number - let timepos: number - const pos = bysetpos[j] - - if (pos < 0) { - daypos = Math.floor(pos / timeset.length) - timepos = pymod(pos, timeset.length) - } else { - daypos = Math.floor((pos - 1) / timeset.length) - timepos = pymod(pos - 1, timeset.length) - } - - const tmp = [] - for (let k = start; k < end; k++) { - const val = dayset[k] - if (!isPresent(val)) continue - tmp.push(val) - } - let i: number - if (daypos < 0) { - i = tmp.slice(daypos)[0] - } else { - i = tmp[daypos] - } - - const time = timeset[timepos] - const date = dateutil.fromOrdinal(ii.yearordinal + i) - const res = dateutil.combine(date, time) - // XXX: can this ever be in the array? - // - compare the actual date instead? - if (!includes(poslist, res)) poslist.push(res) - } - - dateutil.sort(poslist) - - return poslist -} diff --git a/src/iterinfo/easter.ts b/src/iterinfo/easter.ts deleted file mode 100644 index e4ef7aa3..00000000 --- a/src/iterinfo/easter.ts +++ /dev/null @@ -1,20 +0,0 @@ -export function easter (y: number, offset: number = 0) { - const a = y % 19 - const b = Math.floor(y / 100) - const c = y % 100 - const d = Math.floor(b / 4) - const e = b % 4 - const f = Math.floor((b + 8) / 25) - const g = Math.floor((b - f + 1) / 3) - const h = Math.floor(19 * a + b - d - g + 15) % 30 - const i = Math.floor(c / 4) - const k = c % 4 - const l = Math.floor(32 + 2 * e + 2 * i - h - k) % 7 - const m = Math.floor((a + 11 * h + 22 * l) / 451) - const month = Math.floor((h + l - 7 * m + 114) / 31) - const day = ((h + l - 7 * m + 114) % 31) + 1 - const date = Date.UTC(y, month - 1, day + offset) - const yearStart = Date.UTC(y, 0, 1) - - return [Math.ceil((date - yearStart) / (1000 * 60 * 60 * 24))] -} diff --git a/src/iterinfo/index.ts b/src/iterinfo/index.ts deleted file mode 100644 index 896fed33..00000000 --- a/src/iterinfo/index.ts +++ /dev/null @@ -1,173 +0,0 @@ -import dateutil from '../dateutil' -import { - notEmpty, - repeat, - range, - isPresent -} from '../helpers' -import { ParsedOptions, Frequency } from '../types' -import { YearInfo, rebuildYear } from './yearinfo' -import { rebuildMonth, MonthInfo } from './monthinfo' -import { easter } from './easter' -import { Time } from '../datetime' - -export type DaySet = [(number | null)[], number, number] -export type GetDayset = () => DaySet - -// ============================================================================= -// Iterinfo -// ============================================================================= - -export default class Iterinfo { - public yearinfo: YearInfo - public monthinfo: MonthInfo - public eastermask: number[] | null - - constructor (private options: ParsedOptions) {} - - rebuild (year: number, month: number) { - const options = this.options - - if (year !== this.lastyear) { - this.yearinfo = rebuildYear(year, options) - } - - if ( - notEmpty(options.bynweekday!) && - (month !== this.lastmonth || year !== this.lastyear) - ) { - const { yearlen, mrange, wdaymask } = this.yearinfo - this.monthinfo = rebuildMonth( - year, month, yearlen, mrange, wdaymask, options - ) - } - - if (isPresent(options.byeaster)) { - this.eastermask = easter(year, options.byeaster) - } - } - - get lastyear () { - return this.monthinfo ? this.monthinfo.lastyear : null - } - - get lastmonth () { - return this.monthinfo ? this.monthinfo.lastmonth : null - } - - get yearlen () { - return this.yearinfo.yearlen - } - - get yearordinal () { - return this.yearinfo.yearordinal - } - - get mrange () { - return this.yearinfo.mrange - } - - get wdaymask () { - return this.yearinfo.wdaymask - } - - get mmask () { - return this.yearinfo.mmask - } - - get wnomask () { - return this.yearinfo.wnomask - } - - get nwdaymask () { - return this.monthinfo ? this.monthinfo.nwdaymask : [] - } - - get nextyearlen () { - return this.yearinfo.nextyearlen - } - - get mdaymask () { - return this.yearinfo.mdaymask - } - - get nmdaymask () { - return this.yearinfo.nmdaymask - } - - ydayset () { - return [range(this.yearlen), 0, this.yearlen] - } - - mdayset (_: any, month: number, __: any) { - const start = this.mrange[month - 1] - const end = this.mrange[month] - const set = repeat(null, this.yearlen) - for (let i = start; i < end; i++) set[i] = i - return [set, start, end] - } - - wdayset (year: number, month: number, day: number) { - // We need to handle cross-year weeks here. - const set = repeat(null, this.yearlen + 7) - let i = - dateutil.toOrdinal(new Date(Date.UTC(year, month - 1, day))) - - this.yearordinal - const start = i - for (let j = 0; j < 7; j++) { - set[i] = i - ++i - if (this.wdaymask[i] === this.options.wkst) break - } - return [set, start, i] - } - - ddayset (year: number, month: number, day: number) { - const set = repeat(null, this.yearlen) as (number | null)[] - const i = - dateutil.toOrdinal(new Date(Date.UTC(year, month - 1, day))) - - this.yearordinal - set[i] = i - return [set, i, i + 1] - } - - htimeset (hour: number, _: number, second: number, millisecond: number) { - let set: Time[] = [] - this.options.byminute.forEach(minute => { - set = set.concat(this.mtimeset(hour, minute, second, millisecond)) - }) - dateutil.sort(set) - return set - } - - mtimeset (hour: number, minute: number, _: number, millisecond: number) { - const set = this.options.bysecond.map(second => - new Time(hour, minute, second, millisecond) - ) - - dateutil.sort(set) - return set - } - - stimeset (hour: number, minute: number, second: number, millisecond: number) { - return [new Time(hour, minute, second, millisecond)] - } - - getdayset (freq: Frequency): (y: number, m: number, d: number) => DaySet { - switch (freq) { - case Frequency.YEARLY: return this.ydayset.bind(this) - case Frequency.MONTHLY: return this.mdayset.bind(this) - case Frequency.WEEKLY: return this.wdayset.bind(this) - case Frequency.DAILY: return this.ddayset.bind(this) - default: return this.ddayset.bind(this) - } - } - - gettimeset (freq: Frequency.HOURLY | Frequency.MINUTELY | Frequency.SECONDLY): (h: number, m: number, s: number, ms: number) => Time[] { - switch (freq) { - case Frequency.HOURLY: return this.htimeset.bind(this) - case Frequency.MINUTELY: return this.mtimeset.bind(this) - case Frequency.SECONDLY: return this.stimeset.bind(this) - } - } -} diff --git a/src/iterinfo/monthinfo.ts b/src/iterinfo/monthinfo.ts deleted file mode 100644 index 4c4ab746..00000000 --- a/src/iterinfo/monthinfo.ts +++ /dev/null @@ -1,67 +0,0 @@ -import { ParsedOptions } from '../types' -import RRule from '../rrule' -import { empty, repeat, pymod } from '../helpers' - -export interface MonthInfo { - lastyear: number - lastmonth: number - nwdaymask: number[] -} - -export function rebuildMonth ( - year: number, - month: number, - yearlen: number, - mrange: number[], - wdaymask: number[], - options: ParsedOptions -) { - const result: MonthInfo = { - lastyear: year, - lastmonth: month, - nwdaymask: [] - } - - let ranges: number[][] = [] - if (options.freq === RRule.YEARLY) { - if (empty(options.bymonth)) { - ranges = [[0, yearlen]] - } else { - for (let j = 0; j < options.bymonth.length; j++) { - month = options.bymonth[j] - ranges.push(mrange.slice(month - 1, month + 1)) - } - } - } else if (options.freq === RRule.MONTHLY) { - ranges = [mrange.slice(month - 1, month + 1)] - } - - if (empty(ranges)) { - return result - } - - // Weekly frequency won't get here, so we may not - // care about cross-year weekly periods. - result.nwdaymask = repeat(0, yearlen) as number[] - - for (let j = 0; j < ranges.length; j++) { - const rang = ranges[j] - const first = rang[0] - const last = rang[1] - 1 - - for (let k = 0; k < options.bynweekday!.length; k++) { - let i - const [ wday, n ] = options.bynweekday![k] - if (n < 0) { - i = last + (n + 1) * 7 - i -= pymod(wdaymask[i] - wday, 7) - } else { - i = first + (n - 1) * 7 - i += pymod(7 - wdaymask[i] + wday, 7) - } - if (first <= i && i <= last) result.nwdaymask[i] = 1 - } - } - - return result -} diff --git a/src/iterinfo/yearinfo.ts b/src/iterinfo/yearinfo.ts deleted file mode 100644 index 3ac5cc0b..00000000 --- a/src/iterinfo/yearinfo.ts +++ /dev/null @@ -1,165 +0,0 @@ -import { ParsedOptions } from '../types' -import dateutil from '../dateutil' -import { empty, repeat, pymod, includes } from '../helpers' -import { M365MASK, MDAY365MASK, NMDAY365MASK, WDAYMASK, M365RANGE, M366MASK, MDAY366MASK, NMDAY366MASK, M366RANGE } from '../masks' - -export interface YearInfo { - yearlen: 365 | 366 - nextyearlen: 365 | 366 - yearordinal: number - yearweekday: number - mmask: number[] - mrange: number[] - mdaymask: number[] - nmdaymask: number[] - wdaymask: number[] - wnomask: number[] | null -} - -export function rebuildYear (year: number, options: ParsedOptions) { - const firstyday = new Date(Date.UTC(year, 0, 1)) - - const yearlen = dateutil.isLeapYear(year) ? 366 : 365 - const nextyearlen = dateutil.isLeapYear(year + 1) ? 366 : 365 - const yearordinal = dateutil.toOrdinal(firstyday) - const yearweekday = dateutil.getWeekday(firstyday) - - const result: YearInfo = { - yearlen, - nextyearlen, - yearordinal, - yearweekday, - ...baseYearMasks(year), - wnomask: null - } - - if (empty(options.byweekno)) { - return result - } - - result.wnomask = repeat(0, yearlen + 7) as number[] - let firstwkst: number - let wyearlen: number - let no1wkst = firstwkst = pymod(7 - yearweekday + options.wkst, 7) - - if (no1wkst >= 4) { - no1wkst = 0 - // Number of days in the year, plus the days we got - // from last year. - wyearlen = - result.yearlen + pymod(yearweekday - options.wkst, 7) - } else { - // Number of days in the year, minus the days we - // left in last year. - wyearlen = yearlen - no1wkst - } - - const div = Math.floor(wyearlen / 7) - const mod = pymod(wyearlen, 7) - const numweeks = Math.floor(div + mod / 4) - - for (let j = 0; j < options.byweekno.length; j++) { - let n = options.byweekno[j] - if (n < 0) { - n += numweeks + 1 - } - if (!(n > 0 && n <= numweeks)) { - continue - } - - let i: number - if (n > 1) { - i = no1wkst + (n - 1) * 7 - if (no1wkst !== firstwkst) { - i -= 7 - firstwkst - } - } else { - i = no1wkst - } - - for (let k = 0; k < 7; k++) { - result.wnomask[i] = 1 - i++ - if (result.wdaymask[i] === options.wkst) break - } - } - - if (includes(options.byweekno, 1)) { - // Check week number 1 of next year as well - // orig-TODO : Check -numweeks for next year. - let i = no1wkst + numweeks * 7 - if (no1wkst !== firstwkst) i -= 7 - firstwkst - if (i < yearlen) { - // If week starts in next year, we - // don't care about it. - for (let j = 0; j < 7; j++) { - result.wnomask[i] = 1 - i += 1 - if (result.wdaymask[i] === options.wkst) break - } - } - } - - if (no1wkst) { - // Check last week number of last year as - // well. If no1wkst is 0, either the year - // started on week start, or week number 1 - // got days from last year, so there are no - // days from last year's last week number in - // this year. - let lnumweeks: number - if (!includes(options.byweekno, -1)) { - const lyearweekday = dateutil.getWeekday( - new Date(Date.UTC(year - 1, 0, 1)) - ) - - let lno1wkst = pymod( - 7 - lyearweekday.valueOf() + options.wkst, - 7 - ) - - const lyearlen = dateutil.isLeapYear(year - 1) ? 366 : 365 - let weekst: number - if (lno1wkst >= 4) { - lno1wkst = 0 - weekst = lyearlen + pymod(lyearweekday - options.wkst, 7) - } else { - weekst = yearlen - no1wkst - } - - lnumweeks = Math.floor(52 + pymod(weekst, 7) / 4) - } else { - lnumweeks = -1 - } - - if (includes(options.byweekno, lnumweeks)) { - for (let i = 0; i < no1wkst; i++) result.wnomask[i] = 1 - } - } - - return result -} - -function baseYearMasks (year: number) { - const yearlen = dateutil.isLeapYear(year) ? 366 : 365 - const firstyday = new Date(Date.UTC(year, 0, 1)) - const wday = dateutil.getWeekday(firstyday) - - if (yearlen === 365) { - return { - mmask: M365MASK as number[], - mdaymask: MDAY365MASK, - nmdaymask: NMDAY365MASK, - wdaymask: WDAYMASK.slice(wday), - mrange: M365RANGE - } - } - - return { - mmask: M366MASK as number[], - mdaymask: MDAY366MASK, - nmdaymask: NMDAY366MASK, - wdaymask: WDAYMASK.slice(wday), - mrange: M366RANGE - } -} diff --git a/src/iterresult.ts b/src/iterresult.ts deleted file mode 100644 index d7111847..00000000 --- a/src/iterresult.ts +++ /dev/null @@ -1,100 +0,0 @@ -import { QueryMethodTypes, IterResultType } from './types' - -// ============================================================================= -// Results -// ============================================================================= - -export interface IterArgs { - inc: boolean - before: Date - after: Date - dt: Date - _value: Date | Date[] | null -} - -/** - * This class helps us to emulate python's generators, sorta. - */ -export default class IterResult { - public readonly method: M - public readonly args: Partial - public readonly minDate: Date | null = null - public readonly maxDate: Date | null = null - public _result: Date[] = [] - public total = 0 - - constructor (method: M, args: Partial) { - this.method = method - this.args = args - - if (method === 'between') { - this.maxDate = args.inc - ? args.before! - : new Date(args.before!.getTime() - 1) - this.minDate = args.inc ? args.after! : new Date(args.after!.getTime() + 1) - } else if (method === 'before') { - this.maxDate = args.inc ? args.dt! : new Date(args.dt!.getTime() - 1) - } else if (method === 'after') { - this.minDate = args.inc ? args.dt! : new Date(args.dt!.getTime() + 1) - } - } - - /** - * Possibly adds a date into the result. - * - * @param {Date} date - the date isn't necessarly added to the result - * list (if it is too late/too early) - * @return {Boolean} true if it makes sense to continue the iteration - * false if we're done. - */ - accept (date: Date) { - ++this.total - const tooEarly = this.minDate && date < this.minDate - const tooLate = this.maxDate && date > this.maxDate - - if (this.method === 'between') { - if (tooEarly) return true - if (tooLate) return false - } else if (this.method === 'before') { - if (tooLate) return false - } else if (this.method === 'after') { - if (tooEarly) return true - this.add(date) - return false - } - - return this.add(date) - } - - /** - * - * @param {Date} date that is part of the result. - * @return {Boolean} whether we are interested in more values. - */ - add (date: Date) { - this._result.push(date) - return true - } - - /** - * 'before' and 'after' return only one date, whereas 'all' - * and 'between' an array. - * @return {Date,Array?} - */ - getValue (): IterResultType { - const res = this._result - switch (this.method) { - case 'all': - case 'between': - return res as IterResultType - case 'before': - case 'after': - default: - return (res.length ? res[res.length - 1] : null) as IterResultType - } - } - - clone () { - return new IterResult(this.method, this.args) - } -} diff --git a/src/iterset.ts b/src/iterset.ts deleted file mode 100644 index 3f25853b..00000000 --- a/src/iterset.ts +++ /dev/null @@ -1,78 +0,0 @@ -import IterResult from './iterresult' -import RRule from './rrule' -import { DateWithZone } from './datewithzone' -import { iter } from './iter/index' -import dateutil from './dateutil' -import { QueryMethodTypes, IterResultType } from './types' - -export function iterSet ( - iterResult: IterResult, - _rrule: RRule[], - _exrule: RRule[], - _rdate: Date[], - _exdate: Date[], - tzid: string | undefined -) { - const _exdateHash: { [k: number]: boolean } = {} - const _accept = iterResult.accept - - function evalExdate (after: Date, before: Date) { - _exrule.forEach(function (rrule) { - rrule.between(after, before, true).forEach(function (date) { - _exdateHash[Number(date)] = true - }) - }) - } - - _exdate.forEach(function (date) { - const zonedDate = new DateWithZone(date, tzid).rezonedDate() - _exdateHash[Number(zonedDate)] = true - }) - - iterResult.accept = function (date) { - const dt = Number(date) - if (isNaN(dt)) return _accept.call(this, date) - if (!_exdateHash[dt]) { - evalExdate(new Date(dt - 1), new Date(dt + 1)) - if (!_exdateHash[dt]) { - _exdateHash[dt] = true - return _accept.call(this, date) - } - } - return true - } - - if (iterResult.method === 'between') { - evalExdate(iterResult.args.after!, iterResult.args.before!) - iterResult.accept = function (date) { - const dt = Number(date) - if (!_exdateHash[dt]) { - _exdateHash[dt] = true - return _accept.call(this, date) - } - return true - } - } - - for (let i = 0; i < _rdate.length; i++) { - const zonedDate = new DateWithZone(_rdate[i], tzid).rezonedDate() - if (!iterResult.accept(new Date(zonedDate.getTime()))) break - } - - _rrule.forEach(function (rrule) { - iter(iterResult, rrule.options) - }) - - const res = iterResult._result - dateutil.sort(res) - switch (iterResult.method) { - case 'all': - case 'between': - return res as IterResultType - case 'before': - return ((res.length && res[res.length - 1]) || null) as IterResultType - case 'after': - default: - return ((res.length && res[0]) || null) as IterResultType - } -} diff --git a/src/masks.ts b/src/masks.ts deleted file mode 100644 index 42505b10..00000000 --- a/src/masks.ts +++ /dev/null @@ -1,134 +0,0 @@ -import { range, repeat, clone } from './helpers' - -// ============================================================================= -// Date masks -// ============================================================================= - -// Every mask is 7 days longer to handle cross-year weekly periods. - -const M365MASK = [ - ...repeat(1, 31), - ...repeat(2, 28), - ...repeat(3, 31), - ...repeat(4, 30), - ...repeat(5, 31), - ...repeat(6, 30), - ...repeat(7, 31), - ...repeat(8, 31), - ...repeat(9, 30), - ...repeat(10, 31), - ...repeat(11, 30), - ...repeat(12, 31), - ...repeat(1, 7) -] - -const M366MASK = [ - ...repeat(1, 31), - ...repeat(2, 29), - ...repeat(3, 31), - ...repeat(4, 30), - ...repeat(5, 31), - ...repeat(6, 30), - ...repeat(7, 31), - ...repeat(8, 31), - ...repeat(9, 30), - ...repeat(10, 31), - ...repeat(11, 30), - ...repeat(12, 31), - ...repeat(1, 7) -] - -const M28 = range(1, 29) -const M29 = range(1, 30) -const M30 = range(1, 31) -const M31 = range(1, 32) - -const MDAY366MASK = [ - ...M31, - ...M29, - ...M31, - ...M30, - ...M31, - ...M30, - ...M31, - ...M31, - ...M30, - ...M31, - ...M30, - ...M31, - ...M31.slice(0, 7) -] - -const MDAY365MASK = [ - ...M31, - ...M28, - ...M31, - ...M30, - ...M31, - ...M30, - ...M31, - ...M31, - ...M30, - ...M31, - ...M30, - ...M31, - ...M31.slice(0, 7) -] - -const NM28 = range(-28, 0) -const NM29 = range(-29, 0) -const NM30 = range(-30, 0) -const NM31 = range(-31, 0) - -const NMDAY366MASK = [ - ...NM31, - ...NM29, - ...NM31, - ...NM30, - ...NM31, - ...NM30, - ...NM31, - ...NM31, - ...NM30, - ...NM31, - ...NM30, - ...NM31, - ...NM31.slice(0, 7) -] - -const NMDAY365MASK = [ - ...NM31, - ...NM28, - ...NM31, - ...NM30, - ...NM31, - ...NM30, - ...NM31, - ...NM31, - ...NM30, - ...NM31, - ...NM30, - ...NM31, - ...NM31.slice(0, 7) -] - -const M366RANGE = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366] -const M365RANGE = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365] - -const WDAYMASK = (function () { - let wdaymask: number[] = [] - for (let i = 0; i < 55; i++) wdaymask = wdaymask.concat(range(7)) - return wdaymask -})() - -export { - WDAYMASK, - M365MASK, - M365RANGE, - M366MASK, - M366RANGE, - MDAY365MASK, - MDAY366MASK, - NMDAY365MASK, - NMDAY366MASK -} diff --git a/src/nlp/i18n.ts b/src/nlp/i18n.ts deleted file mode 100644 index 63941b3b..00000000 --- a/src/nlp/i18n.ts +++ /dev/null @@ -1,69 +0,0 @@ -// ============================================================================= -// i18n -// ============================================================================= - -export interface Language { - dayNames: string[] - monthNames: string[] - tokens: { - [k: string]: RegExp - } -} - -const ENGLISH: Language = { - dayNames: [ - 'Sunday', 'Monday', 'Tuesday', 'Wednesday', - 'Thursday', 'Friday', 'Saturday' - ], - monthNames: [ - 'January', 'February', 'March', 'April', 'May', - 'June', 'July', 'August', 'September', 'October', - 'November', 'December' - ], - tokens: { - 'SKIP': /^[ \r\n\t]+|^\.$/, - 'number': /^[1-9][0-9]*/, - 'numberAsText': /^(one|two|three)/i, - 'every': /^every/i, - 'day(s)': /^days?/i, - 'weekday(s)': /^weekdays?/i, - 'week(s)': /^weeks?/i, - 'hour(s)': /^hours?/i, - 'minute(s)': /^minutes?/i, - 'month(s)': /^months?/i, - 'year(s)': /^years?/i, - 'on': /^(on|in)/i, - 'at': /^(at)/i, - 'the': /^the/i, - 'first': /^first/i, - 'second': /^second/i, - 'third': /^third/i, - 'nth': /^([1-9][0-9]*)(\.|th|nd|rd|st)/i, - 'last': /^last/i, - 'for': /^for/i, - 'time(s)': /^times?/i, - 'until': /^(un)?til/i, - 'monday': /^mo(n(day)?)?/i, - 'tuesday': /^tu(e(s(day)?)?)?/i, - 'wednesday': /^we(d(n(esday)?)?)?/i, - 'thursday': /^th(u(r(sday)?)?)?/i, - 'friday': /^fr(i(day)?)?/i, - 'saturday': /^sa(t(urday)?)?/i, - 'sunday': /^su(n(day)?)?/i, - 'january': /^jan(uary)?/i, - 'february': /^feb(ruary)?/i, - 'march': /^mar(ch)?/i, - 'april': /^apr(il)?/i, - 'may': /^may/i, - 'june': /^june?/i, - 'july': /^july?/i, - 'august': /^aug(ust)?/i, - 'september': /^sep(t(ember)?)?/i, - 'october': /^oct(ober)?/i, - 'november': /^nov(ember)?/i, - 'december': /^dec(ember)?/i, - 'comma': /^(,\s*|(and|or)\s*)+/i - } -} - -export default ENGLISH diff --git a/src/nlp/index.ts b/src/nlp/index.ts deleted file mode 100644 index f18da328..00000000 --- a/src/nlp/index.ts +++ /dev/null @@ -1,135 +0,0 @@ -import ToText, { DateFormatter, GetText } from './totext' -import parseText from './parsetext' -import RRule from '../index' -import ENGLISH, { Language } from './i18n' - -/*! -* rrule.js - Library for working with recurrence rules for calendar dates. -* https://github.com/jakubroztocil/rrule -* -* Copyright 2010, Jakub Roztocil and Lars Schoning -* Licenced under the BSD licence. -* https://github.com/jakubroztocil/rrule/blob/master/LICENCE -* -*/ - -/** - * - * Implementation of RRule.fromText() and RRule::toText(). - * - * - * On the client side, this file needs to be included - * when those functions are used. - * - */ - -// ============================================================================= -// fromText -// ============================================================================= -/** - * Will be able to convert some of the below described rules from - * text format to a rule object. - * - * - * RULES - * - * Every ([n]) - * day(s) - * | [weekday], ..., (and) [weekday] - * | weekday(s) - * | week(s) - * | month(s) - * | [month], ..., (and) [month] - * | year(s) - * - * - * Plus 0, 1, or multiple of these: - * - * on [weekday], ..., (or) [weekday] the [monthday], [monthday], ... (or) [monthday] - * - * on [weekday], ..., (and) [weekday] - * - * on the [monthday], [monthday], ... (and) [monthday] (day of the month) - * - * on the [nth-weekday], ..., (and) [nth-weekday] (of the month/year) - * - * - * Plus 0 or 1 of these: - * - * for [n] time(s) - * - * until [date] - * - * Plus (.) - * - * - * Definitely no supported for parsing: - * - * (for year): - * in week(s) [n], ..., (and) [n] - * - * on the [yearday], ..., (and) [n] day of the year - * on day [yearday], ..., (and) [n] - * - * - * NON-TERMINALS - * - * [n]: 1, 2 ..., one, two, three .. - * [month]: January, February, March, April, May, ... December - * [weekday]: Monday, ... Sunday - * [nth-weekday]: first [weekday], 2nd [weekday], ... last [weekday], ... - * [monthday]: first, 1., 2., 1st, 2nd, second, ... 31st, last day, 2nd last day, .. - * [date]: - * [month] (0-31(,) ([year])), - * (the) 0-31.(1-12.([year])), - * (the) 0-31/(1-12/([year])), - * [weekday] - * - * [year]: 0000, 0001, ... 01, 02, .. - * - * Definitely not supported for parsing: - * - * [yearday]: first, 1., 2., 1st, 2nd, second, ... 366th, last day, 2nd last day, .. - * - * @param {String} text - * @return {Object, Boolean} the rule, or null. - */ -const fromText = function (text: string, language: Language = ENGLISH) { - return new RRule(parseText(text, language) || undefined) -} - -const common = [ - 'count', - 'until', - 'interval', - 'byweekday', - 'bymonthday', - 'bymonth' -] - -ToText.IMPLEMENTED = [] -ToText.IMPLEMENTED[RRule.HOURLY] = common -ToText.IMPLEMENTED[RRule.MINUTELY] = common -ToText.IMPLEMENTED[RRule.DAILY] = ['byhour'].concat(common) -ToText.IMPLEMENTED[RRule.WEEKLY] = common -ToText.IMPLEMENTED[RRule.MONTHLY] = common -ToText.IMPLEMENTED[RRule.YEARLY] = ['byweekno', 'byyearday'].concat(common) - -// ============================================================================= -// Export -// ============================================================================= - -const toText = function (rrule: RRule, gettext?: GetText, language?: Language, dateFormatter?: DateFormatter) { - return new ToText(rrule, gettext, language, dateFormatter).toString() -} - -const { isFullyConvertible } = ToText - -export interface Nlp { - fromText: typeof fromText - parseText: typeof parseText - isFullyConvertible: typeof isFullyConvertible - toText: typeof toText -} - -export { fromText, parseText, isFullyConvertible, toText } diff --git a/src/nlp/parsetext.ts b/src/nlp/parsetext.ts deleted file mode 100644 index 089de0d0..00000000 --- a/src/nlp/parsetext.ts +++ /dev/null @@ -1,444 +0,0 @@ -import ENGLISH, { Language } from './i18n' -import RRule from '../index' -import { Options } from '../types' -import { WeekdayStr } from '../weekday' - -// ============================================================================= -// Parser -// ============================================================================= - -class Parser { - private readonly rules: { [k: string]: RegExp } - public text: string - public symbol: string | null - public value: RegExpExecArray | null - private done = true - - constructor (rules: { [k: string]: RegExp }) { - this.rules = rules - } - - start (text: string) { - this.text = text - this.done = false - return this.nextSymbol() - } - - isDone () { - return this.done && this.symbol === null - } - - nextSymbol () { - let best: RegExpExecArray | null - let bestSymbol: string - const p = this - - this.symbol = null - this.value = null - do { - if (this.done) return false - - let rule: RegExp - best = null - for (let name in this.rules) { - rule = this.rules[name] - const match = rule.exec(p.text) - if (match) { - if (best === null || match[0].length > best[0].length) { - best = match - bestSymbol = name - } - } - } - - if (best != null) { - this.text = this.text.substr(best[0].length) - - if (this.text === '') this.done = true - } - - if (best == null) { - this.done = true - this.symbol = null - this.value = null - return - } - // @ts-ignore - } while (bestSymbol === 'SKIP') - - // @ts-ignore - this.symbol = bestSymbol - this.value = best - return true - } - - accept (name: string) { - if (this.symbol === name) { - if (this.value) { - const v = this.value - this.nextSymbol() - return v - } - - this.nextSymbol() - return true - } - - return false - } - - acceptNumber () { - return this.accept('number') as RegExpExecArray - } - - expect (name: string) { - if (this.accept(name)) return true - - throw new Error('expected ' + name + ' but found ' + this.symbol) - } -} - -export default function parseText (text: string, language: Language = ENGLISH) { - const options: Partial = {} - const ttr = new Parser(language.tokens) - - if (!ttr.start(text)) return null - - S() - return options - - function S () { - // every [n] - ttr.expect('every') - let n = ttr.acceptNumber() - if (n) options.interval = parseInt(n[0], 10) - if (ttr.isDone()) throw new Error('Unexpected end') - - switch (ttr.symbol) { - case 'day(s)': - options.freq = RRule.DAILY - if (ttr.nextSymbol()) { - AT() - F() - } - break - - // FIXME Note: every 2 weekdays != every two weeks on weekdays. - // DAILY on weekdays is not a valid rule - case 'weekday(s)': - options.freq = RRule.WEEKLY - options.byweekday = [ - RRule.MO, - RRule.TU, - RRule.WE, - RRule.TH, - RRule.FR - ] - ttr.nextSymbol() - F() - break - - case 'week(s)': - options.freq = RRule.WEEKLY - if (ttr.nextSymbol()) { - ON() - F() - } - break - - case 'hour(s)': - options.freq = RRule.HOURLY - if (ttr.nextSymbol()) { - ON() - F() - } - break - - case 'minute(s)': - options.freq = RRule.MINUTELY - if (ttr.nextSymbol()) { - ON() - F() - } - break - - case 'month(s)': - options.freq = RRule.MONTHLY - if (ttr.nextSymbol()) { - ON() - F() - } - break - - case 'year(s)': - options.freq = RRule.YEARLY - if (ttr.nextSymbol()) { - ON() - F() - } - break - - case 'monday': - case 'tuesday': - case 'wednesday': - case 'thursday': - case 'friday': - case 'saturday': - case 'sunday': - options.freq = RRule.WEEKLY - const key: WeekdayStr = ttr.symbol.substr(0, 2).toUpperCase() as WeekdayStr - options.byweekday = [RRule[key]] - - if (!ttr.nextSymbol()) return - - // TODO check for duplicates - while (ttr.accept('comma')) { - if (ttr.isDone()) throw new Error('Unexpected end') - - let wkd = decodeWKD() as keyof typeof RRule - if (!wkd) { - throw new Error('Unexpected symbol ' + ttr.symbol + ', expected weekday') - } - - // @ts-ignore - options.byweekday.push(RRule[wkd]) - ttr.nextSymbol() - } - MDAYs() - F() - break - - case 'january': - case 'february': - case 'march': - case 'april': - case 'may': - case 'june': - case 'july': - case 'august': - case 'september': - case 'october': - case 'november': - case 'december': - options.freq = RRule.YEARLY - options.bymonth = [decodeM() as number] - - if (!ttr.nextSymbol()) return - - // TODO check for duplicates - while (ttr.accept('comma')) { - if (ttr.isDone()) throw new Error('Unexpected end') - - let m = decodeM() - if (!m) { - throw new Error('Unexpected symbol ' + ttr.symbol + ', expected month') - } - - options.bymonth.push(m) - ttr.nextSymbol() - } - - ON() - F() - break - - default: - throw new Error('Unknown symbol') - } - } - - function ON () { - const on = ttr.accept('on') - const the = ttr.accept('the') - if (!(on || the)) return - - do { - let nth = decodeNTH() - let wkd = decodeWKD() - let m = decodeM() - - // nth | - if (nth) { - // ttr.nextSymbol() - - if (wkd) { - ttr.nextSymbol() - if (!options.byweekday) options.byweekday = [] - // @ts-ignore - options.byweekday.push(RRule[wkd].nth(nth)) - } else { - if (!options.bymonthday) options.bymonthday = [] - // @ts-ignore - options.bymonthday.push(nth) - ttr.accept('day(s)') - } - // - } else if (wkd) { - ttr.nextSymbol() - if (!options.byweekday) options.byweekday = [] - - // @ts-ignore - options.byweekday.push(RRule[wkd]) - } else if (ttr.symbol === 'weekday(s)') { - ttr.nextSymbol() - if (!options.byweekday) { - options.byweekday = [ - RRule.MO, - RRule.TU, - RRule.WE, - RRule.TH, - RRule.FR - ] - } - } else if (ttr.symbol === 'week(s)') { - ttr.nextSymbol() - let n = ttr.acceptNumber() - if (!n) { - throw new Error('Unexpected symbol ' + ttr.symbol + ', expected week number') - } - options.byweekno = [parseInt(n[0], 10)] - while (ttr.accept('comma')) { - n = ttr.acceptNumber() - if (!n) { - throw new Error('Unexpected symbol ' + ttr.symbol + '; expected monthday') - } - options.byweekno.push(parseInt(n[0], 10)) - } - } else if (m) { - ttr.nextSymbol() - if (!options.bymonth) options.bymonth = [] - - // @ts-ignore - options.bymonth.push(m) - } else { - return - } - } while (ttr.accept('comma') || ttr.accept('the') || ttr.accept('on')) - } - - function AT () { - const at = ttr.accept('at') - if (!at) return - - do { - let n = ttr.acceptNumber() - if (!n) { - throw new Error('Unexpected symbol ' + ttr.symbol + ', expected hour') - } - options.byhour = [parseInt(n[0], 10)] - while (ttr.accept('comma')) { - n = ttr.acceptNumber() - if (!n) { - throw new Error('Unexpected symbol ' + ttr.symbol + '; expected hour') - } - options.byhour.push(parseInt(n[0], 10)) - } - } while (ttr.accept('comma') || ttr.accept('at')) - } - - function decodeM () { - switch (ttr.symbol) { - case 'january': - return 1 - case 'february': - return 2 - case 'march': - return 3 - case 'april': - return 4 - case 'may': - return 5 - case 'june': - return 6 - case 'july': - return 7 - case 'august': - return 8 - case 'september': - return 9 - case 'october': - return 10 - case 'november': - return 11 - case 'december': - return 12 - default: - return false - } - } - - function decodeWKD () { - switch (ttr.symbol) { - case 'monday': - case 'tuesday': - case 'wednesday': - case 'thursday': - case 'friday': - case 'saturday': - case 'sunday': - return ttr.symbol.substr(0, 2).toUpperCase() - default: - return false - } - } - - function decodeNTH () { - switch (ttr.symbol) { - case 'last': - ttr.nextSymbol() - return -1 - case 'first': - ttr.nextSymbol() - return 1 - case 'second': - ttr.nextSymbol() - return ttr.accept('last') ? -2 : 2 - case 'third': - ttr.nextSymbol() - return ttr.accept('last') ? -3 : 3 - case 'nth': - const v = parseInt(ttr.value![1], 10) - if (v < -366 || v > 366) throw new Error('Nth out of range: ' + v) - - ttr.nextSymbol() - return ttr.accept('last') ? -v : v - - default: - return false - } - } - - function MDAYs () { - ttr.accept('on') - ttr.accept('the') - - let nth = decodeNTH() - if (!nth) return - - options.bymonthday = [nth] - ttr.nextSymbol() - - while (ttr.accept('comma')) { - nth = decodeNTH() - if (!nth) { - throw new Error('Unexpected symbol ' + ttr.symbol + '; expected monthday') - } - - options.bymonthday.push(nth) - ttr.nextSymbol() - } - } - - function F () { - if (ttr.symbol === 'until') { - const date = Date.parse(ttr.text) - - if (!date) throw new Error('Cannot parse until date:' + ttr.text) - options.until = new Date(date) - } else if (ttr.accept('for')) { - options.count = parseInt(ttr.value![0], 10) - ttr.expect('number') - // ttr.expect('times') - } - } -} diff --git a/src/nlp/totext.ts b/src/nlp/totext.ts deleted file mode 100644 index f58e269d..00000000 --- a/src/nlp/totext.ts +++ /dev/null @@ -1,479 +0,0 @@ -import ENGLISH, { Language } from './i18n' -import RRule from '../index' -import { Options, ByWeekday } from '../types' -import { Weekday } from '../weekday' -import { isArray, isNumber, isPresent, padStart } from '../helpers' - -// ============================================================================= -// Helper functions -// ============================================================================= - -/** - * Return true if a value is in an array - */ -const contains = function (arr: string[], val: string) { - return arr.indexOf(val) !== -1 -} - -// ============================================================================= -// ToText -// ============================================================================= - -export type GetText = (id: string | number | Weekday) => string - -const defaultGetText: GetText = id => id.toString() - -export type DateFormatter = (year: number, month: string, day: number) => string - -const defaultDateFormatter: DateFormatter = (year: number, month: string, day: number) => `${month} ${day}, ${year}` - -/** - * - * @param {RRule} rrule - * Optional: - * @param {Function} gettext function - * @param {Object} language definition - * @constructor - */ -export default class ToText { - static IMPLEMENTED: string[][] - private rrule: RRule - private text: string[] - private gettext: GetText - private dateFormatter: DateFormatter - private language: Language - private options: Partial - private origOptions: Partial - private bymonthday: Options['bymonthday'] | null - private byweekday: { - allWeeks: ByWeekday[] | null - someWeeks: ByWeekday[] | null - isWeekdays: boolean - isEveryDay: boolean - } | null - - constructor (rrule: RRule, gettext: GetText = defaultGetText, language: Language = ENGLISH, dateFormatter: DateFormatter = defaultDateFormatter) { - this.text = [] - this.language = language || ENGLISH - this.gettext = gettext - this.dateFormatter = dateFormatter - this.rrule = rrule - this.options = rrule.options - this.origOptions = rrule.origOptions - - if (this.origOptions.bymonthday) { - const bymonthday = ([] as number[]).concat(this.options.bymonthday!) - const bynmonthday = ([] as number[]).concat(this.options.bynmonthday!) - - bymonthday.sort((a, b) => a - b) - bynmonthday.sort((a, b) => b - a) - // 1, 2, 3, .., -5, -4, -3, .. - this.bymonthday = bymonthday.concat(bynmonthday) - if (!this.bymonthday.length) this.bymonthday = null - } - - if (isPresent(this.origOptions.byweekday)) { - const byweekday = !isArray(this.origOptions.byweekday) - ? [this.origOptions.byweekday] - : this.origOptions.byweekday - const days = String(byweekday) - - this.byweekday = { - allWeeks: byweekday.filter(function (weekday: Weekday) { - return !weekday.n - }), - someWeeks: byweekday.filter(function (weekday: Weekday) { - return Boolean(weekday.n) - }), - isWeekdays: - days.indexOf('MO') !== -1 && - days.indexOf('TU') !== -1 && - days.indexOf('WE') !== -1 && - days.indexOf('TH') !== -1 && - days.indexOf('FR') !== -1 && - days.indexOf('SA') === -1 && - days.indexOf('SU') === -1, - isEveryDay: - days.indexOf('MO') !== -1 && - days.indexOf('TU') !== -1 && - days.indexOf('WE') !== -1 && - days.indexOf('TH') !== -1 && - days.indexOf('FR') !== -1 && - days.indexOf('SA') !== -1 && - days.indexOf('SU') !== -1 - } - - const sortWeekDays = function (a: Weekday, b: Weekday) { - return a.weekday - b.weekday - } - - this.byweekday.allWeeks!.sort(sortWeekDays) - this.byweekday.someWeeks!.sort(sortWeekDays) - - if (!this.byweekday.allWeeks!.length) this.byweekday.allWeeks = null - if (!this.byweekday.someWeeks!.length) this.byweekday.someWeeks = null - } else { - this.byweekday = null - } - } - - /** - * Test whether the rrule can be fully converted to text. - * @param {RRule} rrule - * @return {Boolean} - */ - static isFullyConvertible (rrule: RRule) { - let canConvert = true - - if (!(rrule.options.freq in ToText.IMPLEMENTED)) return false - if (rrule.origOptions.until && rrule.origOptions.count) return false - - for (let key in rrule.origOptions) { - if (contains(['dtstart', 'wkst', 'freq'], key)) return true - if (!contains(ToText.IMPLEMENTED[rrule.options.freq], key)) return false - } - - return canConvert - } - - isFullyConvertible () { - return ToText.isFullyConvertible(this.rrule) - } - - /** - * Perform the conversion. Only some of the frequencies are supported. - * If some of the rrule's options aren't supported, they'll - * be omitted from the output an "(~ approximate)" will be appended. - * @return {*} - */ - toString () { - const gettext = this.gettext - - if (!(this.options.freq! in ToText.IMPLEMENTED)) { - return gettext('RRule error: Unable to fully convert this rrule to text') - } - - this.text = [gettext('every')] - // @ts-ignore - this[RRule.FREQUENCIES[this.options.freq]]() - - if (this.options.until) { - this.add(gettext('until')) - const until = this.options.until - this.add(this.dateFormatter(until.getUTCFullYear(), this.language.monthNames[until.getUTCMonth()], until.getUTCDate())) - } else if (this.options.count) { - this.add(gettext('for')) - .add(this.options.count.toString()) - .add( - this.plural(this.options.count) ? gettext('times') : gettext('time') - ) - } - - if (!this.isFullyConvertible()) this.add(gettext('(~ approximate)')) - - return this.text.join('') - } - - HOURLY () { - const gettext = this.gettext - - if (this.options.interval !== 1) this.add(this.options.interval!.toString()) - - this.add( - this.plural(this.options.interval!) ? gettext('hours') : gettext('hour') - ) - } - - MINUTELY () { - const gettext = this.gettext - - if (this.options.interval !== 1) this.add(this.options.interval!.toString()) - - this.add( - this.plural(this.options.interval!) - ? gettext('minutes') - : gettext('minute') - ) - } - - DAILY () { - const gettext = this.gettext - - if (this.options.interval !== 1) this.add(this.options.interval!.toString()) - - if (this.byweekday && this.byweekday.isWeekdays) { - this.add( - this.plural(this.options.interval!) - ? gettext('weekdays') - : gettext('weekday') - ) - } else { - this.add( - this.plural(this.options.interval!) ? gettext('days') : gettext('day') - ) - - } - - if (this.origOptions.bymonth) { - this.add(gettext('in')) - this._bymonth() - } - - if (this.bymonthday) { - this._bymonthday() - } else if (this.byweekday) { - this._byweekday() - } else if (this.origOptions.byhour) { - this._byhour() - } - } - - WEEKLY () { - const gettext = this.gettext - - if (this.options.interval !== 1) { - this.add(this.options.interval!.toString()).add( - this.plural(this.options.interval!) ? gettext('weeks') : gettext('week') - ) - } - - if (this.byweekday && this.byweekday.isWeekdays) { - if (this.options.interval === 1) { - this.add( - this.plural(this.options.interval) - ? gettext('weekdays') - : gettext('weekday') - ) - } else { - this.add(gettext('on')).add(gettext('weekdays')) - } - } else if (this.byweekday && this.byweekday.isEveryDay) { - this.add( - this.plural(this.options.interval!) ? gettext('days') : gettext('day') - ) - } else { - if (this.options.interval === 1) this.add(gettext('week')) - - if (this.origOptions.bymonth) { - this.add(gettext('in')) - this._bymonth() - } - - if (this.bymonthday) { - this._bymonthday() - } else if (this.byweekday) { - this._byweekday() - } - } - } - - MONTHLY () { - const gettext = this.gettext - - if (this.origOptions.bymonth) { - if (this.options.interval !== 1) { - this.add(this.options.interval!.toString()).add(gettext('months')) - if (this.plural(this.options.interval!)) this.add(gettext('in')) - } else { - // this.add(gettext('MONTH')) - } - this._bymonth() - } else { - if (this.options.interval !== 1) this.add(this.options.interval!.toString()) - this.add( - this.plural(this.options.interval!) - ? gettext('months') - : gettext('month') - ) - } - if (this.bymonthday) { - this._bymonthday() - } else if (this.byweekday && this.byweekday.isWeekdays) { - this.add(gettext('on')).add(gettext('weekdays')) - } else if (this.byweekday) { - this._byweekday() - } - } - - YEARLY () { - const gettext = this.gettext - - if (this.origOptions.bymonth) { - if (this.options.interval !== 1) { - this.add(this.options.interval!.toString()) - this.add(gettext('years')) - } else { - // this.add(gettext('YEAR')) - } - this._bymonth() - } else { - if (this.options.interval !== 1) this.add(this.options.interval!.toString()) - this.add( - this.plural(this.options.interval!) ? gettext('years') : gettext('year') - ) - } - - if (this.bymonthday) { - this._bymonthday() - } else if (this.byweekday) { - this._byweekday() - } - - if (this.options.byyearday) { - this.add(gettext('on the')) - .add(this.list(this.options.byyearday, this.nth, gettext('and'))) - .add(gettext('day')) - } - - if (this.options.byweekno) { - this.add(gettext('in')) - .add( - this.plural((this.options.byweekno as number[]).length) - ? gettext('weeks') - : gettext('week') - ) - .add(this.list(this.options.byweekno, undefined, gettext('and'))) - } - } - - private _bymonthday () { - const gettext = this.gettext - if (this.byweekday && this.byweekday.allWeeks) { - this.add(gettext('on')) - .add( - this.list(this.byweekday.allWeeks, this.weekdaytext, gettext('or')) - ) - .add(gettext('the')) - .add(this.list(this.bymonthday!, this.nth, gettext('or'))) - } else { - this.add(gettext('on the')).add( - this.list(this.bymonthday!, this.nth, gettext('and')) - ) - } - // this.add(gettext('DAY')) - } - - private _byweekday () { - const gettext = this.gettext - if (this.byweekday!.allWeeks && !this.byweekday!.isWeekdays) { - this.add(gettext('on')).add( - this.list(this.byweekday!.allWeeks, this.weekdaytext) - ) - } - - if (this.byweekday!.someWeeks) { - if (this.byweekday!.allWeeks) this.add(gettext('and')) - - this.add(gettext('on the')).add( - this.list(this.byweekday!.someWeeks, this.weekdaytext, gettext('and')) - ) - } - } - - private _byhour () { - const gettext = this.gettext - - this.add(gettext('at')).add( - this.list(this.origOptions.byhour!, undefined, gettext('and')) - ) - } - - private _bymonth () { - this.add( - this.list(this.options.bymonth!, this.monthtext, this.gettext('and')) - ) - } - - nth (n: number | string) { - n = parseInt(n.toString(), 10) - let nth: string - let npos: number - const gettext = this.gettext - - if (n === -1) return gettext('last') - - npos = Math.abs(n) - switch (npos) { - case 1: - case 21: - case 31: - nth = npos + gettext('st') - break - case 2: - case 22: - nth = npos + gettext('nd') - break - case 3: - case 23: - nth = npos + gettext('rd') - break - default: - nth = npos + gettext('th') - } - - return n < 0 ? nth + ' ' + gettext('last') : nth - } - - monthtext (m: number) { - return this.language.monthNames[m - 1] - } - - weekdaytext (wday: Weekday | number) { - const weekday = - isNumber(wday) ? (wday + 1) % 7 : wday.getJsWeekday() - return ( - ((wday as Weekday).n ? this.nth((wday as Weekday).n!) + ' ' : '') + this.language.dayNames[weekday] - ) - } - - plural (n: number) { - return n % 100 !== 1 - } - - add (s: string) { - this.text.push(' ') - this.text.push(s) - return this - } - - list (arr: ByWeekday | ByWeekday[], callback?: GetText, finalDelim?: string, delim: string = ',') { - if (!isArray(arr)) { - arr = [arr] - } - const delimJoin = function ( - array: string[], - delimiter: string, - finalDelimiter: string - ) { - let list = '' - - for (let i = 0; i < array.length; i++) { - if (i !== 0) { - if (i === array.length - 1) { - list += ' ' + finalDelimiter + ' ' - } else { - list += delimiter + ' ' - } - } - list += array[i] - } - return list - } - - callback = - callback || - function (o) { - return o.toString() - } - const self = this - const realCallback = function (arg: ByWeekday) { - return callback && callback.call(self, arg) - } - - if (finalDelim) { - return delimJoin(arr.map(realCallback), delim, finalDelim) - } else { - return arr.map(realCallback).join(delim + ' ') - } - } -} diff --git a/src/optionstostring.ts b/src/optionstostring.ts deleted file mode 100644 index 6321712e..00000000 --- a/src/optionstostring.ts +++ /dev/null @@ -1,101 +0,0 @@ -import { Options } from './types' -import RRule, { DEFAULT_OPTIONS } from './rrule' -import { includes, isPresent, isArray, isNumber, toArray } from './helpers' -import { Weekday } from './weekday' -import dateutil from './dateutil' -import { DateWithZone } from './datewithzone' - -export function optionsToString (options: Partial) { - let rrule: string[][] = [] - let dtstart: string = '' - const keys: (keyof Options)[] = Object.keys(options) as (keyof Options)[] - const defaultKeys = Object.keys(DEFAULT_OPTIONS) - - for (let i = 0; i < keys.length; i++) { - if (keys[i] === 'tzid') continue - if (!includes(defaultKeys, keys[i])) continue - - let key = keys[i].toUpperCase() - const value: any = options[keys[i]] - let outValue: string = '' - - if (!isPresent(value) || (isArray(value) && !value.length)) continue - - switch (key) { - case 'FREQ': - outValue = RRule.FREQUENCIES[options.freq!] - break - case 'WKST': - if (isNumber(value)) { - outValue = new Weekday(value).toString() - } else { - outValue = value.toString() - } - break - case 'BYWEEKDAY': - /* - NOTE: BYWEEKDAY is a special case. - RRule() deconstructs the rule.options.byweekday array - into an array of Weekday arguments. - On the other hand, rule.origOptions is an array of Weekdays. - We need to handle both cases here. - It might be worth change RRule to keep the Weekdays. - - Also, BYWEEKDAY (used by RRule) vs. BYDAY (RFC) - - */ - key = 'BYDAY' - outValue = toArray(value).map(wday => { - if (wday instanceof Weekday) { - return wday - } - - if (isArray(wday)) { - return new Weekday(wday[0], wday[1]) - } - - return new Weekday(wday) - }).toString() - - break - case 'DTSTART': - dtstart = buildDtstart(value, options.tzid) - break - - case 'UNTIL': - outValue = dateutil.timeToUntilString(value, !options.tzid) - break - - default: - if (isArray(value)) { - const strValues: string[] = [] - for (let j = 0; j < value.length; j++) { - strValues[j] = String(value[j]) - } - outValue = strValues.toString() - } else { - outValue = String(value) - } - } - - if (outValue) { - rrule.push([key, outValue]) - } - } - - const rules = rrule.map(([key, value]) => `${key}=${value.toString()}`).join(';') - let ruleString = '' - if (rules !== '') { - ruleString = `RRULE:${rules}` - } - - return [ dtstart, ruleString ].filter(x => !!x).join('\n') -} - -function buildDtstart (dtstart?: number, tzid?: string | null) { - if (!dtstart) { - return '' - } - - return 'DTSTART' + new DateWithZone(new Date(dtstart), tzid).toString() -} diff --git a/src/parseoptions.ts b/src/parseoptions.ts deleted file mode 100644 index c312bd8f..00000000 --- a/src/parseoptions.ts +++ /dev/null @@ -1,212 +0,0 @@ -import { Options, ParsedOptions, freqIsDailyOrGreater } from './types' -import { includes, notEmpty, isPresent, isNumber, isArray, isWeekdayStr } from './helpers' -import RRule, { defaultKeys, DEFAULT_OPTIONS } from './rrule' -import dateutil from './dateutil' -import { Weekday } from './weekday' -import { Time } from './datetime' - -export function initializeOptions (options: Partial) { - const invalid: string[] = [] - const keys = Object.keys(options) as (keyof Options)[] - - // Shallow copy for options and origOptions and check for invalid - for (const key of keys) { - if (!includes(defaultKeys, key)) invalid.push(key) - if (dateutil.isDate(options[key]) && !dateutil.isValidDate(options[key])) invalid.push(key) - } - - if (invalid.length) { - throw new Error('Invalid options: ' + invalid.join(', ')) - } - - return { ...options } -} - -export function parseOptions (options: Partial) { - const opts = { ...DEFAULT_OPTIONS, ...initializeOptions(options) } - - if (isPresent(opts.byeaster)) opts.freq = RRule.YEARLY - - if (!(isPresent(opts.freq) && RRule.FREQUENCIES[opts.freq])) { - throw new Error(`Invalid frequency: ${opts.freq} ${options.freq}`) - } - - if (!opts.dtstart) opts.dtstart = new Date(new Date().setMilliseconds(0)) - - if (!isPresent(opts.wkst)) { - opts.wkst = RRule.MO.weekday - } else if (isNumber(opts.wkst)) { - // cool, just keep it like that - } else { - opts.wkst = opts.wkst.weekday - } - - if (isPresent(opts.bysetpos)) { - if (isNumber(opts.bysetpos)) opts.bysetpos = [opts.bysetpos] - - for (let i = 0; i < opts.bysetpos.length; i++) { - const v = opts.bysetpos[i] - if (v === 0 || !(v >= -366 && v <= 366)) { - throw new Error( - 'bysetpos must be between 1 and 366,' + ' or between -366 and -1' - ) - } - } - } - - if ( - !( - Boolean(opts.byweekno as number) || - notEmpty(opts.byweekno as number[]) || - notEmpty(opts.byyearday as number[]) || - Boolean(opts.bymonthday) || - notEmpty(opts.bymonthday as number[]) || - isPresent(opts.byweekday) || - isPresent(opts.byeaster) - ) - ) { - switch (opts.freq) { - case RRule.YEARLY: - if (!opts.bymonth) opts.bymonth = opts.dtstart.getUTCMonth() + 1 - opts.bymonthday = opts.dtstart.getUTCDate() - break - case RRule.MONTHLY: - opts.bymonthday = opts.dtstart.getUTCDate() - break - case RRule.WEEKLY: - opts.byweekday = [dateutil.getWeekday(opts.dtstart)] - break - } - } - - // bymonth - if (isPresent(opts.bymonth) && !isArray(opts.bymonth)) { - opts.bymonth = [opts.bymonth] - } - - // byyearday - if ( - isPresent(opts.byyearday) && - !isArray(opts.byyearday) && - isNumber(opts.byyearday) - ) { - opts.byyearday = [opts.byyearday] - } - - // bymonthday - if (!isPresent(opts.bymonthday)) { - opts.bymonthday = [] - opts.bynmonthday = [] - } else if (isArray(opts.bymonthday)) { - const bymonthday = [] - const bynmonthday = [] - - for (let i = 0; i < opts.bymonthday.length; i++) { - const v = opts.bymonthday[i] - if (v > 0) { - bymonthday.push(v) - } else if (v < 0) { - bynmonthday.push(v) - } - } - opts.bymonthday = bymonthday - opts.bynmonthday = bynmonthday - } else if (opts.bymonthday < 0) { - opts.bynmonthday = [opts.bymonthday] - opts.bymonthday = [] - } else { - opts.bynmonthday = [] - opts.bymonthday = [opts.bymonthday] - } - - // byweekno - if (isPresent(opts.byweekno) && !isArray(opts.byweekno)) { - opts.byweekno = [opts.byweekno] - } - - // byweekday / bynweekday - if (!isPresent(opts.byweekday)) { - opts.bynweekday = null - } else if (isNumber(opts.byweekday)) { - opts.byweekday = [opts.byweekday] - opts.bynweekday = null - } else if (isWeekdayStr(opts.byweekday)) { - opts.byweekday = [Weekday.fromStr(opts.byweekday).weekday] - opts.bynweekday = null - } else if (opts.byweekday instanceof Weekday) { - if (!opts.byweekday.n || opts.freq > RRule.MONTHLY) { - opts.byweekday = [opts.byweekday.weekday] - opts.bynweekday = null - } else { - opts.bynweekday = [[opts.byweekday.weekday, opts.byweekday.n]] - opts.byweekday = null - } - } else { - const byweekday: number[] = [] - const bynweekday = [] - - for (let i = 0; i < opts.byweekday.length; i++) { - const wday = opts.byweekday[i] - - if (isNumber(wday)) { - byweekday.push(wday) - continue - } else if (isWeekdayStr(wday)) { - byweekday.push(Weekday.fromStr(wday).weekday) - continue - } - - if (!wday.n || opts.freq > RRule.MONTHLY) { - byweekday.push(wday.weekday) - } else { - bynweekday.push([wday.weekday, wday.n]) - } - } - opts.byweekday = notEmpty(byweekday) ? byweekday : null - opts.bynweekday = notEmpty(bynweekday) ? bynweekday : null - } - - // byhour - if (!isPresent(opts.byhour)) { - opts.byhour = - opts.freq < RRule.HOURLY ? [opts.dtstart.getUTCHours()] : null - } else if (isNumber(opts.byhour)) { - opts.byhour = [opts.byhour] - } - - // byminute - if (!isPresent(opts.byminute)) { - opts.byminute = - opts.freq < RRule.MINUTELY ? [opts.dtstart.getUTCMinutes()] : null - } else if (isNumber(opts.byminute)) { - opts.byminute = [opts.byminute] - } - - // bysecond - if (!isPresent(opts.bysecond)) { - opts.bysecond = - opts.freq < RRule.SECONDLY ? [opts.dtstart.getUTCSeconds()] : null - } else if (isNumber(opts.bysecond)) { - opts.bysecond = [opts.bysecond] - } - - return { parsedOptions: opts as ParsedOptions } -} - -export function buildTimeset (opts: ParsedOptions) { - const millisecondModulo = opts.dtstart.getTime() % 1000 - if (!freqIsDailyOrGreater(opts.freq)) { - return [] - } - - const timeset: Time[] = [] - opts.byhour.forEach(hour => { - opts.byminute.forEach(minute => { - opts.bysecond.forEach(second => { - timeset.push(new Time(hour, minute, second, millisecondModulo)) - }) - }) - }) - - return timeset -} diff --git a/src/parsestring.ts b/src/parsestring.ts deleted file mode 100644 index b1b38e53..00000000 --- a/src/parsestring.ts +++ /dev/null @@ -1,138 +0,0 @@ -import { Options, Frequency } from './types' -import { Weekday } from './weekday' -import dateutil from './dateutil' -import { Days } from './rrule' - -export function parseString (rfcString: string): Partial { - const options = rfcString.split('\n').map(parseLine).filter(x => x !== null) - return { ...options[0], ...options[1] } -} - -export function parseDtstart (line: string) { - const options: Partial = {} - - const dtstartWithZone = /DTSTART(?:;TZID=([^:=]+?))?(?::|=)([^;\s]+)/i.exec(line) - - if (!dtstartWithZone) { - return options - } - - const [ _, tzid, dtstart ] = dtstartWithZone - - if (tzid) { - options.tzid = tzid - } - options.dtstart = dateutil.untilStringToDate(dtstart) - return options -} - -function parseLine (rfcString: string) { - rfcString = rfcString.replace(/^\s+|\s+$/, '') - if (!rfcString.length) return null - - const header = /^([A-Z]+?)[:;]/.exec(rfcString.toUpperCase()) - if (!header) { - return parseRrule(rfcString) - } - - const [ _, key ] = header - switch (key.toUpperCase()) { - case 'RRULE': - case 'EXRULE': - return parseRrule(rfcString) - case 'DTSTART': - return parseDtstart(rfcString) - default: - throw new Error(`Unsupported RFC prop ${key} in ${rfcString}`) - } -} - -function parseRrule (line: string) { - const strippedLine = line.replace(/^RRULE:/i, '') - const options = parseDtstart(strippedLine) - - const attrs = line.replace(/^(?:RRULE|EXRULE):/i, '').split(';') - - attrs.forEach(attr => { - const [ key, value ] = attr.split('=') - switch (key.toUpperCase()) { - case 'FREQ': - options.freq = Frequency[value.toUpperCase() as keyof typeof Frequency] - break - case 'WKST': - options.wkst = Days[value.toUpperCase() as keyof typeof Days] - break - case 'COUNT': - case 'INTERVAL': - case 'BYSETPOS': - case 'BYMONTH': - case 'BYMONTHDAY': - case 'BYYEARDAY': - case 'BYWEEKNO': - case 'BYHOUR': - case 'BYMINUTE': - case 'BYSECOND': - const num = parseNumber(value) - const optionKey = key.toLowerCase() - // @ts-ignore - options[optionKey] = num - break - case 'BYWEEKDAY': - case 'BYDAY': - options.byweekday = parseWeekday(value) - break - case 'DTSTART': - case 'TZID': - // for backwards compatibility - const dtstart = parseDtstart(line) - options.tzid = dtstart.tzid - options.dtstart = dtstart.dtstart - break - case 'UNTIL': - options.until = dateutil.untilStringToDate(value) - break - case 'BYEASTER': - options.byeaster = Number(value) - break - default: - throw new Error("Unknown RRULE property '" + key + "'") - } - }) - - return options -} - -function parseNumber (value: string) { - if (value.indexOf(',') !== -1) { - const values = value.split(',') - return values.map(parseIndividualNumber) - } - - return parseIndividualNumber(value) -} - -function parseIndividualNumber (value: string) { - if (/^[+-]?\d+$/.test(value)) { - return Number(value) - } - - return value -} - -function parseWeekday (value: string) { - const days = value.split(',') - - return days.map(day => { - if (day.length === 2) { - // MO, TU, ... - return Days[day as keyof typeof Days] // wday instanceof Weekday - } - - // -1MO, +3FR, 1SO, 13TU ... - const parts = day.match(/^([+-]?\d{1,2})([A-Z]{2})$/)! - const n = Number(parts[1]) - const wdaypart = parts[2] as keyof typeof Days - const wday = Days[wdaypart].weekday - return new Weekday(wday, n) - }) -} diff --git a/src/rrule.ts b/src/rrule.ts deleted file mode 100644 index ccbac06c..00000000 --- a/src/rrule.ts +++ /dev/null @@ -1,273 +0,0 @@ -import dateutil from './dateutil' - -import IterResult, { IterArgs } from './iterresult' -import CallbackIterResult from './callbackiterresult' -import { Language } from './nlp/i18n' -import { Nlp } from './nlp/index' -import { DateFormatter, GetText } from './nlp/totext' -import { ParsedOptions, Options, Frequency, QueryMethods, QueryMethodTypes, IterResultType } from './types' -import { parseOptions, initializeOptions } from './parseoptions' -import { parseString } from './parsestring' -import { optionsToString } from './optionstostring' -import { Cache, CacheKeys } from './cache' -import { Weekday } from './weekday' -import { iter } from './iter/index' - -interface GetNlp { - _nlp: Nlp - (): Nlp -} - -const getnlp: GetNlp = function () { - // Lazy, runtime import to avoid circular refs. - if (!getnlp._nlp) { - getnlp._nlp = require('./nlp') - } - return getnlp._nlp -} as GetNlp - -// ============================================================================= -// RRule -// ============================================================================= - -export const Days = { - MO: new Weekday(0), - TU: new Weekday(1), - WE: new Weekday(2), - TH: new Weekday(3), - FR: new Weekday(4), - SA: new Weekday(5), - SU: new Weekday(6) -} - -export const DEFAULT_OPTIONS: Options = { - freq: Frequency.YEARLY, - dtstart: null, - interval: 1, - wkst: Days.MO, - count: null, - until: null, - tzid: null, - bysetpos: null, - bymonth: null, - bymonthday: null, - bynmonthday: null, - byyearday: null, - byweekno: null, - byweekday: null, - bynweekday: null, - byhour: null, - byminute: null, - bysecond: null, - byeaster: null -} - -export const defaultKeys = Object.keys(DEFAULT_OPTIONS) as (keyof Options)[] - -/** - * - * @param {Options?} options - see - * The only required option is `freq`, one of RRule.YEARLY, RRule.MONTHLY, ... - * @constructor - */ -export default class RRule implements QueryMethods { - public _cache: Cache | null - public origOptions: Partial - public options: ParsedOptions - - // RRule class 'constants' - - static readonly FREQUENCIES: (keyof typeof Frequency)[] = [ - 'YEARLY', - 'MONTHLY', - 'WEEKLY', - 'DAILY', - 'HOURLY', - 'MINUTELY', - 'SECONDLY' - ] - - static readonly YEARLY = Frequency.YEARLY - static readonly MONTHLY = Frequency.MONTHLY - static readonly WEEKLY = Frequency.WEEKLY - static readonly DAILY = Frequency.DAILY - static readonly HOURLY = Frequency.HOURLY - static readonly MINUTELY = Frequency.MINUTELY - static readonly SECONDLY = Frequency.SECONDLY - - static readonly MO = Days.MO - static readonly TU = Days.TU - static readonly WE = Days.WE - static readonly TH = Days.TH - static readonly FR = Days.FR - static readonly SA = Days.SA - static readonly SU = Days.SU - - constructor (options: Partial = {}, noCache: boolean = false) { - // RFC string - this._cache = noCache ? null : new Cache() - - // used by toString() - this.origOptions = initializeOptions(options) - const { parsedOptions } = parseOptions(options) - this.options = parsedOptions - } - - static parseText (text: string, language?: Language) { - return getnlp().parseText(text, language) - } - - static fromText (text: string, language?: Language) { - return getnlp().fromText(text, language) - } - - static parseString = parseString - - static fromString (str: string) { - return new RRule(RRule.parseString(str) || undefined) - } - - static optionsToString = optionsToString - - protected _iter (iterResult: IterResult): IterResultType { - return iter(iterResult, this.options) - } - - private _cacheGet (what: CacheKeys | 'all', args?: Partial) { - if (!this._cache) return false - return this._cache._cacheGet(what, args) - } - - public _cacheAdd ( - what: CacheKeys | 'all', - value: Date[] | Date | null, - args?: Partial - ) { - if (!this._cache) return - return this._cache._cacheAdd(what, value, args) - } - - /** - * @param {Function} iterator - optional function that will be called - * on each date that is added. It can return false - * to stop the iteration. - * @return Array containing all recurrences. - */ - all (iterator?: (d: Date, len: number) => boolean): Date[] { - if (iterator) { - return this._iter(new CallbackIterResult('all', {}, iterator)) - } - - let result = this._cacheGet('all') as Date[] | false - if (result === false) { - result = this._iter(new IterResult('all', {})) - this._cacheAdd('all', result) - } - return result - } - - /** - * Returns all the occurrences of the rrule between after and before. - * The inc keyword defines what happens if after and/or before are - * themselves occurrences. With inc == True, they will be included in the - * list, if they are found in the recurrence set. - * @return Array - */ - between ( - after: Date, - before: Date, - inc: boolean = false, - iterator?: (d: Date, len: number) => boolean - ): Date[] { - if (!dateutil.isValidDate(after) || !dateutil.isValidDate(before)) throw new Error('Invalid date passed in to RRule.between') - const args = { - before, - after, - inc - } - - if (iterator) { - return this._iter( - new CallbackIterResult('between', args, iterator) - ) - } - - let result = this._cacheGet('between', args) - if (result === false) { - result = this._iter(new IterResult('between', args)) - this._cacheAdd('between', result, args) - } - return result as Date[] - } - - /** - * Returns the last recurrence before the given datetime instance. - * The inc keyword defines what happens if dt is an occurrence. - * With inc == True, if dt itself is an occurrence, it will be returned. - * @return Date or null - */ - before (dt: Date, inc = false): Date { - if (!dateutil.isValidDate(dt)) throw new Error('Invalid date passed in to RRule.before') - const args = { dt: dt, inc: inc } - let result = this._cacheGet('before', args) - if (result === false) { - result = this._iter(new IterResult('before', args)) - this._cacheAdd('before', result, args) - } - return result as Date - } - - /** - * Returns the first recurrence after the given datetime instance. - * The inc keyword defines what happens if dt is an occurrence. - * With inc == True, if dt itself is an occurrence, it will be returned. - * @return Date or null - */ - after (dt: Date, inc = false): Date { - if (!dateutil.isValidDate(dt)) throw new Error('Invalid date passed in to RRule.after') - const args = { dt: dt, inc: inc } - let result = this._cacheGet('after', args) - if (result === false) { - result = this._iter(new IterResult('after', args)) - this._cacheAdd('after', result, args) - } - return result as Date - } - - /** - * Returns the number of recurrences in this set. It will have go trough - * the whole recurrence, if this hasn't been done before. - */ - count (): number { - return this.all().length - } - - /** - * Converts the rrule into its string representation - * @see - * @return String - */ - toString () { - return optionsToString(this.origOptions) - } - - /** - * Will convert all rules described in nlp:ToText - * to text. - */ - toText (gettext?: GetText, language?: Language, dateFormatter?: DateFormatter) { - return getnlp().toText(this, gettext, language, dateFormatter) - } - - isFullyConvertibleToText () { - return getnlp().isFullyConvertible(this) - } - - /** - * @return a RRule instance with the same freq and options - * as this one (cache is not cloned) - */ - clone (): RRule { - return new RRule(this.origOptions) - } -} diff --git a/src/rruleset.ts b/src/rruleset.ts deleted file mode 100644 index 1e548fb9..00000000 --- a/src/rruleset.ts +++ /dev/null @@ -1,227 +0,0 @@ -import RRule from './rrule' -import dateutil from './dateutil' -import { includes } from './helpers' -import IterResult from './iterresult' -import { iterSet } from './iterset' -import { QueryMethodTypes, IterResultType } from './types' -import { rrulestr } from './rrulestr' -import { optionsToString } from './optionstostring' - -function createGetterSetter (fieldName: string) { - return (field?: T) => { - if (field !== undefined) { - this[`_${fieldName}`] = field - } - - if (this[`_${fieldName}`] !== undefined) { - return this[`_${fieldName}`] - } - - for (let i = 0; i < this._rrule.length; i++) { - const field: T = this._rrule[i].origOptions[fieldName] - if (field) { - return field - } - } - } -} - -export default class RRuleSet extends RRule { - public readonly _rrule: RRule[] - public readonly _rdate: Date[] - public readonly _exrule: RRule[] - public readonly _exdate: Date[] - - private _dtstart?: Date | null | undefined - private _tzid?: string - - /** - * - * @param {Boolean?} noCache - * The same stratagy as RRule on cache, default to false - * @constructor - */ - constructor (noCache: boolean = false) { - super({}, noCache) - - this._rrule = [] - this._rdate = [] - this._exrule = [] - this._exdate = [] - } - - dtstart = createGetterSetter.apply(this, ['dtstart']) - tzid = createGetterSetter.apply(this, ['tzid']) - - _iter (iterResult: IterResult): IterResultType { - return iterSet( - iterResult, - this._rrule, - this._exrule, - this._rdate, - this._exdate, - this.tzid() - ) - } - - /** - * Adds an RRule to the set - * - * @param {RRule} - */ - rrule (rrule: RRule) { - _addRule(rrule, this._rrule) - } - - /** - * Adds an EXRULE to the set - * - * @param {RRule} - */ - exrule (rrule: RRule) { - _addRule(rrule, this._exrule) - } - - /** - * Adds an RDate to the set - * - * @param {Date} - */ - rdate (date: Date) { - _addDate(date, this._rdate) - } - - /** - * Adds an EXDATE to the set - * - * @param {Date} - */ - exdate (date: Date) { - _addDate(date, this._exdate) - } - - /** - * Get list of included rrules in this recurrence set. - * - * @return List of rrules - */ - rrules () { - return this._rrule.map(e => rrulestr(e.toString())) - } - - /** - * Get list of excluded rrules in this recurrence set. - * - * @return List of exrules - */ - exrules () { - return this._exrule.map(e => rrulestr(e.toString())) - } - - /** - * Get list of included datetimes in this recurrence set. - * - * @return List of rdates - */ - rdates () { - return this._rdate.map(e => new Date(e.getTime())) - } - - /** - * Get list of included datetimes in this recurrence set. - * - * @return List of exdates - */ - exdates () { - return this._exdate.map(e => new Date(e.getTime())) - } - - valueOf () { - let result: string[] = [] - - if (!this._rrule.length && this._dtstart) { - result = result.concat(optionsToString({ dtstart: this._dtstart })) - } - - this._rrule.forEach(function (rrule) { - result = result.concat(rrule.toString().split('\n')) - }) - - this._exrule.forEach(function (exrule) { - result = result.concat( - exrule.toString().split('\n') - .map(line => line.replace(/^RRULE:/, 'EXRULE:')) - .filter(line => !/^DTSTART/.test(line)) - ) - }) - - if (this._rdate.length) { - result.push( - rdatesToString('RDATE', this._rdate, this.tzid()) - ) - } - - if (this._exdate.length) { - result.push( - rdatesToString('EXDATE', this._exdate, this.tzid()) - ) - } - - return result - } - - /** - * to generate recurrence field such as: - * DTSTART:19970902T010000Z - * RRULE:FREQ=YEARLY;COUNT=2;BYDAY=TU - * RRULE:FREQ=YEARLY;COUNT=1;BYDAY=TH - */ - toString () { - return this.valueOf().join('\n') - } - - /** - * Create a new RRuleSet Object completely base on current instance - */ - clone (): RRuleSet { - const rrs = new RRuleSet(!!this._cache) - - this._rrule.forEach(rule => rrs.rrule(rule.clone())) - this._exrule.forEach(rule => rrs.exrule(rule.clone())) - this._rdate.forEach(date => rrs.rdate(new Date(date.getTime()))) - this._exdate.forEach(date => rrs.exdate(new Date(date.getTime()))) - - return rrs - } -} - -function _addRule (rrule: RRule, collection: RRule[]) { - if (!(rrule instanceof RRule)) { - throw new TypeError(String(rrule) + ' is not RRule instance') - } - - if (!includes(collection.map(String), String(rrule))) { - collection.push(rrule) - } -} - -function _addDate (date: Date, collection: Date[]) { - if (!(date instanceof Date)) { - throw new TypeError(String(date) + ' is not Date instance') - } - if (!includes(collection.map(Number), Number(date))) { - collection.push(date) - dateutil.sort(collection) - } -} - -function rdatesToString (param: string, rdates: Date[], tzid: string | undefined) { - const isUTC = !tzid || tzid.toUpperCase() === 'UTC' - const header = isUTC ? `${param}:` : `${param};TZID=${tzid}:` - - const dateString = rdates - .map(rdate => dateutil.timeToUntilString(rdate.valueOf(), isUTC)) - .join(',') - - return `${header}${dateString}` -} diff --git a/src/rrulestr.ts b/src/rrulestr.ts deleted file mode 100644 index 967d20a1..00000000 --- a/src/rrulestr.ts +++ /dev/null @@ -1,260 +0,0 @@ -import RRule from './rrule' -import RRuleSet from './rruleset' -import dateutil from './dateutil' -import { includes, split } from './helpers' -import { Options } from './types' -import { parseString, parseDtstart } from './parsestring' - -export interface RRuleStrOptions { - dtstart: Date | null - cache: boolean - unfold: boolean - forceset: boolean - compatible: boolean - tzid: string | null -} - -/** - * RRuleStr - * To parse a set of rrule strings - */ -const DEFAULT_OPTIONS: RRuleStrOptions = { - dtstart: null, - cache: false, - unfold: false, - forceset: false, - compatible: false, - tzid: null -} - -export function parseInput (s: string, options: Partial) { - let rrulevals: Partial[] = [] - let rdatevals: Date[] = [] - let exrulevals: Partial[] = [] - let exdatevals: Date[] = [] - - let { dtstart, tzid } = parseDtstart(s) - - const lines = splitIntoLines(s, options.unfold) - - lines.forEach(line => { - if (!line) return - const { name, parms, value } = breakDownLine(line) - - switch (name.toUpperCase()) { - case 'RRULE': - if (parms.length) { - throw new Error(`unsupported RRULE parm: ${parms.join(',')}`) - } - - rrulevals.push(parseString(line)) - break - - case 'RDATE': - const [ _, rdateTzid ] = /RDATE(?:;TZID=([^:=]+))?/i.exec(line)! - if (rdateTzid && !tzid) { - tzid = rdateTzid - } - rdatevals = rdatevals.concat(parseRDate(value, parms)) - break - - case 'EXRULE': - if (parms.length) { - throw new Error(`unsupported EXRULE parm: ${parms.join(',')}`) - } - - exrulevals.push(parseString(value)) - break - - case 'EXDATE': - exdatevals = exdatevals.concat(parseRDate(value, parms)) - break - - case 'DTSTART': - break - - default: - throw new Error('unsupported property: ' + name) - } - }) - - return { - dtstart, - tzid, - rrulevals, - rdatevals, - exrulevals, - exdatevals - } -} - -function buildRule (s: string, options: Partial) { - const { - rrulevals, - rdatevals, - exrulevals, - exdatevals, - dtstart, - tzid - } = parseInput(s, options) - - const noCache = options.cache === false - - if (options.compatible) { - options.forceset = true - options.unfold = true - } - - if ( - options.forceset || - rrulevals.length > 1 || - rdatevals.length || - exrulevals.length || - exdatevals.length - ) { - const rset = new RRuleSet(noCache) - - rset.dtstart(dtstart) - rset.tzid(tzid || undefined) - - rrulevals.forEach(val => { - rset.rrule( - new RRule( - groomRruleOptions(val, dtstart, tzid), - noCache - ) - ) - }) - - rdatevals.forEach(date => { - rset.rdate(date) - }) - - exrulevals.forEach(val => { - rset.exrule( - new RRule( - groomRruleOptions(val, dtstart, tzid), - noCache - ) - ) - }) - - exdatevals.forEach(date => { - rset.exdate(date) - }) - - if (options.compatible && options.dtstart) rset.rdate(dtstart!) - return rset - } - - const val = rrulevals[0] || {} - return new RRule(groomRruleOptions( - val, - val.dtstart || options.dtstart || dtstart, - val.tzid || options.tzid || tzid - ), noCache) -} - -export function rrulestr ( - s: string, - options: Partial = {} -): RRule | RRuleSet { - return buildRule(s, initializeOptions(options)) -} - -function groomRruleOptions (val: Partial, dtstart?: Date | null, tzid?: string | null) { - return { - ...val, - dtstart, - tzid - } -} - -function initializeOptions (options: Partial) { - const invalid: string[] = [] - const keys = Object.keys(options) as (keyof typeof options)[] - const defaultKeys = Object.keys( - DEFAULT_OPTIONS - ) as (keyof typeof DEFAULT_OPTIONS)[] - - keys.forEach(function (key) { - if (!includes(defaultKeys, key)) invalid.push(key) - }) - - if (invalid.length) { - throw new Error('Invalid options: ' + invalid.join(', ')) - } - - return { ...DEFAULT_OPTIONS, ...options } -} - -function extractName (line: string) { - if (line.indexOf(':') === -1) { - return { - name: 'RRULE', - value: line - } - } - - const [name, value] = split(line, ':', 1) - return { - name, - value - } -} - -function breakDownLine (line: string) { - const { name, value } = extractName(line) - let parms = name.split(';') - if (!parms) throw new Error('empty property name') - - return { - name: parms[0].toUpperCase(), - parms: parms.slice(1), - value - } -} - -function splitIntoLines (s: string, unfold = false) { - s = s && s.trim() - if (!s) throw new Error('Invalid empty string') - - // More info about 'unfold' option - // Go head to http://www.ietf.org/rfc/rfc2445.txt - if (!unfold) { - return s.split(/\s/) - } - - const lines = s.split('\n') - let i = 0 - while (i < lines.length) { - // TODO - const line = (lines[i] = lines[i].replace(/\s+$/g, '')) - if (!line) { - lines.splice(i, 1) - } else if (i > 0 && line[0] === ' ') { - lines[i - 1] += line.slice(1) - lines.splice(i, 1) - } else { - i += 1 - } - } - - return lines -} - -function validateDateParm (parms: string[]) { - parms.forEach(parm => { - if (!/(VALUE=DATE(-TIME)?)|(TZID=)/.test(parm)) { - throw new Error('unsupported RDATE/EXDATE parm: ' + parm) - } - }) -} - -function parseRDate (rdateval: string, parms: string[]) { - validateDateParm(parms) - - return rdateval - .split(',') - .map(datestr => dateutil.untilStringToDate(datestr)) -} diff --git a/src/types.ts b/src/types.ts deleted file mode 100644 index bbf1d85a..00000000 --- a/src/types.ts +++ /dev/null @@ -1,64 +0,0 @@ -import { Weekday, WeekdayStr } from './weekday' - -export interface QueryMethods { - all (): Date[] - between (after: Date, before: Date, inc: boolean): Date[] - before (date: Date, inc: boolean): Date - after (date: Date, inc: boolean): Date -} - -export type QueryMethodTypes = keyof QueryMethods -export type IterResultType = M extends 'all' | 'between' ? Date[] : (Date | null) - -export enum Frequency { - YEARLY = 0, - MONTHLY = 1, - WEEKLY = 2, - DAILY = 3, - HOURLY = 4, - MINUTELY = 5, - SECONDLY = 6 -} - -export function freqIsDailyOrGreater (freq: Frequency): freq is Frequency.YEARLY | Frequency.MONTHLY | Frequency.WEEKLY | Frequency.DAILY { - return freq < Frequency.HOURLY -} - -export interface Options { - freq: Frequency - dtstart: Date | null - interval: number - wkst: Weekday | number | null - count: number | null - until: Date | null - tzid: string | null - bysetpos: number | number[] | null - bymonth: number | number[] | null - bymonthday: number | number[] | null - bynmonthday: number[] | null - byyearday: number | number[] | null - byweekno: number | number[] | null - byweekday: ByWeekday | ByWeekday[] | null - bynweekday: number[][] | null - byhour: number | number[] | null - byminute: number | number[] | null - bysecond: number | number[] | null - byeaster: number | null -} - -export interface ParsedOptions extends Options { - dtstart: Date - wkst: number - bysetpos: number[] - bymonth: number[] - bymonthday: number[] - bynmonthday: number[] - byyearday: number[] - byweekno: number[] - byweekday: number[] - byhour: number[] - byminute: number[] - bysecond: number[] -} - -export type ByWeekday = WeekdayStr | number | Weekday diff --git a/src/weekday.ts b/src/weekday.ts deleted file mode 100644 index a9f879ae..00000000 --- a/src/weekday.ts +++ /dev/null @@ -1,43 +0,0 @@ -// ============================================================================= -// Weekday -// ============================================================================= - -export type WeekdayStr = 'MO' | 'TU' | 'WE' | 'TH' | 'FR' | 'SA' | 'SU' -export const ALL_WEEKDAYS: WeekdayStr[] = ['MO', 'TU', 'WE', 'TH', 'FR', 'SA', 'SU'] - -export class Weekday { - public readonly weekday: number - public readonly n?: number - - constructor (weekday: number, n?: number) { - if (n === 0) throw new Error("Can't create weekday with n == 0") - this.weekday = weekday - this.n = n - } - - static fromStr (str: WeekdayStr): Weekday { - return new Weekday(ALL_WEEKDAYS.indexOf(str)) - } - - // __call__ - Cannot call the object directly, do it through - // e.g. RRule.TH.nth(-1) instead, - nth (n: number) { - return this.n === n ? this : new Weekday(this.weekday, n) - } - - // __eq__ - equals (other: Weekday) { - return this.weekday === other.weekday && this.n === other.n - } - - // __repr__ - toString () { - let s: string = ALL_WEEKDAYS[this.weekday] - if (this.n) s = (this.n > 0 ? '+' : '') + String(this.n) + s - return s - } - - getJsWeekday () { - return this.weekday === 6 ? 0 : this.weekday + 1 - } -} diff --git a/test/dateutil.test.ts b/test/dateutil.test.ts deleted file mode 100644 index d6bd196a..00000000 --- a/test/dateutil.test.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { dateutil } from '../src/dateutil' -import { expect } from 'chai' - -describe('untilStringToDate', () => { - it('parses a date string', () => { - const date = dateutil.untilStringToDate('19970902T090000') - expect(date.getTime()).to.equal(new Date(Date.UTC(1997, 8, 2, 9, 0, 0, 0)).getTime()) - }) -}) diff --git a/test/datewithzone.test.ts b/test/datewithzone.test.ts deleted file mode 100644 index 3bf0cd4e..00000000 --- a/test/datewithzone.test.ts +++ /dev/null @@ -1,66 +0,0 @@ -import { DateWithZone } from "../src/datewithzone"; -import { expect } from "chai"; -import { DateTime } from "luxon"; -import { set as setMockDate, reset as resetMockDate } from 'mockdate' -import { expectedDate } from "./lib/utils"; - -describe('toString', () => { - it('returns the date when no tzid is present', () => { - const dt = new DateWithZone(new Date(Date.UTC(2010, 9, 5, 11, 0, 0))) - expect(dt.toString()).to.equal(':20101005T110000Z') - - const dt2 = new DateWithZone(new Date(Date.UTC(2010, 9, 5, 11, 0, 0)), 'UTC') - expect(dt2.toString()).to.equal(':20101005T110000Z') - }) - - it('returns the date with tzid when present', () => { - const dt = new DateWithZone(new Date(Date.UTC(2010, 9, 5, 11, 0, 0)), 'Asia/Tokyo') - expect(dt.toString()).to.equal(';TZID=Asia/Tokyo:20101005T110000') - }) -}) - -it('returns the time of the date', () => { - const d = new Date(Date.UTC(2010, 9, 5, 11, 0, 0)) - const dt = new DateWithZone(d) - expect(dt.getTime()).to.equal(d.getTime()) -}) - -describe('rezonedDate', () => { - it('returns the original date when no zone is given', () => { - const d = new Date(Date.UTC(2010, 9, 5, 11, 0, 0)) - const dt = new DateWithZone(d) - expect(dt.rezonedDate()).to.deep.equal(d) - }) - - it('returns the date in the correct zone when given', () => { - const targetZone = 'America/New_York' - const currentLocalDate = DateTime.local(2000, 2, 6, 1, 0, 0) - setMockDate(currentLocalDate.toJSDate()) - - const d = DateTime.fromISO('20101005T110000').toJSDate() - const dt = new DateWithZone(d, targetZone) - expect(dt.rezonedDate()).to.deep.equal( - expectedDate(DateTime.fromISO('20101005T110000'), currentLocalDate, targetZone) - ) - - resetMockDate() - }) - - it('recovers from an error if Luxon is missing', () => { - const origfromJSDate = DateTime.fromJSDate - DateTime.fromJSDate = () => { - throw new TypeError() - } - - const targetZone = 'America/New_York' - const currentLocalDate = DateTime.local(2000, 2, 6, 1, 0, 0) - setMockDate(currentLocalDate.toJSDate()) - - const d = DateTime.fromISO('20101005T110000').toJSDate() - const dt = new DateWithZone(d, targetZone) - expect(dt.rezonedDate()).to.deep.equal(d) - - DateTime.fromJSDate = origfromJSDate - resetMockDate() - }) -}) \ No newline at end of file diff --git a/test/helpers.test.ts b/test/helpers.test.ts deleted file mode 100644 index 7efd7d55..00000000 --- a/test/helpers.test.ts +++ /dev/null @@ -1,132 +0,0 @@ -import { empty, includes, pymod, divmod, split, clone, range, repeat, isPresent, isArray } from '../src/helpers' -import { expect } from 'chai' -import { isNumber } from 'util'; - -describe('isPresent', () => { - it('is false if object is null', () => { - expect(isPresent(null)).to.be.false - }) - - it('is false if object is undefined', () => { - expect(isPresent(undefined)).to.be.false - }) - - it('is true if object is non-null and not undefined', () => { - expect(isPresent(0)).to.be.true - expect(isPresent('')).to.be.true - expect(isPresent('foo')).to.be.true - expect(isPresent(123)).to.be.true - expect(isPresent([])).to.be.true - }) -}) - -describe('isArray', () => { - it('is true if it is an array', () => { - expect(isArray([])).to.be.true - expect(isArray([1])).to.be.true - expect(isArray(['foo'])).to.be.true - }) - - it('is false if it is empty', () => { - expect(isArray('foo')).to.be.false - expect(isArray(null)).to.be.false - expect(isArray(0)).to.be.false - expect(isArray(undefined)).to.be.false - }) -}) - -describe('isNumber', () => { - it('is true if it is a number', () => { - expect(isNumber(0)).to.be.true - }) - - it('is false if it is not a number', () => { - expect(isNumber('1')).to.be.false - expect(isNumber(null)).to.be.false - }) -}) - -describe('empty', () => { - it('is empty if object is null', () => { - expect(empty(null)).to.be.true - }) - - it('is empty if object is undefined', () => { - expect(empty(undefined)).to.be.true - }) - - it('is empty if object is an empty array', () => { - expect(empty([])).to.be.true - }) - - it('is not empty if object is a non-empty array', () => { - expect(empty(['foo'])).to.be.false - expect(empty([0])).to.be.false - }) -}) - -describe('includes', () => { - it('is true if the object is found', () => { - expect(includes(['foo'], 'foo')).to.be.true - expect(includes([0], 0)).to.be.true - }) - - it('is false if the object is not found', () => { - expect(includes(['foo'], 'bar')).to.be.false - expect(includes([0], 1)).to.be.false - }) -}) - -describe('pymod', () => { - it('returns the wrapped result', () => { - expect(pymod(1, 8)).to.equal(1) - expect(pymod(-1, -8)).to.equal(-1) - expect(pymod(-1, 8)).to.equal(7) - }) -}) - -describe('divmod', () => { - it('returns the divided result', () => { - expect(divmod(1, 8)).to.deep.equal({ div: 0, mod: 1 }) - expect(divmod(-1, -8)).to.deep.equal({ div: 0, mod: -1 }) - expect(divmod(-1, 8)).to.deep.equal({ div: -1, mod: 7 }) - }) -}) - -describe('split', () => { - it('splits on the separator', () => { - expect(split('one-two-three', '-', 0)).to.deep.equal(['one', 'two', 'three']) - }) - - it('only splits the specified number when nonzero', () => { - expect(split('one-two-three', '-', 1)).to.deep.equal(['one', 'two-three']) - }) -}) - -describe('clone', () => { - it('copies an array', () => { - const a = ['a', 'b', 'c'] - expect(clone(a)).not.to.equal(a) - expect(clone(a)).to.deep.equal(a) - }) -}) - -describe('range', () => { - it('generates a range', () => { - expect(range(3, 7)).to.deep.equal([3, 4, 5, 6]) - }) - - it('generates to the first argument if no second argument is given', () => { - expect(range(7)).to.deep.equal([0, 1, 2, 3, 4, 5, 6]) - }) -}) - -describe('repeat', () => { - it('repeats a single item', () => { - expect(repeat('foo', 3)).to.deep.equal(['foo', 'foo', 'foo']) - }) - - it('repeats an array', () => { - expect(repeat(['foo'], 3)).to.deep.equal([['foo'], ['foo'], ['foo']]) - }) -}) \ No newline at end of file diff --git a/test/lib/utils.ts b/test/lib/utils.ts deleted file mode 100644 index d82c5d2f..00000000 --- a/test/lib/utils.ts +++ /dev/null @@ -1,209 +0,0 @@ -import { expect } from 'chai' -import { ExclusiveTestFunction, TestFunction } from 'mocha' -import { RRule, RRuleSet } from '../../src' -import { DateTime } from 'luxon'; - -const assertDatesEqual = function (actual: Date | Date[], expected: Date | Date[], msg?: string) { - msg = msg ? ' [' + msg + '] ' : '' - - if (!(actual instanceof Array)) actual = [actual] - if (!(expected instanceof Array)) expected = [expected] - - if (expected.length > 1) { - expect(actual).to.have.length(expected.length, msg + 'number of recurrences') - msg = ' - ' - } - - for (let i = 0; i < expected.length; i++) { - const act = actual[i] - const exp = expected[i] - expect(exp instanceof Date ? exp.toString() : exp).to.equal( - act.toString(), msg + (i + 1) + '/' + expected.length) - } -} - -const extractTime = function (date: Date) { - return date != null ? date.getTime() : void 0 -} - -/** - * datetime.datetime - */ -export const datetime = function (y: number, m: number, d: number, h: number = 0, i: number = 0, s: number = 0) { - return new Date(Date.UTC(y, m - 1, d, h, i, s)) -} - -export const datetimeUTC = function (y: number, m: number, d: number, h: number = 0, i: number = 0, s: number = 0) { - return new Date(Date.UTC(y, m - 1, d, h, i, s)) -} - -/** - * dateutil.parser.parse - */ -export const parse = function (str: string) { - const parts = str.match(/^(\d{4})(\d{2})(\d{2})T(\d{2})(\d{2})(\d{2})/) - let [ _, y, m, d, h, i, s ] = parts - const year = Number(y) - const month = Number(m[0] === '0' ? m[1] : m) - 1 - const day = Number(d[0] === '0' ? d[1] : d) - const hour = Number(h[0] === '0' ? h[1] : h) - const minute = Number(i[0] === '0' ? i[1] : i) - const second = Number(s[0] === '0' ? s[1] : s) - return new Date(Date.UTC(year, month, day, hour, minute, second)) -} - -interface TestRecurring { - (m: string, testObj: any, expectedDates: Date | Date[]): void - only: (...args: any[]) => void - skip: (...args: any[]) => void -} - -export const testRecurring = function ( - msg: string, - testObj: any, - expectedDates: Date | Date[], - itFunc: TestFunction | ExclusiveTestFunction = it, -) { - let rule: any - let method: string - let args: any - - if (typeof testObj === 'function') { - testObj = testObj() - } - - if (testObj instanceof RRule || testObj instanceof RRuleSet) { - rule = testObj - method = 'all' - args = [] - } else { - rule = testObj.rrule - method = testObj.method - args = testObj.args - } - - // Use text and string representation of the rrule as the message. - if (rule instanceof RRule) { - msg = msg + ' [' + - (rule.isFullyConvertibleToText() ? rule.toText() : 'no text repr') + - ']' + ' [' + rule.toString() + ']' - } else { - msg = msg + ' ' + rule.toString() - } - - itFunc(msg, function () { - const ctx = this.test.ctx - let time = Date.now() - let actualDates = rule[method].apply(rule, args) - time = Date.now() - time - - const maxTestDuration = 200 - expect(time).to.be.lessThan(maxTestDuration, - `${rule}\' method "${method}" should finish in ${maxTestDuration} ms, but took ${time} ms`) - - if (!(actualDates instanceof Array)) actualDates = [actualDates] - if (!(expectedDates instanceof Array)) expectedDates = [expectedDates] - - assertDatesEqual(actualDates, expectedDates) - - // Additional tests using the expected dates - // ========================================================== - - if (ctx.ALSO_TEST_SUBSECOND_PRECISION) { - expect(actualDates.map(extractTime)).to.deep.equal(expectedDates.map(extractTime)) - } - - if (ctx.ALSO_TEST_STRING_FUNCTIONS) { - // Test toString()/fromString() - const str = rule.toString() - const rrule2 = RRule.fromString(str) - const string2 = rrule2.toString() - expect(str).to.equal(string2, 'toString() == fromString(toString()).toString()') - if (method === 'all') { - assertDatesEqual(rrule2.all(), expectedDates, 'fromString().all()') - } - } - - if (ctx.ALSO_TEST_NLP_FUNCTIONS && rule.isFullyConvertibleToText && rule.isFullyConvertibleToText()) { - // Test fromText()/toText(). - const str = rule.toString() - const text = rule.toText() - const rrule2 = RRule.fromText(text, rule.options.dtstart) - const text2 = rrule2.toText() - expect(text2).to.equal(text, 'toText() == fromText(toText()).toText()') - - // Test fromText()/toString(). - const rrule3 = RRule.fromText(text, rule.options.dtstart) - expect(rrule3.toString()).to.equal(str, 'toString() == fromText(toText()).toString()') - } - - if (method === 'all' && ctx.ALSO_TEST_BEFORE_AFTER_BETWEEN) { - // Test before, after, and between - use the expected dates. - // create a clean copy of the rrule object to bypass caching - rule = rule.clone() - - if (expectedDates.length > 2) { - // Test between() - assertDatesEqual( - rule.between( - expectedDates[0], - expectedDates[expectedDates.length - 1], - true - ), - expectedDates, - 'between, inc=true' - ) - - assertDatesEqual( - rule.between( - expectedDates[0], - expectedDates[expectedDates.length - 1], - false - ), - expectedDates.slice(1, expectedDates.length - 1), - 'between, inc=false' - ) - } - - if (expectedDates.length > 1) { - let date - let next - let prev - for (let i = 0; i < expectedDates.length; i++) { - date = expectedDates[i] - next = expectedDates[i + 1] - prev = expectedDates[i - 1] - - // Test after() and before() with inc=true. - assertDatesEqual(rule.after(date, true), date, 'after, inc=true') - assertDatesEqual(rule.before(date, true), date, 'before, inc=true') - - // Test after() and before() with inc=false. - next && assertDatesEqual(rule.after(date, false), next, 'after, inc=false') - prev && assertDatesEqual(rule.before(date, false), prev, 'before, inc=false') - } - } - } - }) -} as TestRecurring - -testRecurring.only = function (...args) { - testRecurring.apply(it, [...args, it.only]) -} - -testRecurring.skip = function () { - it.skip.apply(it, arguments) -} - -export function expectedDate(startDate: DateTime, currentLocalDate: DateTime, targetZone: string): Date { - const targetOffset = startDate.setZone(targetZone).offset - const { zoneName: systemZone } = currentLocalDate - const { - offset: systemOffset, - } = startDate.setZone(systemZone) - - const netOffset = targetOffset - systemOffset - const hours = -((netOffset / 60) % 24) - const minutes = -(netOffset % 60) - return startDate.plus({ hours, minutes }).toJSDate() -} diff --git a/test/mocha.opts b/test/mocha.opts deleted file mode 100644 index d30c6eea..00000000 --- a/test/mocha.opts +++ /dev/null @@ -1,2 +0,0 @@ ---require ts-node/register ---require source-map-support/register \ No newline at end of file diff --git a/test/nlp.test.ts b/test/nlp.test.ts deleted file mode 100644 index d53c6785..00000000 --- a/test/nlp.test.ts +++ /dev/null @@ -1,113 +0,0 @@ -import { expect } from 'chai' -import { DateTime } from 'luxon' -import RRule from '../src'; -import { optionsToString } from '../src/optionstostring'; -import {DateFormatter} from '../src/nlp/totext' - -const texts = [ - ['Every day', 'RRULE:FREQ=DAILY'], - ['Every day at 10, 12 and 17', 'RRULE:FREQ=DAILY;BYHOUR=10,12,17'], - ['Every week', 'RRULE:FREQ=WEEKLY'], - ['Every hour', 'RRULE:FREQ=HOURLY'], - ['Every 4 hours', 'RRULE:INTERVAL=4;FREQ=HOURLY'], - ['Every week on Tuesday', 'RRULE:FREQ=WEEKLY;BYDAY=TU'], - ['Every week on Monday, Wednesday', 'RRULE:FREQ=WEEKLY;BYDAY=MO,WE'], - ['Every weekday', 'RRULE:FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR'], - ['Every 2 weeks', 'RRULE:INTERVAL=2;FREQ=WEEKLY'], - ['Every month', 'RRULE:FREQ=MONTHLY'], - ['Every 6 months', 'RRULE:INTERVAL=6;FREQ=MONTHLY'], - ['Every year', 'RRULE:FREQ=YEARLY'], - ['Every year on the 1st Friday', 'RRULE:FREQ=YEARLY;BYDAY=+1FR'], - ['Every year on the 13th Friday', 'RRULE:FREQ=YEARLY;BYDAY=+13FR'], - ['Every month on the 4th', 'RRULE:FREQ=MONTHLY;BYMONTHDAY=4'], - ['Every month on the 4th last', 'RRULE:FREQ=MONTHLY;BYMONTHDAY=-4'], - ['Every month on the 3rd Tuesday', 'RRULE:FREQ=MONTHLY;BYDAY=+3TU'], - ['Every month on the 3rd last Tuesday', 'RRULE:FREQ=MONTHLY;BYDAY=-3TU'], - ['Every month on the last Monday', 'RRULE:FREQ=MONTHLY;BYDAY=-1MO'], - ['Every month on the 2nd last Friday', 'RRULE:FREQ=MONTHLY;BYDAY=-2FR'], - // ['Every week until January 1, 2007', 'RRULE:FREQ=WEEKLY;UNTIL=20070101T080000Z'], - ['Every week for 20 times', 'RRULE:FREQ=WEEKLY;COUNT=20'] -] - -describe('NLP', () => { - it('fromText()', function () { - texts.forEach(function (item) { - const text = item[0] - const str = item[1] - expect(RRule.fromText(text).toString()).equals(str, text + ' => ' + str) - }) - }) - - it('toText()', function () { - texts.forEach(function (item) { - const text = item[0] - const str = item[1] - expect(RRule.fromString(str).toText().toLowerCase()).equals(text.toLowerCase(), - str + ' => ' + text) - }) - }) - - it('parseText()', function () { - texts.forEach(function (item) { - const text = item[0] - const str = item[1] - expect(optionsToString(RRule.parseText(text))).equals(str, text + ' => ' + str) - }) - }) - - it('permits integers in byweekday (#153)', () => { - const rrule = new RRule({ - freq: RRule.WEEKLY, - byweekday: 0 - }) - - expect(rrule.toText()).to.equal('every week on Monday') - expect(rrule.toString()).to.equal('RRULE:FREQ=WEEKLY;BYDAY=MO') - }) - - it('sorts monthdays correctly (#101)', () => { - const options = { "freq": 2, "bymonthday": [3, 10, 17, 24] } - const rule = new RRule(options) - expect(rule.toText()).to.equal('every week on the 3rd, 10th, 17th and 24th') - }) - - it('shows correct text for every day', () => { - const options = { "freq": RRule.WEEKLY, byweekday: [ - RRule.MO, RRule.TU, RRule.WE, RRule.TH, RRule.FR, RRule.SA, RRule.SU - ]} - const rule = new RRule(options) - expect(rule.toText()).to.equal('every day') - }) - - it('shows correct text for every minute', () => { - const options = { 'freq': RRule.MINUTELY }; - const rule = new RRule(options); - expect(rule.toText()).to.equal('every minute'); - }); - - it('shows correct text for every (plural) minutes', () => { - const options = { 'freq': RRule.MINUTELY, 'interval': 2 }; - const rule = new RRule(options); - expect(rule.toText()).to.equal('every 2 minutes'); - }); - - it('by default formats \'until\' correctly', () => { - const rrule = new RRule({ - freq: RRule.WEEKLY, - until: DateTime.utc(2012, 11, 10).toJSDate() - }) - - expect(rrule.toText()).to.equal('every week until November 10, 2012') - }) - - it('formats \'until\' as desired if asked', () => { - const rrule = new RRule({ - freq: RRule.WEEKLY, - until: DateTime.utc(2012, 11, 10).toJSDate() - }) - - const dateFormatter: DateFormatter = (year, month, day) => `${day}. ${month}, ${year}` - - expect(rrule.toText(undefined, undefined, dateFormatter)).to.equal('every week until 10. November, 2012') - }) -}) \ No newline at end of file diff --git a/test/optionstostring.test.ts b/test/optionstostring.test.ts deleted file mode 100644 index 4eb5e94e..00000000 --- a/test/optionstostring.test.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { Options } from "../src/types"; -import RRule from "../src/rrule"; -import { optionsToString } from "../src/optionstostring"; -import { expect } from "chai"; - -describe('optionsToString', () => { - it('serializes valid single lines of rrules', function () { - const expectations: ([ Partial, string ][]) = [ - [{ freq: RRule.WEEKLY, until: new Date(Date.UTC(2010, 0, 1, 0, 0, 0)) }, 'RRULE:FREQ=WEEKLY;UNTIL=20100101T000000Z' ], - [{ dtstart: new Date(Date.UTC(1997, 8, 2, 9, 0, 0)), tzid: 'America/New_York' }, 'DTSTART;TZID=America/New_York:19970902T090000' ], - [ - { dtstart: new Date(Date.UTC(1997, 8, 2, 9, 0, 0)), freq: RRule.WEEKLY }, - 'DTSTART:19970902T090000Z\n' + - 'RRULE:FREQ=WEEKLY' - ], - [ - { dtstart: new Date(Date.UTC(1997, 8, 2, 9, 0, 0)), tzid: 'America/New_York', freq: RRule.WEEKLY }, - 'DTSTART;TZID=America/New_York:19970902T090000\n' + - 'RRULE:FREQ=WEEKLY' - ] - ] - - expectations.forEach(function (item) { - const s = item[0] - const s2 = item[1] - expect(optionsToString(s), JSON.stringify(s)).to.deep.equal(s2) - }) - }) -}) diff --git a/test/parseoptions.test.ts b/test/parseoptions.test.ts deleted file mode 100644 index d4326513..00000000 --- a/test/parseoptions.test.ts +++ /dev/null @@ -1,48 +0,0 @@ -import { parseOptions } from '../src/parseoptions' -import { expect } from 'chai' -import RRule from '../src' - -describe('TZID', () => { - it('leaves null when null', () => { - const options = parseOptions({ tzid: null }) - // tslint:disable-next-line:no-unused-expression - expect(options.parsedOptions.tzid).to.be.null - }) - - it('uses a string when passed in', () => { - const options = parseOptions({ tzid: 'America/Los_Angeles' }) - expect(options.parsedOptions.tzid).to.equal('America/Los_Angeles') - }) -}) - -describe('byweekday', () => { - it('works with a single numeric day', () => { - const options = parseOptions({ byweekday: 1 }) - expect(options.parsedOptions.byweekday).to.eql([1]) - }) - - it('works with a single Weekday day', () => { - const options = parseOptions({ byweekday: RRule.TU }) - expect(options.parsedOptions.byweekday).to.eql([1]) - }) - - it('works with a single string day', () => { - const options = parseOptions({ byweekday: 'TU' }) - expect(options.parsedOptions.byweekday).to.eql([1]) - }) - - it('works with a multiple numeric days', () => { - const options = parseOptions({ byweekday: [1, 2] }) - expect(options.parsedOptions.byweekday).to.eql([1, 2]) - }) - - it('works with a multiple Weekday days', () => { - const options = parseOptions({ byweekday: [RRule.TU, RRule.WE] }) - expect(options.parsedOptions.byweekday).to.eql([1, 2]) - }) - - it('works with a multiple string days', () => { - const options = parseOptions({ byweekday: ['TU', 'WE'] }) - expect(options.parsedOptions.byweekday).to.eql([1, 2]) - }) -}) diff --git a/test/parsestring.test.ts b/test/parsestring.test.ts deleted file mode 100644 index ade2397e..00000000 --- a/test/parsestring.test.ts +++ /dev/null @@ -1,68 +0,0 @@ -import RRule from '../src/rrule' -import { expect } from 'chai' -import { parseString } from '../src/parsestring' -import { Options, Frequency } from '../src/types'; - -describe('parseString', () => { - it('parses valid single lines of rrules', function () { - const expectations: ([ string, Partial][]) = [ - ['FREQ=WEEKLY;UNTIL=20100101T000000Z', { freq: RRule.WEEKLY, until: new Date(Date.UTC(2010, 0, 1, 0, 0, 0)) }], - - // Parse also `date` but return `date-time` - ['FREQ=WEEKLY;UNTIL=20100101', { freq: RRule.WEEKLY, until: new Date(Date.UTC(2010, 0, 1, 0, 0, 0)) }], - ['DTSTART;TZID=America/New_York:19970902T090000', { dtstart: new Date(Date.UTC(1997, 8, 2, 9, 0, 0)), tzid: 'America/New_York' }], - ['RRULE:DTSTART;TZID=America/New_York:19970902T090000', { dtstart: new Date(Date.UTC(1997, 8, 2, 9, 0, 0)), tzid: 'America/New_York' }] - ] - - expectations.forEach(function (item) { - const s = item[0] - const s2 = item[1] - expect(parseString(s), s).to.deep.equal(s2) - }) - }) - - it('parses multiline rules', () => { - const expectations: ([ string, Partial][]) = [ - [ - 'DTSTART;TZID=America/New_York:19970902T090000\nRRULE:FREQ=WEEKLY;UNTIL=20100101T000000Z', - { - dtstart: new Date(Date.UTC(1997, 8, 2, 9, 0, 0)), - tzid: 'America/New_York', - freq: RRule.WEEKLY, - until: new Date(Date.UTC(2010, 0, 1, 0, 0, 0)) - } - ], - [ - 'DTSTART:19970902T090000Z\n' + - 'RRULE:FREQ=YEARLY;COUNT=3\n', - { - dtstart: new Date(Date.UTC(1997, 8, 2, 9, 0, 0)), - freq: RRule.YEARLY, - count: 3 - } - ] - ] - - expectations.forEach(function (item) { - const s = item[0] - const s2 = item[1] - expect(parseString(s), s).to.deep.equal(s2) - }) - }) - - it('parses legacy dtstart in rrule', () => { - const expectations: ([ string, Partial][]) = [ - ['RRULE:FREQ=WEEKLY;DTSTART;TZID=America/New_York:19970902T090000', { - freq: Frequency.WEEKLY, - dtstart: new Date(Date.UTC(1997, 8, 2, 9, 0, 0)), - tzid: 'America/New_York' - }] - ] - - expectations.forEach(function (item) { - const s = item[0] - const s2 = item[1] - expect(parseString(s), s).to.deep.equal(s2) - }) - }) -}) diff --git a/test/rrule.test.ts b/test/rrule.test.ts deleted file mode 100644 index dbf90411..00000000 --- a/test/rrule.test.ts +++ /dev/null @@ -1,3735 +0,0 @@ -import { parse, datetime, testRecurring, expectedDate } from './lib/utils' -import { expect } from 'chai' -import { RRule, rrulestr, Frequency } from '../src/index' -import { DateTime } from 'luxon' -import { set as setMockDate, reset as resetMockDate } from 'mockdate' -import { optionsToString } from '../src/optionstostring'; - -describe('RRule', function () { - // Enable additional toString() / fromString() tests - // for each testRecurring(). - this.ctx.ALSO_TEST_STRING_FUNCTIONS = true - - // Enable additional toText() / fromText() tests - // for each testRecurring(). - // Many of the tests fail because the conversion is only approximate, - // but it gives an idea about how well or bad it converts. - this.ctx.ALSO_TEST_NLP_FUNCTIONS = false - - // Thorough after()/before()/between() tests. - // NOTE: can take a longer time. - this.ctx.ALSO_TEST_BEFORE_AFTER_BETWEEN = true - - this.ctx.ALSO_TEST_SUBSECOND_PRECISION = true - - it('rrulestr https://github.com/jkbrzt/rrule/pull/164', function () { - const s1 = 'RRULE:FREQ=WEEKLY;WKST=WE' - const s2 = rrulestr(s1).toString() - expect(s1).equals(s2, s1 + ' => ' + s2) - }) - - it('rrulestr itteration not infinite when interval 0', function () { - ['FREQ=YEARLY;INTERVAL=0;BYSETPOS=1;BYDAY=MO', - 'FREQ=MONTHLY;INTERVAL=0;BYSETPOS=1;BYDAY=MO', - 'FREQ=DAILY;INTERVAL=0;BYSETPOS=1;BYDAY=MO', - 'FREQ=HOURLY;INTERVAL=0;BYSETPOS=1;BYDAY=MO', - 'FREQ=MINUTELY;INTERVAL=0;BYSETPOS=1;BYDAY=MO', - 'FREQ=SECONDLY;INTERVAL=0;BYSETPOS=1;BYDAY=MO'] - .map((s) => expect(rrulestr(s).count()).to.equal(0)) - }) - - it('does not mutate the passed-in options object', function () { - const options = { - freq: RRule.MONTHLY, - dtstart: new Date(2013, 0, 1), - count: 3, - bymonthday: [28] - } - const rule = new RRule(options) - - expect(options).deep.equals({ - freq: RRule.MONTHLY, - dtstart: new Date(2013, 0, 1), - count: 3, - bymonthday: [28] - }) - expect(rule.origOptions).deep.equals(options) - }) - - testRecurring('missing Feb 28 https://github.com/jakubroztocil/rrule/issues/21', - new RRule({ - freq: RRule.MONTHLY, - dtstart: new Date(Date.UTC(2013, 0, 1)), - count: 3, - bymonthday: [28] - }), - [ - new Date(Date.UTC(2013, 0, 28)), - new Date(Date.UTC(2013, 1, 28)), - new Date(Date.UTC(2013, 2, 28)) - ] - ) - - // ============================================================================= - // The original `dateutil.rrule` test suite converted from Py to JS. - // ============================================================================= - - testRecurring('testBefore', - { - rrule: new RRule({ - freq: RRule.DAILY, - dtstart: parse('19970902T090000') - }), - method: 'before', - args: [parse('19970905T090000')] - }, - datetime(1997, 9, 4, 9, 0) - ) - - testRecurring('testBeforeInc', - { - rrule: new RRule({ - freq: RRule.DAILY, - dtstart: parse('19970902T090000') - }), - method: 'before', - args: [parse('19970905T090000'), true] - }, - datetime(1997, 9, 5, 9, 0) - ) - - testRecurring('testAfter', - { - rrule: new RRule({ - freq: RRule.DAILY, - dtstart: parse('19970902T090000') - }), - method: 'after', - args: [parse('19970904T090000')] - }, - datetime(1997, 9, 5, 9, 0) - ) - - testRecurring('testAfterInc', - { - rrule: new RRule({ - freq: RRule.DAILY, - dtstart: parse('19970902T090000') - }), - method: 'after', - args: [parse('19970904T090000'), true] - }, - datetime(1997, 9, 4, 9, 0) - ) - - testRecurring('testBetween', - { - rrule: new RRule({ - freq: RRule.DAILY, - dtstart: parse('19970902T090000') - }), - method: 'between', - args: [parse('19970902T090000'), parse('19970906T090000')] - }, - [ - datetime(1997, 9, 3, 9, 0), - datetime(1997, 9, 4, 9, 0), - datetime(1997, 9, 5, 9, 0) - ] - ) - - testRecurring('testBetweenInc', - { - rrule: new RRule({ - freq: RRule.DAILY, - dtstart: parse('19970902T090000') - }), - method: 'between', - args: [parse('19970902T090000'), parse('19970906T090000'), true] - }, - [ - datetime(1997, 9, 2, 9, 0), - datetime(1997, 9, 3, 9, 0), - datetime(1997, 9, 4, 9, 0), - datetime(1997, 9, 5, 9, 0), - datetime(1997, 9, 6, 9, 0) - ] - ) - - testRecurring('testYearly', - new RRule({ - freq: RRule.YEARLY, - count: 3, - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 9, 2, 9, 0), - datetime(1998, 9, 2, 9, 0), - datetime(1999, 9, 2, 9, 0) - ] - ) - - testRecurring('testYearlyInterval', - new RRule({freq: RRule.YEARLY, - count: 3, - interval: 2, - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 9, 2, 9, 0), - datetime(1999, 9, 2, 9, 0), - datetime(2001, 9, 2, 9, 0) - ] - ) - - testRecurring('testYearlyIntervalLarge', - new RRule({freq: RRule.YEARLY, - count: 3, - interval: 100, - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 9, 2, 9, 0), - datetime(2097, 9, 2, 9, 0), - datetime(2197, 9, 2, 9, 0) - ] - ) - - testRecurring('testYearlyByMonth', - new RRule({freq: RRule.YEARLY, - count: 3, - bymonth: [1, 3], - dtstart: parse('19970902T090000') - }), - [ - datetime(1998, 1, 2, 9, 0), - datetime(1998, 3, 2, 9, 0), - datetime(1999, 1, 2, 9, 0) - ] - ) - - testRecurring('testYearlyByMonthDay', - new RRule({freq: RRule.YEARLY, - count: 3, - bymonthday: [1, 3], - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 9, 3, 9, 0), - datetime(1997, 10, 1, 9, 0), - datetime(1997, 10, 3, 9, 0) - ] - ) - - testRecurring('testYearlyByMonthAndMonthDay', - new RRule({freq: RRule.YEARLY, - count: 3, - bymonth: [1, 3], - bymonthday: [5, 7], - dtstart: parse('19970902T090000') - }), - [ - datetime(1998, 1, 5, 9, 0), - datetime(1998, 1, 7, 9, 0), - datetime(1998, 3, 5, 9, 0) - ] - ) - - testRecurring('testYearlyByWeekDay', - new RRule({freq: RRule.YEARLY, - count: 3, - byweekday: [RRule.TU, RRule.TH], - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 9, 2, 9, 0), - datetime(1997, 9, 4, 9, 0), - datetime(1997, 9, 9, 9, 0) - ] - ) - - testRecurring('testYearlyByNWeekDay', - new RRule({freq: RRule.YEARLY, - count: 3, - byweekday: [RRule.TU.nth(1), RRule.TH.nth(-1)], - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 12, 25, 9, 0), - datetime(1998, 1, 6, 9, 0), - datetime(1998, 12, 31, 9, 0) - ] - ) - - testRecurring('testYearlyByNWeekDayLarge', - new RRule({freq: RRule.YEARLY, - count: 3, - byweekday: [RRule.TU.nth(13), RRule.TH.nth(-13)], - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 10, 2, 9, 0), - datetime(1998, 3, 31, 9, 0), - datetime(1998, 10, 8, 9, 0) - ] - ) - - testRecurring('testYearlyByMonthAndWeekDay', - new RRule({freq: RRule.YEARLY, - count: 3, - bymonth: [1, 3], - byweekday: [RRule.TU, RRule.TH], - dtstart: parse('19970902T090000') - }), - [ - datetime(1998, 1, 1, 9, 0), - datetime(1998, 1, 6, 9, 0), - datetime(1998, 1, 8, 9, 0) - ] - ) - - testRecurring('testYearlyByMonthAndNWeekDay', - new RRule({freq: RRule.YEARLY, - count: 3, - bymonth: [1, 3], - byweekday: [RRule.TU.nth(1), RRule.TH.nth(-1)], - dtstart: parse('19970902T090000') - }), - [ - datetime(1998, 1, 6, 9, 0), - datetime(1998, 1, 29, 9, 0), - datetime(1998, 3, 3, 9, 0) - ] - ) - - testRecurring('testYearlyByMonthAndNWeekDayLarge', - new RRule({freq: RRule.YEARLY, - count: 3, - bymonth: [1, 3], - byweekday: [RRule.TU.nth(3), RRule.TH.nth(-3)], - dtstart: parse('19970902T090000') - }), - [ - datetime(1998, 1, 15, 9, 0), - datetime(1998, 1, 20, 9, 0), - datetime(1998, 3, 12, 9, 0) - ] - ) - - testRecurring('testYearlyByMonthDayAndWeekDay', - new RRule({freq: RRule.YEARLY, - count: 3, - bymonthday: [1, 3], - byweekday: [RRule.TU, RRule.TH], - dtstart: parse('19970902T090000') - }), - [ - datetime(1998, 1, 1, 9, 0), - datetime(1998, 2, 3, 9, 0), - datetime(1998, 3, 3, 9, 0) - ] - ) - - testRecurring('testYearlyByMonthAndMonthDayAndWeekDay', - new RRule({freq: RRule.YEARLY, - count: 3, - bymonth: [1, 3], - bymonthday: [1, 3], - byweekday: [RRule.TU, RRule.TH], - dtstart: parse('19970902T090000') - }), - [ - datetime(1998, 1, 1, 9, 0), - datetime(1998, 3, 3, 9, 0), - datetime(2001, 3, 1, 9, 0) - ] - ) - - testRecurring('testYearlyByYearDay', - new RRule({freq: RRule.YEARLY, - count: 4, - byyearday: [1, 100, 200, 365], - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 12, 31, 9, 0), - datetime(1998, 1, 1, 9, 0), - datetime(1998, 4, 10, 9, 0), - datetime(1998, 7, 19, 9, 0) - ] - ) - - testRecurring('testYearlyByYearDayNeg', - new RRule({freq: RRule.YEARLY, - count: 4, - byyearday: [-365, -266, -166, -1], - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 12, 31, 9, 0), - datetime(1998, 1, 1, 9, 0), - datetime(1998, 4, 10, 9, 0), - datetime(1998, 7, 19, 9, 0) - ] - ) - - testRecurring('testYearlyByMonthAndYearDay', - new RRule({freq: RRule.YEARLY, - count: 4, - bymonth: [4, 7], - byyearday: [1, 100, 200, 365], - dtstart: parse('19970902T090000') - }), - [ - datetime(1998, 4, 10, 9, 0), - datetime(1998, 7, 19, 9, 0), - datetime(1999, 4, 10, 9, 0), - datetime(1999, 7, 19, 9, 0) - ] - ) - - testRecurring('testYearlyByMonthAndYearDayNeg', - new RRule({freq: RRule.YEARLY, - count: 4, - bymonth: [4, 7], - byyearday: [-365, -266, -166, -1], - dtstart: parse('19970902T090000') - }), - [ - datetime(1998, 4, 10, 9, 0), - datetime(1998, 7, 19, 9, 0), - datetime(1999, 4, 10, 9, 0), - datetime(1999, 7, 19, 9, 0) - ] - ) - - testRecurring('testYearlyByWeekNo', - new RRule({freq: RRule.YEARLY, - count: 3, - byweekno: 20, - dtstart: parse('19970902T090000') - }), - [ - datetime(1998, 5, 11, 9, 0), - datetime(1998, 5, 12, 9, 0), - datetime(1998, 5, 13, 9, 0) - ] - ) - - testRecurring('testYearlyByWeekNoAndWeekDay', - // That's a nice one. The first days of week number one - // may be in the last year. - new RRule({freq: RRule.YEARLY, - count: 3, - byweekno: 1, - byweekday: RRule.MO, - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 12, 29, 9, 0), - datetime(1999, 1, 4, 9, 0), - datetime(2000, 1, 3, 9, 0) - ] - ) - - testRecurring('testYearlyByWeekNoAndWeekDayLarge', - // Another nice test. The last days of week number 52/53 - // may be in the next year. - new RRule({freq: RRule.YEARLY, - count: 3, - byweekno: 52, - byweekday: RRule.SU, - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 12, 28, 9, 0), - datetime(1998, 12, 27, 9, 0), - datetime(2000, 1, 2, 9, 0) - ] - ) - - testRecurring('testYearlyByWeekNoAndWeekDayLast', - new RRule({freq: RRule.YEARLY, - count: 3, - byweekno: -1, - byweekday: RRule.SU, - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 12, 28, 9, 0), - datetime(1999, 1, 3, 9, 0), - datetime(2000, 1, 2, 9, 0) - ] - ) - - testRecurring('testYearlyByEaster', - new RRule({ count: 3, - byeaster: 0, - dtstart: parse('19970902T090000') - }), - [ - datetime(1998, 4, 12, 9, 0), - datetime(1999, 4, 4, 9, 0), - datetime(2000, 4, 23, 9, 0) - ] - ) - - testRecurring('testYearlyByEasterPos', - new RRule({freq: RRule.YEARLY, - count: 3, - byeaster: 1, - dtstart: parse('19970902T090000') - }), - [ - datetime(1998, 4, 13, 9, 0), - datetime(1999, 4, 5, 9, 0), - datetime(2000, 4, 24, 9, 0) - ] - ) - - testRecurring('testYearlyByEasterNeg', - new RRule({freq: RRule.YEARLY, - count: 3, - byeaster: -1, - dtstart: parse('19970902T090000') - }), - [ - datetime(1998, 4, 11, 9, 0), - datetime(1999, 4, 3, 9, 0), - datetime(2000, 4, 22, 9, 0) - ] - ) - - testRecurring('testYearlyByWeekNoAndWeekDay53', - new RRule({freq: RRule.YEARLY, - count: 3, - byweekno: 53, - byweekday: RRule.MO, - dtstart: parse('19970902T090000') - }), - [ - datetime(1998, 12, 28, 9, 0), - datetime(2004, 12, 27, 9, 0), - datetime(2009, 12, 28, 9, 0) - ] - ) - - testRecurring('testYearlyByHour', - new RRule({freq: RRule.YEARLY, - count: 3, - byhour: [6, 18], - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 9, 2, 18, 0), - datetime(1998, 9, 2, 6, 0), - datetime(1998, 9, 2, 18, 0) - ] - ) - - testRecurring('testYearlyByMinute', - new RRule({freq: RRule.YEARLY, - count: 3, - byminute: [6, 18], - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 9, 2, 9, 6), - datetime(1997, 9, 2, 9, 18), - datetime(1998, 9, 2, 9, 6) - ] - ) - - testRecurring('testYearlyBySecond', - new RRule({freq: RRule.YEARLY, - count: 3, - bysecond: [6, 18], - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 9, 2, 9, 0, 6), - datetime(1997, 9, 2, 9, 0, 18), - datetime(1998, 9, 2, 9, 0, 6) - ] - ) - - testRecurring('testYearlyByHourAndMinute', - new RRule({freq: RRule.YEARLY, - count: 3, - byhour: [6, 18], - byminute: [6, 18], - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 9, 2, 18, 6), - datetime(1997, 9, 2, 18, 18), - datetime(1998, 9, 2, 6, 6) - ] - ) - - testRecurring('testYearlyByHourAndSecond', - new RRule({freq: RRule.YEARLY, - count: 3, - byhour: [6, 18], - bysecond: [6, 18], - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 9, 2, 18, 0, 6), - datetime(1997, 9, 2, 18, 0, 18), - datetime(1998, 9, 2, 6, 0, 6) - ] - ) - - testRecurring('testYearlyByMinuteAndSecond', - new RRule({freq: RRule.YEARLY, - count: 3, - byminute: [6, 18], - bysecond: [6, 18], - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 9, 2, 9, 6, 6), - datetime(1997, 9, 2, 9, 6, 18), - datetime(1997, 9, 2, 9, 18, 6) - ] - ) - - testRecurring('testYearlyByHourAndMinuteAndSecond', - new RRule({freq: RRule.YEARLY, - count: 3, - byhour: [6, 18], - byminute: [6, 18], - bysecond: [6, 18], - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 9, 2, 18, 6, 6), - datetime(1997, 9, 2, 18, 6, 18), - datetime(1997, 9, 2, 18, 18, 6) - ] - ) - - testRecurring('testYearlyBySetPos', - new RRule({freq: RRule.YEARLY, - count: 3, - bymonthday: 15, - byhour: [6, 18], - bysetpos: [3, -3], - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 11, 15, 18, 0), - datetime(1998, 2, 15, 6, 0), - datetime(1998, 11, 15, 18, 0) - ] - ) - - testRecurring('testYearlyBetweenInc', - { - rrule: new RRule({ - freq: RRule.YEARLY, - dtstart: parse('20150101T000000') - }), - method: 'between', - args: [parse('20160101T000000'), parse('20160101T000000'), true] - }, - [ - datetime(2016, 1, 1) - ] - ) - - testRecurring('testYearlyBetweenIncLargeSpan', - { - rrule: new RRule({ - freq: RRule.YEARLY, - dtstart: parse('19200101T000000') // Error because date lower than dateutil.ORDINAL_BASE - }), - method: 'between', - args: [parse('20160101T000000'), parse('20160101T000000'), true] - }, - [ - datetime(2016, 1, 1) - ] - ) - - testRecurring('testMonthly', - new RRule({freq: RRule.MONTHLY, - count: 3, - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 9, 2, 9, 0), - datetime(1997, 10, 2, 9, 0), - datetime(1997, 11, 2, 9, 0) - ] - ) - - testRecurring('testMonthlyInterval', - new RRule({freq: RRule.MONTHLY, - count: 3, - interval: 2, - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 9, 2, 9, 0), - datetime(1997, 11, 2, 9, 0), - datetime(1998, 1, 2, 9, 0) - ] - ) - - testRecurring('testMonthlyIntervalLarge', - new RRule({freq: RRule.MONTHLY, - count: 3, - interval: 18, - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 9, 2, 9, 0), - datetime(1999, 3, 2, 9, 0), - datetime(2000, 9, 2, 9, 0) - ] - ) - - testRecurring('testMonthlyByMonth', - new RRule({freq: RRule.MONTHLY, - count: 3, - bymonth: [1, 3], - dtstart: parse('19970902T090000') - }), - [ - datetime(1998, 1, 2, 9, 0), - datetime(1998, 3, 2, 9, 0), - datetime(1999, 1, 2, 9, 0) - ] - ) - - testRecurring('testMonthlyByMonthDay', - new RRule({freq: RRule.MONTHLY, - count: 3, - bymonthday: [1, 3], - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 9, 3, 9, 0), - datetime(1997, 10, 1, 9, 0), - datetime(1997, 10, 3, 9, 0) - ] - ) - - testRecurring('testMonthlyByMonthAndMonthDay', - new RRule({freq: RRule.MONTHLY, - count: 3, - bymonth: [1, 3], - bymonthday: [5, 7], - dtstart: parse('19970902T090000') - }), - [ - datetime(1998, 1, 5, 9, 0), - datetime(1998, 1, 7, 9, 0), - datetime(1998, 3, 5, 9, 0) - ] - ) - - testRecurring('testMonthlyByWeekDay', - new RRule({freq: RRule.MONTHLY, - count: 3, - byweekday: [RRule.TU, RRule.TH], - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 9, 2, 9, 0), - datetime(1997, 9, 4, 9, 0), - datetime(1997, 9, 9, 9, 0) - ] - ) - - testRecurring('testMonthlyByNWeekDay', - new RRule({freq: RRule.MONTHLY, - count: 3, - byweekday: [RRule.TU.nth(1), RRule.TH.nth(-1)], - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 9, 2, 9, 0), - datetime(1997, 9, 25, 9, 0), - datetime(1997, 10, 7, 9, 0) - ] - ) - - testRecurring('testMonthlyByNWeekDayLarge', - new RRule({freq: RRule.MONTHLY, - count: 3, - byweekday: [RRule.TU.nth(3), RRule.TH.nth(-3)], - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 9, 11, 9, 0), - datetime(1997, 9, 16, 9, 0), - datetime(1997, 10, 16, 9, 0) - ] - ) - - testRecurring('testMonthlyByMonthAndWeekDay', - new RRule({freq: RRule.MONTHLY, - count: 3, - bymonth: [1, 3], - byweekday: [RRule.TU, RRule.TH], - dtstart: parse('19970902T090000') - }), - [ - datetime(1998, 1, 1, 9, 0), - datetime(1998, 1, 6, 9, 0), - datetime(1998, 1, 8, 9, 0) - ] - ) - - testRecurring('testMonthlyByMonthAndNWeekDay', - new RRule({freq: RRule.MONTHLY, - count: 3, - bymonth: [1, 3], - byweekday: [RRule.TU.nth(1), RRule.TH.nth(-1)], - dtstart: parse('19970902T090000') - }), - [ - datetime(1998, 1, 6, 9, 0), - datetime(1998, 1, 29, 9, 0), - datetime(1998, 3, 3, 9, 0) - ] - ) - - testRecurring('testMonthlyByMonthAndNWeekDayLarge', - new RRule({freq: RRule.MONTHLY, - count: 3, - bymonth: [1, 3], - byweekday: [RRule.TU.nth(3), RRule.TH.nth(-3)], - dtstart: parse('19970902T090000') - }), - [ - datetime(1998, 1, 15, 9, 0), - datetime(1998, 1, 20, 9, 0), - datetime(1998, 3, 12, 9, 0) - ] - ) - - testRecurring('testMonthlyByMonthDayAndWeekDay', - new RRule({freq: RRule.MONTHLY, - count: 3, - bymonthday: [1, 3], - byweekday: [RRule.TU, RRule.TH], - dtstart: parse('19970902T090000') - }), - [ - datetime(1998, 1, 1, 9, 0), - datetime(1998, 2, 3, 9, 0), - datetime(1998, 3, 3, 9, 0) - ] - ) - - testRecurring('testMonthlyByMonthAndMonthDayAndWeekDay', - new RRule({freq: RRule.MONTHLY, - count: 3, - bymonth: [1, 3], - bymonthday: [1, 3], - byweekday: [RRule.TU, RRule.TH], - dtstart: parse('19970902T090000') - }), - [ - datetime(1998, 1, 1, 9, 0), - datetime(1998, 3, 3, 9, 0), - datetime(2001, 3, 1, 9, 0) - ] - ) - - testRecurring('testMonthlyByYearDay', - new RRule({freq: RRule.MONTHLY, - count: 4, - byyearday: [1, 100, 200, 365], - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 12, 31, 9, 0), - datetime(1998, 1, 1, 9, 0), - datetime(1998, 4, 10, 9, 0), - datetime(1998, 7, 19, 9, 0) - ] - ) - - testRecurring('testMonthlyByYearDayNeg', - new RRule({freq: RRule.MONTHLY, - count: 4, - byyearday: [-365, -266, -166, -1], - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 12, 31, 9, 0), - datetime(1998, 1, 1, 9, 0), - datetime(1998, 4, 10, 9, 0), - datetime(1998, 7, 19, 9, 0) - ] - ) - - testRecurring('testMonthlyByMonthAndYearDay', - new RRule({freq: RRule.MONTHLY, - count: 4, - bymonth: [4, 7], - byyearday: [1, 100, 200, 365], - dtstart: parse('19970902T090000') - }), - [ - datetime(1998, 4, 10, 9, 0), - datetime(1998, 7, 19, 9, 0), - datetime(1999, 4, 10, 9, 0), - datetime(1999, 7, 19, 9, 0) - ] - ) - - testRecurring('testMonthlyByMonthAndYearDayNeg', - new RRule({freq: RRule.MONTHLY, - count: 4, - bymonth: [4, 7], - byyearday: [-365, -266, -166, -1], - dtstart: parse('19970902T090000') - }), - [ - datetime(1998, 4, 10, 9, 0), - datetime(1998, 7, 19, 9, 0), - datetime(1999, 4, 10, 9, 0), - datetime(1999, 7, 19, 9, 0) - ] - ) - - testRecurring('testMonthlyByWeekNo', - new RRule({freq: RRule.MONTHLY, - count: 3, - byweekno: 20, - dtstart: parse('19970902T090000') - }), - [ - datetime(1998, 5, 11, 9, 0), - datetime(1998, 5, 12, 9, 0), - datetime(1998, 5, 13, 9, 0) - ] - ) - - testRecurring('testMonthlyByWeekNoAndWeekDay', - // That's a nice one. The first days of week number one - // may be in the last year. - new RRule({freq: RRule.MONTHLY, - count: 3, - byweekno: 1, - byweekday: RRule.MO, - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 12, 29, 9, 0), - datetime(1999, 1, 4, 9, 0), - datetime(2000, 1, 3, 9, 0) - ] - ) - - testRecurring('testMonthlyByWeekNoAndWeekDayLarge', - // Another nice test. The last days of week number 52/53 - // may be in the next year. - new RRule({freq: RRule.MONTHLY, - count: 3, - byweekno: 52, - byweekday: RRule.SU, - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 12, 28, 9, 0), - datetime(1998, 12, 27, 9, 0), - datetime(2000, 1, 2, 9, 0) - ] - ) - - testRecurring('testMonthlyByWeekNoAndWeekDayLast', - new RRule({freq: RRule.MONTHLY, - count: 3, - byweekno: -1, - byweekday: RRule.SU, - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 12, 28, 9, 0), - datetime(1999, 1, 3, 9, 0), - datetime(2000, 1, 2, 9, 0) - ] - ) - - testRecurring('testMonthlyByWeekNoAndWeekDay53', - new RRule({freq: RRule.MONTHLY, - count: 3, - byweekno: 53, - byweekday: RRule.MO, - dtstart: parse('19970902T090000') - }), - [ - datetime(1998, 12, 28, 9, 0), - datetime(2004, 12, 27, 9, 0), - datetime(2009, 12, 28, 9, 0) - ] - ) - - testRecurring('testMonthlyByEaster', - new RRule({freq: RRule.MONTHLY, - count: 3, - byeaster: 0, - dtstart: parse('19970902T090000') - }), - [ - datetime(1998, 4, 12, 9, 0), - datetime(1999, 4, 4, 9, 0), - datetime(2000, 4, 23, 9, 0) - ] - ) - - testRecurring('testMonthlyByEasterPos', - new RRule({freq: RRule.MONTHLY, - count: 3, - byeaster: 1, - dtstart: parse('19970902T090000') - }), - [ - datetime(1998, 4, 13, 9, 0), - datetime(1999, 4, 5, 9, 0), - datetime(2000, 4, 24, 9, 0) - ] - ) - - testRecurring('testMonthlyByEasterNeg', - new RRule({freq: RRule.MONTHLY, - count: 3, - byeaster: -1, - dtstart: parse('19970902T090000') - }), - [ - datetime(1998, 4, 11, 9, 0), - datetime(1999, 4, 3, 9, 0), - datetime(2000, 4, 22, 9, 0) - ] - ) - - testRecurring('testMonthlyByHour', - new RRule({freq: RRule.MONTHLY, - count: 3, - byhour: [6, 18], - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 9, 2, 18, 0), - datetime(1997, 10, 2, 6, 0), - datetime(1997, 10, 2, 18, 0) - ] - ) - - testRecurring('testMonthlyByMinute', - new RRule({freq: RRule.MONTHLY, - count: 3, - byminute: [6, 18], - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 9, 2, 9, 6), - datetime(1997, 9, 2, 9, 18), - datetime(1997, 10, 2, 9, 6) - ] - ) - - testRecurring('testMonthlyBySecond', - new RRule({freq: RRule.MONTHLY, - count: 3, - bysecond: [6, 18], - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 9, 2, 9, 0, 6), - datetime(1997, 9, 2, 9, 0, 18), - datetime(1997, 10, 2, 9, 0, 6) - ] - ) - - testRecurring('testMonthlyByHourAndMinute', - new RRule({freq: RRule.MONTHLY, - count: 3, - byhour: [6, 18], - byminute: [6, 18], - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 9, 2, 18, 6), - datetime(1997, 9, 2, 18, 18), - datetime(1997, 10, 2, 6, 6) - ] - ) - - testRecurring('testMonthlyByHourAndSecond', - new RRule({freq: RRule.MONTHLY, - count: 3, - byhour: [6, 18], - bysecond: [6, 18], - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 9, 2, 18, 0, 6), - datetime(1997, 9, 2, 18, 0, 18), - datetime(1997, 10, 2, 6, 0, 6) - ] - ) - - testRecurring('testMonthlyByMinuteAndSecond', - new RRule({freq: RRule.MONTHLY, - count: 3, - byminute: [6, 18], - bysecond: [6, 18], - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 9, 2, 9, 6, 6), - datetime(1997, 9, 2, 9, 6, 18), - datetime(1997, 9, 2, 9, 18, 6) - ] - ) - - testRecurring('testMonthlyByHourAndMinuteAndSecond', - new RRule({freq: RRule.MONTHLY, - count: 3, - byhour: [6, 18], - byminute: [6, 18], - bysecond: [6, 18], - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 9, 2, 18, 6, 6), - datetime(1997, 9, 2, 18, 6, 18), - datetime(1997, 9, 2, 18, 18, 6) - ] - ) - - testRecurring('testMonthlyBySetPos', - new RRule({freq: RRule.MONTHLY, - count: 3, - bymonthday: [13, 17], - byhour: [6, 18], - bysetpos: [3, -3], - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 9, 13, 18, 0), - datetime(1997, 9, 17, 6, 0), - datetime(1997, 10, 13, 18, 0) - ] - ) - - testRecurring('testMonthlyNegByMonthDayJanFebForNonLeapYear', - new RRule({freq: RRule.MONTHLY, - count: 4, - bymonthday: -1, - dtstart: parse('20131201T0900000') - }), - [ - datetime(2013, 12, 31, 9, 0), - datetime(2014, 1, 31, 9, 0), - datetime(2014, 2, 28, 9, 0), - datetime(2014, 3, 31, 9, 0) - ] - ) - - testRecurring('testMonthlyNegByMonthDayJanFebForLeapYear', - new RRule({freq: RRule.MONTHLY, - count: 4, - bymonthday: -1, - dtstart: parse('20151201T0900000') - }), - [ - datetime(2015, 12, 31, 9, 0), - datetime(2016, 1, 31, 9, 0), - datetime(2016, 2, 29, 9, 0), - datetime(2016, 3, 31, 9, 0) - ] - ) - - testRecurring('testWeekly', - new RRule({freq: RRule.WEEKLY, - count: 3, - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 9, 2, 9, 0), - datetime(1997, 9, 9, 9, 0), - datetime(1997, 9, 16, 9, 0) - ] - ) - - testRecurring('testWeeklyInterval', - new RRule({freq: RRule.WEEKLY, - count: 3, - interval: 2, - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 9, 2, 9, 0), - datetime(1997, 9, 16, 9, 0), - datetime(1997, 9, 30, 9, 0) - ] - ) - - testRecurring('testWeeklyIntervalLarge', - new RRule({freq: RRule.WEEKLY, - count: 3, - interval: 20, - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 9, 2, 9, 0), - datetime(1998, 1, 20, 9, 0), - datetime(1998, 6, 9, 9, 0) - ] - ) - - testRecurring('testWeeklyByMonth', - new RRule({freq: RRule.WEEKLY, - count: 3, - bymonth: [1, 3], - dtstart: parse('19970902T090000') - }), - [ - datetime(1998, 1, 6, 9, 0), - datetime(1998, 1, 13, 9, 0), - datetime(1998, 1, 20, 9, 0) - ] - ) - - testRecurring('testWeeklyByMonthDay', - new RRule({freq: RRule.WEEKLY, - count: 3, - bymonthday: [1, 3], - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 9, 3, 9, 0), - datetime(1997, 10, 1, 9, 0), - datetime(1997, 10, 3, 9, 0) - ] - ) - - testRecurring('testWeeklyByMonthAndMonthDay', - new RRule({freq: RRule.WEEKLY, - count: 3, - bymonth: [1, 3], - bymonthday: [5, 7], - dtstart: parse('19970902T090000') - }), - [ - datetime(1998, 1, 5, 9, 0), - datetime(1998, 1, 7, 9, 0), - datetime(1998, 3, 5, 9, 0) - ] - ) - - testRecurring('testWeeklyByWeekDay', - new RRule({freq: RRule.WEEKLY, - count: 3, - byweekday: [RRule.TU, RRule.TH], - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 9, 2, 9, 0), - datetime(1997, 9, 4, 9, 0), - datetime(1997, 9, 9, 9, 0) - ] - ) - - testRecurring('testWeeklyByNWeekDay', - new RRule({freq: RRule.WEEKLY, - count: 3, - byweekday: [RRule.TU.nth(1), RRule.TH.nth(-1)], - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 9, 2, 9, 0), - datetime(1997, 9, 4, 9, 0), - datetime(1997, 9, 9, 9, 0) - ] - ) - - testRecurring('testWeeklyByMonthAndWeekDay', - // This test is interesting, because it crosses the year - // boundary in a weekly period to find day '1' as a - // valid recurrence. - new RRule({freq: RRule.WEEKLY, - count: 3, - bymonth: [1, 3], - byweekday: [RRule.TU, RRule.TH], - dtstart: parse('19970902T090000') - }), - [ - datetime(1998, 1, 1, 9, 0), - datetime(1998, 1, 6, 9, 0), - datetime(1998, 1, 8, 9, 0) - ] - ) - - testRecurring('testWeeklyByMonthAndNWeekDay', - new RRule({freq: RRule.WEEKLY, - count: 3, - bymonth: [1, 3], - byweekday: [RRule.TU.nth(1), RRule.TH.nth(-1)], - dtstart: parse('19970902T090000') - }), - [ - datetime(1998, 1, 1, 9, 0), - datetime(1998, 1, 6, 9, 0), - datetime(1998, 1, 8, 9, 0) - ] - ) - - testRecurring('testWeeklyByMonthDayAndWeekDay', - new RRule({freq: RRule.WEEKLY, - count: 3, - bymonthday: [1, 3], - byweekday: [RRule.TU, RRule.TH], - dtstart: parse('19970902T090000') - }), - [ - datetime(1998, 1, 1, 9, 0), - datetime(1998, 2, 3, 9, 0), - datetime(1998, 3, 3, 9, 0) - ] - ) - - testRecurring('testWeeklyByMonthAndMonthDayAndWeekDay', - new RRule({freq: RRule.WEEKLY, - count: 3, - bymonth: [1, 3], - bymonthday: [1, 3], - byweekday: [RRule.TU, RRule.TH], - dtstart: parse('19970902T090000') - }), - [ - datetime(1998, 1, 1, 9, 0), - datetime(1998, 3, 3, 9, 0), - datetime(2001, 3, 1, 9, 0) - ] - ) - - testRecurring('testWeeklyByYearDay', - new RRule({freq: RRule.WEEKLY, - count: 4, - byyearday: [1, 100, 200, 365], - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 12, 31, 9, 0), - datetime(1998, 1, 1, 9, 0), - datetime(1998, 4, 10, 9, 0), - datetime(1998, 7, 19, 9, 0) - ] - ) - - testRecurring('testWeeklyByYearDayNeg', - new RRule({freq: RRule.WEEKLY, - count: 4, - byyearday: [-365, -266, -166, -1], - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 12, 31, 9, 0), - datetime(1998, 1, 1, 9, 0), - datetime(1998, 4, 10, 9, 0), - datetime(1998, 7, 19, 9, 0) - ] - ) - - testRecurring('testWeeklyByMonthAndYearDay', - new RRule({freq: RRule.WEEKLY, - count: 4, - bymonth: [1, 7], - byyearday: [1, 100, 200, 365], - dtstart: parse('19970902T090000') - }), - [ - datetime(1998, 1, 1, 9, 0), - datetime(1998, 7, 19, 9, 0), - datetime(1999, 1, 1, 9, 0), - datetime(1999, 7, 19, 9, 0) - ] - ) - - testRecurring('testWeeklyByMonthAndYearDayNeg', - new RRule({freq: RRule.WEEKLY, - count: 4, - bymonth: [1, 7], - byyearday: [-365, -266, -166, -1], - dtstart: parse('19970902T090000') - }), - [ - datetime(1998, 1, 1, 9, 0), - datetime(1998, 7, 19, 9, 0), - datetime(1999, 1, 1, 9, 0), - datetime(1999, 7, 19, 9, 0) - ] - ) - - testRecurring('testWeeklyByWeekNo', - new RRule({freq: RRule.WEEKLY, - count: 3, - byweekno: 20, - dtstart: parse('19970902T090000') - }), - [ - datetime(1998, 5, 11, 9, 0), - datetime(1998, 5, 12, 9, 0), - datetime(1998, 5, 13, 9, 0) - ] - ) - - testRecurring('testWeeklyByWeekNoAndWeekDay', - // That's a nice one. The first days of week number one - // may be in the last year. - new RRule({freq: RRule.WEEKLY, - count: 3, - byweekno: 1, - byweekday: RRule.MO, - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 12, 29, 9, 0), - datetime(1999, 1, 4, 9, 0), - datetime(2000, 1, 3, 9, 0) - ] - ) - - testRecurring('testWeeklyByWeekNoAndWeekDayLarge', - // Another nice test. The last days of week number 52/53 - // may be in the next year. - new RRule({freq: RRule.WEEKLY, - count: 3, - byweekno: 52, - byweekday: RRule.SU, - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 12, 28, 9, 0), - datetime(1998, 12, 27, 9, 0), - datetime(2000, 1, 2, 9, 0) - ] - ) - - testRecurring('testWeeklyByWeekNoAndWeekDayLast', - new RRule({freq: RRule.WEEKLY, - count: 3, - byweekno: -1, - byweekday: RRule.SU, - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 12, 28, 9, 0), - datetime(1999, 1, 3, 9, 0), - datetime(2000, 1, 2, 9, 0) - ] - ) - - testRecurring('testWeeklyByWeekNoAndWeekDay53', - new RRule({freq: RRule.WEEKLY, - count: 3, - byweekno: 53, - byweekday: RRule.MO, - dtstart: parse('19970902T090000') - }), - [ - datetime(1998, 12, 28, 9, 0), - datetime(2004, 12, 27, 9, 0), - datetime(2009, 12, 28, 9, 0) - ] - ) - - testRecurring('testWeeklyByEaster', - new RRule({freq: RRule.WEEKLY, - count: 3, - byeaster: 0, - dtstart: parse('19970902T090000') - }), - [ - datetime(1998, 4, 12, 9, 0), - datetime(1999, 4, 4, 9, 0), - datetime(2000, 4, 23, 9, 0) - ] - ) - - testRecurring('testWeeklyByEasterPos', - new RRule({freq: RRule.WEEKLY, - count: 3, - byeaster: 1, - dtstart: parse('19970902T090000') - }), - [ - datetime(1998, 4, 13, 9, 0), - datetime(1999, 4, 5, 9, 0), - datetime(2000, 4, 24, 9, 0) - ] - ) - - testRecurring('testWeeklyByEasterNeg', - new RRule({freq: RRule.WEEKLY, - count: 3, - byeaster: -1, - dtstart: parse('19970902T090000') - }), - [ - datetime(1998, 4, 11, 9, 0), - datetime(1999, 4, 3, 9, 0), - datetime(2000, 4, 22, 9, 0) - ] - ) - - testRecurring('testWeeklyByHour', - new RRule({freq: RRule.WEEKLY, - count: 3, - byhour: [6, 18], - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 9, 2, 18, 0), - datetime(1997, 9, 9, 6, 0), - datetime(1997, 9, 9, 18, 0) - ] - ) - - testRecurring('testWeeklyByMinute', - new RRule({freq: RRule.WEEKLY, - count: 3, - byminute: [6, 18], - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 9, 2, 9, 6), - datetime(1997, 9, 2, 9, 18), - datetime(1997, 9, 9, 9, 6) - ] - ) - - testRecurring('testWeeklyBySecond', - new RRule({freq: RRule.WEEKLY, - count: 3, - bysecond: [6, 18], - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 9, 2, 9, 0, 6), - datetime(1997, 9, 2, 9, 0, 18), - datetime(1997, 9, 9, 9, 0, 6) - ] - ) - - testRecurring('testWeeklyByHourAndMinute', - new RRule({freq: RRule.WEEKLY, - count: 3, - byhour: [6, 18], - byminute: [6, 18], - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 9, 2, 18, 6), - datetime(1997, 9, 2, 18, 18), - datetime(1997, 9, 9, 6, 6) - ] - ) - - testRecurring('testWeeklyByHourAndSecond', - new RRule({freq: RRule.WEEKLY, - count: 3, - byhour: [6, 18], - bysecond: [6, 18], - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 9, 2, 18, 0, 6), - datetime(1997, 9, 2, 18, 0, 18), - datetime(1997, 9, 9, 6, 0, 6) - ] - ) - - testRecurring('testWeeklyByMinuteAndSecond', - new RRule({freq: RRule.WEEKLY, - count: 3, - byminute: [6, 18], - bysecond: [6, 18], - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 9, 2, 9, 6, 6), - datetime(1997, 9, 2, 9, 6, 18), - datetime(1997, 9, 2, 9, 18, 6) - ] - ) - - testRecurring('testWeeklyByHourAndMinuteAndSecond', - new RRule({freq: RRule.WEEKLY, - count: 3, - byhour: [6, 18], - byminute: [6, 18], - bysecond: [6, 18], - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 9, 2, 18, 6, 6), - datetime(1997, 9, 2, 18, 6, 18), - datetime(1997, 9, 2, 18, 18, 6) - ] - ) - - testRecurring('testWeeklyBySetPos', - new RRule({freq: RRule.WEEKLY, - count: 3, - byweekday: [RRule.TU, RRule.TH], - byhour: [6, 18], - bysetpos: [3, -3], - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 9, 2, 18, 0), - datetime(1997, 9, 4, 6, 0), - datetime(1997, 9, 9, 18, 0) - ] - ) - - testRecurring('testDaily', - new RRule({freq: RRule.DAILY, - count: 3, - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 9, 2, 9, 0), - datetime(1997, 9, 3, 9, 0), - datetime(1997, 9, 4, 9, 0) - ] - ) - - testRecurring('testDailyInterval', - new RRule({freq: RRule.DAILY, - count: 3, - interval: 2, - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 9, 2, 9, 0), - datetime(1997, 9, 4, 9, 0), - datetime(1997, 9, 6, 9, 0) - ] - ) - - testRecurring('testDailyIntervalLarge', - new RRule({freq: RRule.DAILY, - count: 3, - interval: 92, - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 9, 2, 9, 0), - datetime(1997, 12, 3, 9, 0), - datetime(1998, 3, 5, 9, 0) - ] - ) - - testRecurring('testDailyByMonth', - new RRule({freq: RRule.DAILY, - count: 3, - bymonth: [1, 3], - dtstart: parse('19970902T090000') - }), - [ - datetime(1998, 1, 1, 9, 0), - datetime(1998, 1, 2, 9, 0), - datetime(1998, 1, 3, 9, 0) - ] - ) - - testRecurring('testDailyByMonthDay', - new RRule({freq: RRule.DAILY, - count: 3, - bymonthday: [1, 3], - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 9, 3, 9, 0), - datetime(1997, 10, 1, 9, 0), - datetime(1997, 10, 3, 9, 0) - ] - ) - - testRecurring('testDailyByMonthAndMonthDay', - new RRule({freq: RRule.DAILY, - count: 3, - bymonth: [1, 3], - bymonthday: [5, 7], - dtstart: parse('19970902T090000') - }), - [ - datetime(1998, 1, 5, 9, 0), - datetime(1998, 1, 7, 9, 0), - datetime(1998, 3, 5, 9, 0) - ] - ) - - testRecurring('testDailyByWeekDay', - new RRule({freq: RRule.DAILY, - count: 3, - byweekday: [RRule.TU, RRule.TH], - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 9, 2, 9, 0), - datetime(1997, 9, 4, 9, 0), - datetime(1997, 9, 9, 9, 0) - ] - ) - - testRecurring('testDailyByNWeekDay', - new RRule({freq: RRule.DAILY, - count: 3, - byweekday: [RRule.TU.nth(1), RRule.TH.nth(-1)], - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 9, 2, 9, 0), - datetime(1997, 9, 4, 9, 0), - datetime(1997, 9, 9, 9, 0) - ] - ) - - testRecurring('testDailyByMonthAndWeekDay', - new RRule({freq: RRule.DAILY, - count: 3, - bymonth: [1, 3], - byweekday: [RRule.TU, RRule.TH], - dtstart: parse('19970902T090000') - }), - [ - datetime(1998, 1, 1, 9, 0), - datetime(1998, 1, 6, 9, 0), - datetime(1998, 1, 8, 9, 0) - ] - ) - - testRecurring('testDailyByMonthAndNWeekDay', - new RRule({freq: RRule.DAILY, - count: 3, - bymonth: [1, 3], - byweekday: [RRule.TU.nth(1), RRule.TH.nth(-1)], - dtstart: parse('19970902T090000') - }), - [ - datetime(1998, 1, 1, 9, 0), - datetime(1998, 1, 6, 9, 0), - datetime(1998, 1, 8, 9, 0) - ] - ) - - testRecurring('testDailyByMonthDayAndWeekDay', - new RRule({freq: RRule.DAILY, - count: 3, - bymonthday: [1, 3], - byweekday: [RRule.TU, RRule.TH], - dtstart: parse('19970902T090000') - }), - [ - datetime(1998, 1, 1, 9, 0), - datetime(1998, 2, 3, 9, 0), - datetime(1998, 3, 3, 9, 0) - ] - ) - - testRecurring('testDailyByMonthAndMonthDayAndWeekDay', - new RRule({freq: RRule.DAILY, - count: 3, - bymonth: [1, 3], - bymonthday: [1, 3], - byweekday: [RRule.TU, RRule.TH], - dtstart: parse('19970902T090000') - }), - [ - datetime(1998, 1, 1, 9, 0), - datetime(1998, 3, 3, 9, 0), - datetime(2001, 3, 1, 9, 0) - ] - ) - - testRecurring('testDailyByYearDay', - new RRule({freq: RRule.DAILY, - count: 4, - byyearday: [1, 100, 200, 365], - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 12, 31, 9, 0), - datetime(1998, 1, 1, 9, 0), - datetime(1998, 4, 10, 9, 0), - datetime(1998, 7, 19, 9, 0) - ] - ) - - testRecurring('testDailyByYearDayNeg', - new RRule({freq: RRule.DAILY, - count: 4, - byyearday: [-365, -266, -166, -1], - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 12, 31, 9, 0), - datetime(1998, 1, 1, 9, 0), - datetime(1998, 4, 10, 9, 0), - datetime(1998, 7, 19, 9, 0) - ] - ) - - testRecurring('testDailyByMonthAndYearDay', - new RRule({freq: RRule.DAILY, - count: 4, - bymonth: [1, 7], - byyearday: [1, 100, 200, 365], - dtstart: parse('19970902T090000') - }), - [ - datetime(1998, 1, 1, 9, 0), - datetime(1998, 7, 19, 9, 0), - datetime(1999, 1, 1, 9, 0), - datetime(1999, 7, 19, 9, 0) - ] - ) - - testRecurring('testDailyByMonthAndYearDayNeg', - new RRule({freq: RRule.DAILY, - count: 4, - bymonth: [1, 7], - byyearday: [-365, -266, -166, -1], - dtstart: parse('19970902T090000') - }), - [ - datetime(1998, 1, 1, 9, 0), - datetime(1998, 7, 19, 9, 0), - datetime(1999, 1, 1, 9, 0), - datetime(1999, 7, 19, 9, 0) - ] - ) - - testRecurring('testDailyByWeekNo', - new RRule({freq: RRule.DAILY, - count: 3, - byweekno: 20, - dtstart: parse('19970902T090000') - }), - [ - datetime(1998, 5, 11, 9, 0), - datetime(1998, 5, 12, 9, 0), - datetime(1998, 5, 13, 9, 0) - ] - ) - - testRecurring('testDailyByWeekNoAndWeekDay', - // That's a nice one. The first days of week number one - // may be in the last year. - new RRule({freq: RRule.DAILY, - count: 3, - byweekno: 1, - byweekday: RRule.MO, - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 12, 29, 9, 0), - datetime(1999, 1, 4, 9, 0), - datetime(2000, 1, 3, 9, 0) - ] - ) - - testRecurring('testDailyByWeekNoAndWeekDayLarge', - // Another nice test. The last days of week number 52/53 - // may be in the next year. - new RRule({freq: RRule.DAILY, - count: 3, - byweekno: 52, - byweekday: RRule.SU, - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 12, 28, 9, 0), - datetime(1998, 12, 27, 9, 0), - datetime(2000, 1, 2, 9, 0) - ] - ) - - testRecurring('testDailyByWeekNoAndWeekDayLast', - new RRule({freq: RRule.DAILY, - count: 3, - byweekno: -1, - byweekday: RRule.SU, - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 12, 28, 9, 0), - datetime(1999, 1, 3, 9, 0), - datetime(2000, 1, 2, 9, 0) - ] - ) - - testRecurring('testDailyByWeekNoAndWeekDay53', - new RRule({freq: RRule.DAILY, - count: 3, - byweekno: 53, - byweekday: RRule.MO, - dtstart: parse('19970902T090000') - }), - [ - datetime(1998, 12, 28, 9, 0), - datetime(2004, 12, 27, 9, 0), - datetime(2009, 12, 28, 9, 0) - ] - ) - - testRecurring('testDailyByEaster', - new RRule({freq: RRule.DAILY, - count: 3, - byeaster: 0, - dtstart: parse('19970902T090000') - }), - [ - datetime(1998, 4, 12, 9, 0), - datetime(1999, 4, 4, 9, 0), - datetime(2000, 4, 23, 9, 0) - ] - ) - - testRecurring('testDailyByEasterPos', - new RRule({freq: RRule.DAILY, - count: 3, - byeaster: 1, - dtstart: parse('19970902T090000') - }), - [ - datetime(1998, 4, 13, 9, 0), - datetime(1999, 4, 5, 9, 0), - datetime(2000, 4, 24, 9, 0) - ] - ) - - testRecurring('testDailyByEasterNeg', - new RRule({freq: RRule.DAILY, - count: 3, - byeaster: -1, - dtstart: parse('19970902T090000') - }), - [ - datetime(1998, 4, 11, 9, 0), - datetime(1999, 4, 3, 9, 0), - datetime(2000, 4, 22, 9, 0) - ] - ) - - testRecurring('testDailyByHour', - new RRule({freq: RRule.DAILY, - count: 3, - byhour: [6, 18], - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 9, 2, 18, 0), - datetime(1997, 9, 3, 6, 0), - datetime(1997, 9, 3, 18, 0) - ] - ) - - testRecurring('testDailyByMinute', - new RRule({freq: RRule.DAILY, - count: 3, - byminute: [6, 18], - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 9, 2, 9, 6), - datetime(1997, 9, 2, 9, 18), - datetime(1997, 9, 3, 9, 6) - ] - ) - - testRecurring('testDailyBySecond', - new RRule({freq: RRule.DAILY, - count: 3, - bysecond: [6, 18], - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 9, 2, 9, 0, 6), - datetime(1997, 9, 2, 9, 0, 18), - datetime(1997, 9, 3, 9, 0, 6) - ] - ) - - testRecurring('testDailyByHourAndMinute', - new RRule({freq: RRule.DAILY, - count: 3, - byhour: [6, 18], - byminute: [6, 18], - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 9, 2, 18, 6), - datetime(1997, 9, 2, 18, 18), - datetime(1997, 9, 3, 6, 6) - ] - ) - - testRecurring('testDailyByHourAndSecond', - new RRule({freq: RRule.DAILY, - count: 3, - byhour: [6, 18], - bysecond: [6, 18], - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 9, 2, 18, 0, 6), - datetime(1997, 9, 2, 18, 0, 18), - datetime(1997, 9, 3, 6, 0, 6) - ] - ) - - testRecurring('testDailyByMinuteAndSecond', - new RRule({freq: RRule.DAILY, - count: 3, - byminute: [6, 18], - bysecond: [6, 18], - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 9, 2, 9, 6, 6), - datetime(1997, 9, 2, 9, 6, 18), - datetime(1997, 9, 2, 9, 18, 6) - ] - ) - - testRecurring('testDailyByHourAndMinuteAndSecond', - new RRule({freq: RRule.DAILY, - count: 3, - byhour: [6, 18], - byminute: [6, 18], - bysecond: [6, 18], - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 9, 2, 18, 6, 6), - datetime(1997, 9, 2, 18, 6, 18), - datetime(1997, 9, 2, 18, 18, 6) - ] - ) - - testRecurring('testDailyBySetPos', - new RRule({freq: RRule.DAILY, - count: 3, - byhour: [6, 18], - byminute: [15, 45], - bysetpos: [3, -3], - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 9, 2, 18, 15), - datetime(1997, 9, 3, 6, 45), - datetime(1997, 9, 3, 18, 15) - ] - ) - - testRecurring('testHourly', - new RRule({freq: RRule.HOURLY, - count: 3, - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 9, 2, 9, 0), - datetime(1997, 9, 2, 10, 0), - datetime(1997, 9, 2, 11, 0) - ] - ) - - testRecurring('testHourlyInterval', - new RRule({freq: RRule.HOURLY, - count: 3, - interval: 2, - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 9, 2, 9, 0), - datetime(1997, 9, 2, 11, 0), - datetime(1997, 9, 2, 13, 0) - ] - ) - - testRecurring('testHourlyIntervalLarge', - new RRule({freq: RRule.HOURLY, - count: 3, - interval: 769, - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 9, 2, 9, 0), - datetime(1997, 10, 4, 10, 0), - datetime(1997, 11, 5, 11, 0) - ] - ) - - testRecurring('testHourlyByMonth', - new RRule({freq: RRule.HOURLY, - count: 3, - bymonth: [1, 3], - dtstart: parse('19970902T090000') - }), - [ - datetime(1998, 1, 1, 0, 0), - datetime(1998, 1, 1, 1, 0), - datetime(1998, 1, 1, 2, 0) - ] - ) - - testRecurring('testHourlyByMonthDay', - new RRule({freq: RRule.HOURLY, - count: 3, - bymonthday: [1, 3], - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 9, 3, 0, 0), - datetime(1997, 9, 3, 1, 0), - datetime(1997, 9, 3, 2, 0) - ] - ) - - testRecurring('testHourlyByMonthAndMonthDay', - new RRule({freq: RRule.HOURLY, - count: 3, - bymonth: [1, 3], - bymonthday: [5, 7], - dtstart: parse('19970902T090000') - }), - [ - datetime(1998, 1, 5, 0, 0), - datetime(1998, 1, 5, 1, 0), - datetime(1998, 1, 5, 2, 0) - ] - ) - - testRecurring('testHourlyByWeekDay', - new RRule({freq: RRule.HOURLY, - count: 3, - byweekday: [RRule.TU, RRule.TH], - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 9, 2, 9, 0), - datetime(1997, 9, 2, 10, 0), - datetime(1997, 9, 2, 11, 0) - ] - ) - - testRecurring('testHourlyByNWeekDay', - new RRule({freq: RRule.HOURLY, - count: 3, - byweekday: [RRule.TU.nth(1), RRule.TH.nth(-1)], - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 9, 2, 9, 0), - datetime(1997, 9, 2, 10, 0), - datetime(1997, 9, 2, 11, 0) - ] - ) - - testRecurring('testHourlyByMonthAndWeekDay', - new RRule({freq: RRule.HOURLY, - count: 3, - bymonth: [1, 3], - byweekday: [RRule.TU, RRule.TH], - dtstart: parse('19970902T090000') - }), - [ - datetime(1998, 1, 1, 0, 0), - datetime(1998, 1, 1, 1, 0), - datetime(1998, 1, 1, 2, 0) - ] - ) - - testRecurring('testHourlyByMonthAndNWeekDay', - new RRule({freq: RRule.HOURLY, - count: 3, - bymonth: [1, 3], - byweekday: [RRule.TU.nth(1), RRule.TH.nth(-1)], - dtstart: parse('19970902T090000') - }), - [ - datetime(1998, 1, 1, 0, 0), - datetime(1998, 1, 1, 1, 0), - datetime(1998, 1, 1, 2, 0) - ] - ) - - testRecurring('testHourlyByMonthDayAndWeekDay', - new RRule({freq: RRule.HOURLY, - count: 3, - bymonthday: [1, 3], - byweekday: [RRule.TU, RRule.TH], - dtstart: parse('19970902T090000') - }), - [ - datetime(1998, 1, 1, 0, 0), - datetime(1998, 1, 1, 1, 0), - datetime(1998, 1, 1, 2, 0) - ] - ) - - testRecurring('testHourlyByMonthAndMonthDayAndWeekDay', - new RRule({freq: RRule.HOURLY, - count: 3, - bymonth: [1, 3], - bymonthday: [1, 3], - byweekday: [RRule.TU, RRule.TH], - dtstart: parse('19970902T090000') - }), - [ - datetime(1998, 1, 1, 0, 0), - datetime(1998, 1, 1, 1, 0), - datetime(1998, 1, 1, 2, 0) - ] - ) - - testRecurring('testHourlyByYearDay', - new RRule({freq: RRule.HOURLY, - count: 4, - byyearday: [1, 100, 200, 365], - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 12, 31, 0, 0), - datetime(1997, 12, 31, 1, 0), - datetime(1997, 12, 31, 2, 0), - datetime(1997, 12, 31, 3, 0) - ] - ) - - testRecurring('testHourlyByYearDayNeg', - new RRule({freq: RRule.HOURLY, - count: 4, - byyearday: [-365, -266, -166, -1], - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 12, 31, 0, 0), - datetime(1997, 12, 31, 1, 0), - datetime(1997, 12, 31, 2, 0), - datetime(1997, 12, 31, 3, 0) - ] - ) - - testRecurring('testHourlyByMonthAndYearDay', - new RRule({freq: RRule.HOURLY, - count: 4, - bymonth: [4, 7], - byyearday: [1, 100, 200, 365], - dtstart: parse('19970902T090000') - }), - [ - datetime(1998, 4, 10, 0, 0), - datetime(1998, 4, 10, 1, 0), - datetime(1998, 4, 10, 2, 0), - datetime(1998, 4, 10, 3, 0) - ] - ) - - testRecurring('testHourlyByMonthAndYearDayNeg', - new RRule({freq: RRule.HOURLY, - count: 4, - bymonth: [4, 7], - byyearday: [-365, -266, -166, -1], - dtstart: parse('19970902T090000') - }), - [ - datetime(1998, 4, 10, 0, 0), - datetime(1998, 4, 10, 1, 0), - datetime(1998, 4, 10, 2, 0), - datetime(1998, 4, 10, 3, 0) - ] - ) - - testRecurring('testHourlyByWeekNo', - new RRule({freq: RRule.HOURLY, - count: 3, - byweekno: 20, - dtstart: parse('19970902T090000') - }), - [ - datetime(1998, 5, 11, 0, 0), - datetime(1998, 5, 11, 1, 0), - datetime(1998, 5, 11, 2, 0) - ] - ) - - testRecurring('testHourlyByWeekNoAndWeekDay', - new RRule({freq: RRule.HOURLY, - count: 3, - byweekno: 1, - byweekday: RRule.MO, - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 12, 29, 0, 0), - datetime(1997, 12, 29, 1, 0), - datetime(1997, 12, 29, 2, 0) - ] - ) - - testRecurring('testHourlyByWeekNoAndWeekDayLarge', - new RRule({freq: RRule.HOURLY, - count: 3, - byweekno: 52, - byweekday: RRule.SU, - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 12, 28, 0, 0), - datetime(1997, 12, 28, 1, 0), - datetime(1997, 12, 28, 2, 0) - ] - ) - - testRecurring('testHourlyByWeekNoAndWeekDayLast', - new RRule({freq: RRule.HOURLY, - count: 3, - byweekno: -1, - byweekday: RRule.SU, - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 12, 28, 0, 0), - datetime(1997, 12, 28, 1, 0), - datetime(1997, 12, 28, 2, 0) - ] - ) - - testRecurring('testHourlyByWeekNoAndWeekDay53', - new RRule({freq: RRule.HOURLY, - count: 3, - byweekno: 53, - byweekday: RRule.MO, - dtstart: parse('19970902T090000') - }), - [ - datetime(1998, 12, 28, 0, 0), - datetime(1998, 12, 28, 1, 0), - datetime(1998, 12, 28, 2, 0) - ] - ) - - testRecurring.skip('testHourlyByEaster', - new RRule({freq: RRule.HOURLY, - count: 3, - byeaster: 0, - dtstart: parse('19970902T090000') - }), - [ - datetime(1998, 4, 12, 0, 0), - datetime(1998, 4, 12, 1, 0), - datetime(1998, 4, 12, 2, 0) - ] - ) - - testRecurring.skip('testHourlyByEasterPos', - new RRule({freq: RRule.HOURLY, - count: 3, - byeaster: 1, - dtstart: parse('19970902T090000') - }), - [ - datetime(1998, 4, 13, 0, 0), - datetime(1998, 4, 13, 1, 0), - datetime(1998, 4, 13, 2, 0) - ] - ) - - testRecurring.skip('testHourlyByEasterNeg', - new RRule({freq: RRule.HOURLY, - count: 3, - byeaster: -1, - dtstart: parse('19970902T090000') - }), - [ - datetime(1998, 4, 11, 0, 0), - datetime(1998, 4, 11, 1, 0), - datetime(1998, 4, 11, 2, 0) - ] - ) - - testRecurring('testHourlyByHour', - new RRule({freq: RRule.HOURLY, - count: 3, - byhour: [6, 18], - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 9, 2, 18, 0), - datetime(1997, 9, 3, 6, 0), - datetime(1997, 9, 3, 18, 0) - ] - ) - - testRecurring('testHourlyByMinute', - new RRule({freq: RRule.HOURLY, - count: 3, - byminute: [6, 18], - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 9, 2, 9, 6), - datetime(1997, 9, 2, 9, 18), - datetime(1997, 9, 2, 10, 6) - ] - ) - - testRecurring('testHourlyBySecond', - new RRule({freq: RRule.HOURLY, - count: 3, - bysecond: [6, 18], - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 9, 2, 9, 0, 6), - datetime(1997, 9, 2, 9, 0, 18), - datetime(1997, 9, 2, 10, 0, 6) - ] - ) - - testRecurring('testHourlyByHourAndMinute', - new RRule({freq: RRule.HOURLY, - count: 3, - byhour: [6, 18], - byminute: [6, 18], - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 9, 2, 18, 6), - datetime(1997, 9, 2, 18, 18), - datetime(1997, 9, 3, 6, 6) - ] - ) - - testRecurring('testHourlyByHourAndSecond', - new RRule({freq: RRule.HOURLY, - count: 3, - byhour: [6, 18], - bysecond: [6, 18], - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 9, 2, 18, 0, 6), - datetime(1997, 9, 2, 18, 0, 18), - datetime(1997, 9, 3, 6, 0, 6) - ] - ) - - testRecurring('testHourlyByMinuteAndSecond', - new RRule({freq: RRule.HOURLY, - count: 3, - byminute: [6, 18], - bysecond: [6, 18], - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 9, 2, 9, 6, 6), - datetime(1997, 9, 2, 9, 6, 18), - datetime(1997, 9, 2, 9, 18, 6) - ] - ) - - testRecurring('testHourlyByHourAndMinuteAndSecond', - new RRule({freq: RRule.HOURLY, - count: 3, - byhour: [6, 18], - byminute: [6, 18], - bysecond: [6, 18], - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 9, 2, 18, 6, 6), - datetime(1997, 9, 2, 18, 6, 18), - datetime(1997, 9, 2, 18, 18, 6) - ] - ) - - testRecurring('testHourlyBySetPos', - new RRule({freq: RRule.HOURLY, - count: 3, - byminute: [15, 45], - bysecond: [15, 45], - bysetpos: [3, -3], - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 9, 2, 9, 15, 45), - datetime(1997, 9, 2, 9, 45, 15), - datetime(1997, 9, 2, 10, 15, 45) - ] - ) - - testRecurring('testMinutely', - new RRule({freq: RRule.MINUTELY, - count: 3, - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 9, 2, 9, 0), - datetime(1997, 9, 2, 9, 1), - datetime(1997, 9, 2, 9, 2) - ] - ) - - testRecurring('testMinutelyInterval', - new RRule({freq: RRule.MINUTELY, - count: 3, - interval: 2, - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 9, 2, 9, 0), - datetime(1997, 9, 2, 9, 2), - datetime(1997, 9, 2, 9, 4) - ] - ) - - testRecurring('testMinutelyIntervalLarge', - new RRule({freq: RRule.MINUTELY, - count: 3, - interval: 1501, - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 9, 2, 9, 0), - datetime(1997, 9, 3, 10, 1), - datetime(1997, 9, 4, 11, 2) - ] - ) - - testRecurring('testMinutelyByMonth', - new RRule({freq: RRule.MINUTELY, - count: 3, - bymonth: [1, 3], - dtstart: parse('19970902T090000') - }), - [ - datetime(1998, 1, 1, 0, 0), - datetime(1998, 1, 1, 0, 1), - datetime(1998, 1, 1, 0, 2) - ] - ) - - testRecurring('testMinutelyByMonthDay', - new RRule({freq: RRule.MINUTELY, - count: 3, - bymonthday: [1, 3], - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 9, 3, 0, 0), - datetime(1997, 9, 3, 0, 1), - datetime(1997, 9, 3, 0, 2) - ] - ) - - testRecurring('testMinutelyByMonthAndMonthDay', - new RRule({freq: RRule.MINUTELY, - count: 3, - bymonth: [1, 3], - bymonthday: [5, 7], - dtstart: parse('19970902T090000') - }), - [ - datetime(1998, 1, 5, 0, 0), - datetime(1998, 1, 5, 0, 1), - datetime(1998, 1, 5, 0, 2) - ] - ) - - testRecurring('testMinutelyByWeekDay', - new RRule({freq: RRule.MINUTELY, - count: 3, - byweekday: [RRule.TU, RRule.TH], - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 9, 2, 9, 0), - datetime(1997, 9, 2, 9, 1), - datetime(1997, 9, 2, 9, 2) - ] - ) - - testRecurring('testMinutelyByNWeekDay', - new RRule({freq: RRule.MINUTELY, - count: 3, - byweekday: [RRule.TU.nth(1), RRule.TH.nth(-1)], - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 9, 2, 9, 0), - datetime(1997, 9, 2, 9, 1), - datetime(1997, 9, 2, 9, 2) - ] - ) - - testRecurring('testMinutelyByMonthAndWeekDay', - new RRule({freq: RRule.MINUTELY, - count: 3, - bymonth: [1, 3], - byweekday: [RRule.TU, RRule.TH], - dtstart: parse('19970902T090000') - }), - [ - datetime(1998, 1, 1, 0, 0), - datetime(1998, 1, 1, 0, 1), - datetime(1998, 1, 1, 0, 2) - ] - ) - - testRecurring('testMinutelyByMonthAndNWeekDay', - new RRule({freq: RRule.MINUTELY, - count: 3, - bymonth: [1, 3], - byweekday: [RRule.TU.nth(1), RRule.TH.nth(-1)], - dtstart: parse('19970902T090000') - }), - [ - datetime(1998, 1, 1, 0, 0), - datetime(1998, 1, 1, 0, 1), - datetime(1998, 1, 1, 0, 2) - ] - ) - - testRecurring('testMinutelyByMonthDayAndWeekDay', - new RRule({freq: RRule.MINUTELY, - count: 3, - bymonthday: [1, 3], - byweekday: [RRule.TU, RRule.TH], - dtstart: parse('19970902T090000') - }), - [ - datetime(1998, 1, 1, 0, 0), - datetime(1998, 1, 1, 0, 1), - datetime(1998, 1, 1, 0, 2) - ] - ) - - testRecurring('testMinutelyByMonthAndMonthDayAndWeekDay', - new RRule({freq: RRule.MINUTELY, - count: 3, - bymonth: [1, 3], - bymonthday: [1, 3], - byweekday: [RRule.TU, RRule.TH], - dtstart: parse('19970902T090000') - }), - [ - datetime(1998, 1, 1, 0, 0), - datetime(1998, 1, 1, 0, 1), - datetime(1998, 1, 1, 0, 2) - ] - ) - - testRecurring('testMinutelyByYearDay', - new RRule({freq: RRule.MINUTELY, - count: 4, - byyearday: [1, 100, 200, 365], - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 12, 31, 0, 0), - datetime(1997, 12, 31, 0, 1), - datetime(1997, 12, 31, 0, 2), - datetime(1997, 12, 31, 0, 3) - ] - ) - - testRecurring('testMinutelyByYearDayNeg', - new RRule({freq: RRule.MINUTELY, - count: 4, - byyearday: [-365, -266, -166, -1], - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 12, 31, 0, 0), - datetime(1997, 12, 31, 0, 1), - datetime(1997, 12, 31, 0, 2), - datetime(1997, 12, 31, 0, 3) - ] - ) - - testRecurring('testMinutelyByMonthAndYearDay', - new RRule({freq: RRule.MINUTELY, - count: 4, - bymonth: [4, 7], - byyearday: [1, 100, 200, 365], - dtstart: parse('19970902T090000') - }), - [ - datetime(1998, 4, 10, 0, 0), - datetime(1998, 4, 10, 0, 1), - datetime(1998, 4, 10, 0, 2), - datetime(1998, 4, 10, 0, 3) - ] - ) - - testRecurring('testMinutelyByMonthAndYearDayNeg', - new RRule({freq: RRule.MINUTELY, - count: 4, - bymonth: [4, 7], - byyearday: [-365, -266, -166, -1], - dtstart: parse('19970902T090000') - }), - [ - datetime(1998, 4, 10, 0, 0), - datetime(1998, 4, 10, 0, 1), - datetime(1998, 4, 10, 0, 2), - datetime(1998, 4, 10, 0, 3) - ] - ) - - testRecurring('testMinutelyByWeekNo', - new RRule({freq: RRule.MINUTELY, - count: 3, - byweekno: 20, - dtstart: parse('19970902T090000') - }), - [ - datetime(1998, 5, 11, 0, 0), - datetime(1998, 5, 11, 0, 1), - datetime(1998, 5, 11, 0, 2) - ] - ) - - testRecurring('testMinutelyByWeekNoAndWeekDay', - new RRule({freq: RRule.MINUTELY, - count: 3, - byweekno: 1, - byweekday: RRule.MO, - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 12, 29, 0, 0), - datetime(1997, 12, 29, 0, 1), - datetime(1997, 12, 29, 0, 2) - ] - ) - - testRecurring('testMinutelyByWeekNoAndWeekDayLarge', - new RRule({freq: RRule.MINUTELY, - count: 3, - byweekno: 52, - byweekday: RRule.SU, - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 12, 28, 0, 0), - datetime(1997, 12, 28, 0, 1), - datetime(1997, 12, 28, 0, 2) - ] - ) - - testRecurring('testMinutelyByWeekNoAndWeekDayLast', - new RRule({freq: RRule.MINUTELY, - count: 3, - byweekno: -1, - byweekday: RRule.SU, - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 12, 28, 0, 0), - datetime(1997, 12, 28, 0, 1), - datetime(1997, 12, 28, 0, 2) - ] - ) - - testRecurring('testMinutelyByWeekNoAndWeekDay53', - new RRule({freq: RRule.MINUTELY, - count: 3, - byweekno: 53, - byweekday: RRule.MO, - dtstart: parse('19970902T090000') - }), - [ - datetime(1998, 12, 28, 0, 0), - datetime(1998, 12, 28, 0, 1), - datetime(1998, 12, 28, 0, 2) - ] - ) - - testRecurring.skip('testMinutelyByEaster', - new RRule({freq: RRule.MINUTELY, - count: 3, - byeaster: 0, - dtstart: parse('19970902T090000') - }), - [ - datetime(1998, 4, 12, 0, 0), - datetime(1998, 4, 12, 0, 1), - datetime(1998, 4, 12, 0, 2) - ] - ) - - testRecurring.skip('testMinutelyByEasterPos', - new RRule({freq: RRule.MINUTELY, - count: 3, - byeaster: 1, - dtstart: parse('19970902T090000') - }), - [ - datetime(1998, 4, 13, 0, 0), - datetime(1998, 4, 13, 0, 1), - datetime(1998, 4, 13, 0, 2) - ] - ) - - testRecurring.skip('testMinutelyByEasterNeg', - new RRule({freq: RRule.MINUTELY, - count: 3, - byeaster: -1, - dtstart: parse('19970902T090000') - }), - [ - datetime(1998, 4, 11, 0, 0), - datetime(1998, 4, 11, 0, 1), - datetime(1998, 4, 11, 0, 2) - ] - ) - - testRecurring('testMinutelyByHour', - new RRule({freq: RRule.MINUTELY, - count: 3, - byhour: [6, 18], - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 9, 2, 18, 0), - datetime(1997, 9, 2, 18, 1), - datetime(1997, 9, 2, 18, 2) - ] - ) - - testRecurring('testMinutelyByMinute', - new RRule({freq: RRule.MINUTELY, - count: 3, - byminute: [6, 18], - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 9, 2, 9, 6), - datetime(1997, 9, 2, 9, 18), - datetime(1997, 9, 2, 10, 6) - ] - ) - - testRecurring('testMinutelyBySecond', - new RRule({freq: RRule.MINUTELY, - count: 3, - bysecond: [6, 18], - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 9, 2, 9, 0, 6), - datetime(1997, 9, 2, 9, 0, 18), - datetime(1997, 9, 2, 9, 1, 6) - ] - ) - - testRecurring('testMinutelyByHourAndMinute', - new RRule({freq: RRule.MINUTELY, - count: 3, - byhour: [6, 18], - byminute: [6, 18], - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 9, 2, 18, 6), - datetime(1997, 9, 2, 18, 18), - datetime(1997, 9, 3, 6, 6) - ] - ) - - testRecurring('testMinutelyByHourAndSecond', - new RRule({freq: RRule.MINUTELY, - count: 3, - byhour: [6, 18], - bysecond: [6, 18], - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 9, 2, 18, 0, 6), - datetime(1997, 9, 2, 18, 0, 18), - datetime(1997, 9, 2, 18, 1, 6) - ] - ) - - testRecurring('testMinutelyByMinuteAndSecond', - new RRule({freq: RRule.MINUTELY, - count: 3, - byminute: [6, 18], - bysecond: [6, 18], - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 9, 2, 9, 6, 6), - datetime(1997, 9, 2, 9, 6, 18), - datetime(1997, 9, 2, 9, 18, 6) - ] - ) - - testRecurring('testMinutelyByHourAndMinuteAndSecond', - new RRule({freq: RRule.MINUTELY, - count: 3, - byhour: [6, 18], - byminute: [6, 18], - bysecond: [6, 18], - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 9, 2, 18, 6, 6), - datetime(1997, 9, 2, 18, 6, 18), - datetime(1997, 9, 2, 18, 18, 6) - ] - ) - - testRecurring('testMinutelyBySetPos', - new RRule({freq: RRule.MINUTELY, - count: 3, - bysecond: [15, 30, 45], - bysetpos: [3, -3], - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 9, 2, 9, 0, 15), - datetime(1997, 9, 2, 9, 0, 45), - datetime(1997, 9, 2, 9, 1, 15) - ] - ) - - testRecurring('testSecondly', - new RRule({freq: RRule.SECONDLY, - count: 3, - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 9, 2, 9, 0, 0), - datetime(1997, 9, 2, 9, 0, 1), - datetime(1997, 9, 2, 9, 0, 2) - ] - ) - - testRecurring('testSecondlyInterval', - new RRule({freq: RRule.SECONDLY, - count: 3, - interval: 2, - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 9, 2, 9, 0, 0), - datetime(1997, 9, 2, 9, 0, 2), - datetime(1997, 9, 2, 9, 0, 4) - ] - ) - - testRecurring('testSecondlyIntervalLarge', - new RRule({freq: RRule.SECONDLY, - count: 3, - interval: 90061, - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 9, 2, 9, 0, 0), - datetime(1997, 9, 3, 10, 1, 1), - datetime(1997, 9, 4, 11, 2, 2) - ] - ) - - testRecurring('testSecondlyByMonth', - new RRule({freq: RRule.SECONDLY, - count: 3, - bymonth: [1, 3], - dtstart: parse('19970902T090000') - }), - [ - datetime(1998, 1, 1, 0, 0, 0), - datetime(1998, 1, 1, 0, 0, 1), - datetime(1998, 1, 1, 0, 0, 2) - ] - ) - - testRecurring('testSecondlyByMonthDay', - new RRule({freq: RRule.SECONDLY, - count: 3, - bymonthday: [1, 3], - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 9, 3, 0, 0, 0), - datetime(1997, 9, 3, 0, 0, 1), - datetime(1997, 9, 3, 0, 0, 2) - ] - ) - - testRecurring('testSecondlyByMonthAndMonthDay', - new RRule({freq: RRule.SECONDLY, - count: 3, - bymonth: [1, 3], - bymonthday: [5, 7], - dtstart: parse('19970902T090000') - }), - [ - datetime(1998, 1, 5, 0, 0, 0), - datetime(1998, 1, 5, 0, 0, 1), - datetime(1998, 1, 5, 0, 0, 2) - ] - ) - - testRecurring('testSecondlyByWeekDay', - new RRule({freq: RRule.SECONDLY, - count: 3, - byweekday: [RRule.TU, RRule.TH], - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 9, 2, 9, 0, 0), - datetime(1997, 9, 2, 9, 0, 1), - datetime(1997, 9, 2, 9, 0, 2) - ] - ) - - testRecurring('testSecondlyByNWeekDay', - new RRule({freq: RRule.SECONDLY, - count: 3, - byweekday: [RRule.TU.nth(1), RRule.TH.nth(-1)], - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 9, 2, 9, 0, 0), - datetime(1997, 9, 2, 9, 0, 1), - datetime(1997, 9, 2, 9, 0, 2) - ] - ) - - testRecurring('testSecondlyByMonthAndWeekDay', - new RRule({freq: RRule.SECONDLY, - count: 3, - bymonth: [1, 3], - byweekday: [RRule.TU, RRule.TH], - dtstart: parse('19970902T090000') - }), - [ - datetime(1998, 1, 1, 0, 0, 0), - datetime(1998, 1, 1, 0, 0, 1), - datetime(1998, 1, 1, 0, 0, 2) - ] - ) - - testRecurring('testSecondlyByMonthAndNWeekDay', - new RRule({freq: RRule.SECONDLY, - count: 3, - bymonth: [1, 3], - byweekday: [RRule.TU.nth(1), RRule.TH.nth(-1)], - dtstart: parse('19970902T090000') - }), - [ - datetime(1998, 1, 1, 0, 0, 0), - datetime(1998, 1, 1, 0, 0, 1), - datetime(1998, 1, 1, 0, 0, 2) - ] - ) - - testRecurring('testSecondlyByMonthDayAndWeekDay', - new RRule({freq: RRule.SECONDLY, - count: 3, - bymonthday: [1, 3], - byweekday: [RRule.TU, RRule.TH], - dtstart: parse('19970902T090000') - }), - [ - datetime(1998, 1, 1, 0, 0, 0), - datetime(1998, 1, 1, 0, 0, 1), - datetime(1998, 1, 1, 0, 0, 2) - ] - ) - - testRecurring('testSecondlyByMonthAndMonthDayAndWeekDay', - new RRule({freq: RRule.SECONDLY, - count: 3, - bymonth: [1, 3], - bymonthday: [1, 3], - byweekday: [RRule.TU, RRule.TH], - dtstart: parse('19970902T090000') - }), - [ - datetime(1998, 1, 1, 0, 0, 0), - datetime(1998, 1, 1, 0, 0, 1), - datetime(1998, 1, 1, 0, 0, 2) - ] - ) - - testRecurring('testSecondlyByYearDay', - new RRule({freq: RRule.SECONDLY, - count: 4, - byyearday: [1, 100, 200, 365], - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 12, 31, 0, 0, 0), - datetime(1997, 12, 31, 0, 0, 1), - datetime(1997, 12, 31, 0, 0, 2), - datetime(1997, 12, 31, 0, 0, 3) - ] - ) - - testRecurring('testSecondlyByYearDayNeg', - new RRule({freq: RRule.SECONDLY, - count: 4, - byyearday: [-365, -266, -166, -1], - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 12, 31, 0, 0, 0), - datetime(1997, 12, 31, 0, 0, 1), - datetime(1997, 12, 31, 0, 0, 2), - datetime(1997, 12, 31, 0, 0, 3) - ] - ) - - testRecurring('testSecondlyByMonthAndYearDay', - new RRule({freq: RRule.SECONDLY, - count: 4, - bymonth: [4, 7], - byyearday: [1, 100, 200, 365], - dtstart: parse('19970902T090000') - }), - [ - datetime(1998, 4, 10, 0, 0, 0), - datetime(1998, 4, 10, 0, 0, 1), - datetime(1998, 4, 10, 0, 0, 2), - datetime(1998, 4, 10, 0, 0, 3) - ] - ) - - testRecurring('testSecondlyByMonthAndYearDayNeg', - new RRule({freq: RRule.SECONDLY, - count: 4, - bymonth: [4, 7], - byyearday: [-365, -266, -166, -1], - dtstart: parse('19970902T090000') - }), - [ - datetime(1998, 4, 10, 0, 0, 0), - datetime(1998, 4, 10, 0, 0, 1), - datetime(1998, 4, 10, 0, 0, 2), - datetime(1998, 4, 10, 0, 0, 3) - ] - ) - - testRecurring('testSecondlyByWeekNo', - new RRule({freq: RRule.SECONDLY, - count: 3, - byweekno: 20, - dtstart: parse('19970902T090000') - }), - [ - datetime(1998, 5, 11, 0, 0, 0), - datetime(1998, 5, 11, 0, 0, 1), - datetime(1998, 5, 11, 0, 0, 2) - ] - ) - - testRecurring('testSecondlyByWeekNoAndWeekDay', - new RRule({freq: RRule.SECONDLY, - count: 3, - byweekno: 1, - byweekday: RRule.MO, - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 12, 29, 0, 0, 0), - datetime(1997, 12, 29, 0, 0, 1), - datetime(1997, 12, 29, 0, 0, 2) - ] - ) - - testRecurring('testSecondlyByWeekNoAndWeekDayLarge', - new RRule({freq: RRule.SECONDLY, - count: 3, - byweekno: 52, - byweekday: RRule.SU, - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 12, 28, 0, 0, 0), - datetime(1997, 12, 28, 0, 0, 1), - datetime(1997, 12, 28, 0, 0, 2) - ] - ) - - testRecurring('testSecondlyByWeekNoAndWeekDayLast', - new RRule({freq: RRule.SECONDLY, - count: 3, - byweekno: -1, - byweekday: RRule.SU, - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 12, 28, 0, 0, 0), - datetime(1997, 12, 28, 0, 0, 1), - datetime(1997, 12, 28, 0, 0, 2) - ] - ) - - testRecurring('testSecondlyByWeekNoAndWeekDay53', - new RRule({freq: RRule.SECONDLY, - count: 3, - byweekno: 53, - byweekday: RRule.MO, - dtstart: parse('19970902T090000') - }), - [ - datetime(1998, 12, 28, 0, 0, 0), - datetime(1998, 12, 28, 0, 0, 1), - datetime(1998, 12, 28, 0, 0, 2) - ] - ) - - testRecurring.skip('testSecondlyByEaster', - new RRule({freq: RRule.SECONDLY, - count: 3, - byeaster: 0, - dtstart: parse('19970902T090000') - }), - [ - datetime(1998, 4, 12, 0, 0, 0), - datetime(1998, 4, 12, 0, 0, 1), - datetime(1998, 4, 12, 0, 0, 2) - ] - ) - - testRecurring.skip('testSecondlyByEasterPos', - new RRule({freq: RRule.SECONDLY, - count: 3, - byeaster: 1, - dtstart: parse('19970902T090000') - }), - [ - datetime(1998, 4, 13, 0, 0, 0), - datetime(1998, 4, 13, 0, 0, 1), - datetime(1998, 4, 13, 0, 0, 2) - ] - ) - - testRecurring.skip('testSecondlyByEasterNeg', - new RRule({freq: RRule.SECONDLY, - count: 3, - byeaster: -1, - dtstart: parse('19970902T090000') - }), - [ - datetime(1998, 4, 11, 0, 0, 0), - datetime(1998, 4, 11, 0, 0, 1), - datetime(1998, 4, 11, 0, 0, 2) - ] - ) - - testRecurring('testSecondlyByHour', - new RRule({freq: RRule.SECONDLY, - count: 3, - byhour: [6, 18], - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 9, 2, 18, 0, 0), - datetime(1997, 9, 2, 18, 0, 1), - datetime(1997, 9, 2, 18, 0, 2) - ] - ) - - testRecurring('testSecondlyByMinute', - new RRule({freq: RRule.SECONDLY, - count: 3, - byminute: [6, 18], - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 9, 2, 9, 6, 0), - datetime(1997, 9, 2, 9, 6, 1), - datetime(1997, 9, 2, 9, 6, 2) - ] - ) - - testRecurring('testSecondlyBySecond', - new RRule({freq: RRule.SECONDLY, - count: 3, - bysecond: [6, 18], - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 9, 2, 9, 0, 6), - datetime(1997, 9, 2, 9, 0, 18), - datetime(1997, 9, 2, 9, 1, 6) - ] - ) - - testRecurring('testSecondlyByHourAndMinute', - new RRule({freq: RRule.SECONDLY, - count: 3, - byhour: [6, 18], - byminute: [6, 18], - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 9, 2, 18, 6, 0), - datetime(1997, 9, 2, 18, 6, 1), - datetime(1997, 9, 2, 18, 6, 2) - ] - ) - - testRecurring('testSecondlyByHourAndSecond', - new RRule({freq: RRule.SECONDLY, - count: 3, - byhour: [6, 18], - bysecond: [6, 18], - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 9, 2, 18, 0, 6), - datetime(1997, 9, 2, 18, 0, 18), - datetime(1997, 9, 2, 18, 1, 6) - ] - ) - - testRecurring('testSecondlyByMinuteAndSecond', - new RRule({freq: RRule.SECONDLY, - count: 3, - byminute: [6, 18], - bysecond: [6, 18], - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 9, 2, 9, 6, 6), - datetime(1997, 9, 2, 9, 6, 18), - datetime(1997, 9, 2, 9, 18, 6) - ] - ) - - testRecurring('testSecondlyByHourAndMinuteAndSecond', - new RRule({freq: RRule.SECONDLY, - count: 3, - byhour: [6, 18], - byminute: [6, 18], - bysecond: [6, 18], - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 9, 2, 18, 6, 6), - datetime(1997, 9, 2, 18, 6, 18), - datetime(1997, 9, 2, 18, 18, 6) - ] - ) - - testRecurring('testUntilNotMatching', - new RRule({freq: RRule.DAILY, - count: 3, - dtstart: parse('19970902T090000'), - until: parse('19970905T080000') - }), - [ - datetime(1997, 9, 2, 9, 0), - datetime(1997, 9, 3, 9, 0), - datetime(1997, 9, 4, 9, 0) - ] - ) - - testRecurring('testUntilMatching', - new RRule({freq: RRule.DAILY, - count: 3, - dtstart: parse('19970902T090000'), - until: parse('19970904T090000') - }), - [ - datetime(1997, 9, 2, 9, 0), - datetime(1997, 9, 3, 9, 0), - datetime(1997, 9, 4, 9, 0) - ] - ) - - testRecurring('testUntilSingle', - new RRule({freq: RRule.DAILY, - count: 3, - dtstart: parse('19970902T090000'), - until: parse('19970902T090000') - }), - [ - datetime(1997, 9, 2, 9, 0) - ] - ) - - testRecurring('testUntilEmpty', - new RRule({freq: RRule.DAILY, - count: 3, - dtstart: parse('19970902T090000'), - until: parse('19970901T090000') - }), - [] - ) - - testRecurring('testUntilWithDate', - new RRule({freq: RRule.DAILY, - count: 3, - dtstart: parse('19970902T090000'), - until: datetime(1997, 9, 5) - }), - [ - datetime(1997, 9, 2, 9, 0), - datetime(1997, 9, 3, 9, 0), - datetime(1997, 9, 4, 9, 0) - ] - ) - - testRecurring('testWkStIntervalMO', - new RRule({freq: RRule.WEEKLY, - count: 3, - interval: 2, - byweekday: [RRule.TU, RRule.SU], - wkst: RRule.MO, - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 9, 2, 9, 0), - datetime(1997, 9, 7, 9, 0), - datetime(1997, 9, 16, 9, 0) - ] - ) - - testRecurring('testWkStIntervalSU', - new RRule({freq: RRule.WEEKLY, - count: 3, - interval: 2, - byweekday: [RRule.TU, RRule.SU], - wkst: RRule.SU, - dtstart: parse('19970902T090000') - }), - [ - datetime(1997, 9, 2, 9, 0), - datetime(1997, 9, 14, 9, 0), - datetime(1997, 9, 16, 9, 0) - ] - ) - - testRecurring('testDTStartIsDate', - new RRule({freq: RRule.DAILY, - count: 3, - dtstart: datetime(1997, 9, 2) - }), - [ - datetime(1997, 9, 2, 0, 0), - datetime(1997, 9, 3, 0, 0), - datetime(1997, 9, 4, 0, 0) - ] - ) - - testRecurring('testDTStartWithMicroseconds', - new RRule({freq: RRule.DAILY, - count: 3, - dtstart: parse('19970902T090000.5') - }), - [ - datetime(1997, 9, 2, 9, 0), - datetime(1997, 9, 3, 9, 0), - datetime(1997, 9, 4, 9, 0) - ] - ) - - testRecurring('testMaxYear', - new RRule({freq: RRule.YEARLY, - count: 3, - bymonth: 2, - bymonthday: 31, - dtstart: parse('99970902T090000') - }), - [] - ) - - testRecurring('testSubsecondStartYearly', - new RRule({ - freq: RRule.YEARLY, - count: 1, - dtstart: new Date(1420063200001) - }), - [ - new Date(1420063200001) - ] - ) - - testRecurring('testSubsecondStartMonthlyByMonthDay', - new RRule({ - freq: RRule.MONTHLY, - count: 1, - bysetpos: [-1, 1], - dtstart: new Date(1356991200001) - }), - [ - new Date(1356991200001) - ] - ) - - it('testAfterBefore', function () { - 'YEARLY,MONTHLY,DAILY,HOURLY,MINUTELY,SECONDLY'.split(',').forEach(function (freqStr: keyof typeof Frequency) { - const date = new Date(1356991200001) - const rr = new RRule({ - freq: RRule[freqStr], - dtstart: date - }) - - expect(date.getTime()).equals(rr.options.dtstart.getTime(), - 'the supplied dtstart differs from RRule.options.dtstart') - let res: Date = rr.before(rr.after(rr.options.dtstart)) - - let resTimestamp: number - if (res != null) resTimestamp = res.getTime() - expect(resTimestamp).equals(rr.options.dtstart.getTime(), - 'after dtstart , followed by before does not return dtstart') - }) - }) - - it('testConvertAndBack', function () { - [6, RRule.SU].forEach(function (wkst) { - const rr = new RRule({ - dtstart: new Date(Date.UTC(2017, 9, 17, 0, 30, 0, 0)), - until: new Date(Date.UTC(2017, 11, 22, 1, 30, 0, 0)), - freq: RRule.MONTHLY, - interval: 1, - bysetpos: 17, - byweekday: [RRule.SU, RRule.MO, RRule.TU, RRule.WE, RRule.TH, RRule.FR, RRule.SA], - wkst: wkst, - byhour: 11, - byminute: 0, - bysecond: 0 - }) - - const rrstr = rr.toString() - expect(rrstr).equals('DTSTART:20171017T003000Z\nRRULE:UNTIL=20171222T013000Z;FREQ=MONTHLY;INTERVAL=1;BYSETPOS=17;BYDAY=SU,MO,TU,WE,TH,FR,SA;WKST=SU;BYHOUR=11;BYMINUTE=0;BYSECOND=0') - const newrr = RRule.fromString(rrstr) - expect(rrstr).equals(newrr.toString()) - }) - }) - - it('testByHourValues', function () { - [ - ['DTSTART:20171101T010000Z\nRRULE:UNTIL=20171214T013000Z;FREQ=DAILY;INTERVAL=2;WKST=MO;BYHOUR=11,12;BYMINUTE=30;BYSECOND=0', 'every 2 days at 11 and 12 until December 13, 2017'], - ['DTSTART:20171101T010000Z\nRRULE:UNTIL=20171214T013000Z;FREQ=DAILY;INTERVAL=2;WKST=MO;BYHOUR=11;BYMINUTE=30;BYSECOND=0', 'every 2 days at 11 until December 13, 2017'] - ].forEach(function (pair) { - const rule = pair[0] - const rr = RRule.fromString(rule) - // tslint:disable-next-line:no-unused-expression - expect(rr.toText()).to.be.ok - // assert.equal(rr.toText(), pair[1]) -- can't test this because it reports in local time which varies by machine - }) - }) - - it('calculates daily recurrences correctly across DST boundaries', () => { - const rrule = RRule.fromString('DTSTART=20181101T110000Z;UNTIL=20181106T110000Z;FREQ=DAILY') - expect(rrule.all()).to.deep.equal([ - new Date('2018-11-01T11:00:00.000Z'), - new Date('2018-11-02T11:00:00.000Z'), - new Date('2018-11-03T11:00:00.000Z'), - new Date('2018-11-04T11:00:00.000Z'), - new Date('2018-11-05T11:00:00.000Z'), - new Date('2018-11-06T11:00:00.000Z') - ]) - }) - - it('calculates weekly recurrences correctly across DST boundaries', () => { - const rrule = RRule.fromString('DTSTART=20181031T180000Z\nRRULE:FREQ=WEEKLY;UNTIL=20181115T050000Z') - expect(rrule.all()).to.deep.equal([ - new Date('2018-10-31T18:00:00.000Z'), - new Date('2018-11-07T18:00:00.000Z'), - new Date('2018-11-14T18:00:00.000Z') - ]) - }) - - it('calculates byweekday recurrences correctly across DST boundaries', () => { - let rule = new RRule({ - freq: RRule.WEEKLY, - dtstart: new Date(Date.UTC(2018, 9, 0, 0, 0, 0)), - interval: 1, - byweekday: [RRule.SU, RRule.WE], - until: new Date(Date.UTC(2018, 9, 9, 0, 0, 0)) - }) - - expect(rule.all()).to.deep.equal([ - new Date('2018-09-30T00:00:00.000Z'), - new Date('2018-10-03T00:00:00.000Z'), - new Date('2018-10-07T00:00:00.000Z') - ]) - }) - - it('generates weekly events (#247)', () => { - const startEvent = 1533895200000 - const endSearch = 1543618799999 - - const rrule = new RRule({ - freq: RRule.WEEKLY, - interval: 1, - dtstart: new Date(startEvent), - until: new Date(endSearch) - }) - - expect(rrule.all()).to.deep.equal([ - new Date('2018-08-10T10:00:00.000Z'), - new Date('2018-08-17T10:00:00.000Z'), - new Date('2018-08-24T10:00:00.000Z'), - new Date('2018-08-31T10:00:00.000Z'), - new Date('2018-09-07T10:00:00.000Z'), - new Date('2018-09-14T10:00:00.000Z'), - new Date('2018-09-21T10:00:00.000Z'), - new Date('2018-09-28T10:00:00.000Z'), - new Date('2018-10-05T10:00:00.000Z'), - new Date('2018-10-12T10:00:00.000Z'), - new Date('2018-10-19T10:00:00.000Z'), - new Date('2018-10-26T10:00:00.000Z'), - new Date('2018-11-02T10:00:00.000Z'), - new Date('2018-11-09T10:00:00.000Z'), - new Date('2018-11-16T10:00:00.000Z'), - new Date('2018-11-23T10:00:00.000Z'), - new Date('2018-11-30T10:00:00.000Z') - ]) - }) - - it('generates monthly (#233)', () => { - const start = new Date(Date.parse('Mon Aug 06 2018 10:30:00 GMT+0530')) - const end = new Date(Date.parse('Mon Oct 08 2018 11:00:00 GMT+0530')) - - const rrule = new RRule({ - freq: RRule.MONTHLY, - interval: 1, - dtstart: start, - until: end - }) - - expect(rrule.all()).to.deep.equal([ - new Date('2018-08-06T05:00:00.000Z'), - new Date('2018-09-06T05:00:00.000Z'), - new Date('2018-10-06T05:00:00.000Z') - ]) - }) - - it('generates around dst (#249)', () => { - const ruleString = 'DTSTART:20181101T120000Z\nRRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=MO,WE,FR;COUNT=4;WKST=SU'; - const rrule = RRule.fromString(ruleString); - - expect(rrule.all()).to.deep.equal([ - new Date('2018-11-02T12:00:00.000Z'), - new Date('2018-11-05T12:00:00.000Z'), - new Date('2018-11-07T12:00:00.000Z'), - new Date('2018-11-09T12:00:00.000Z') - ]) - }) - - it('handles 3-digit years properly (#202)', () => { - const rrule = new RRule({ - count: 1, - dtstart: new Date(Date.UTC(990, 0, 1, 0, 0, 0)) - }) - const ruleString = rrule.toString() - const rrule2 = RRule.fromString(ruleString) - - expect(ruleString).to.equal('DTSTART:09900101T000000Z\nRRULE:COUNT=1') - expect(rrule2.count()).to.equal(1) - expect(rrule2.all()).to.deep.equal([ - new Date(Date.UTC(990, 0, 1, 0, 0, 0)) - ]) - }) - - describe('time zones', () => { - const targetZone = 'America/Los_Angeles' - const startDate = DateTime.utc(2013, 8, 6, 11, 0, 0) - const dtstart = startDate.toJSDate() - - it('generates correct recurrences when recurrence is in dst and current time is standard time', () => { - const currentLocalDate = DateTime.local(2013, 2, 6, 11, 0, 0) - setMockDate(currentLocalDate.toJSDate()) - - const rule = new RRule({ - dtstart, - count: 1, - tzid: targetZone - }) - const recurrence = rule.all()[0] - const expected = expectedDate(startDate, currentLocalDate, targetZone) - - expect(recurrence) - .to.deep.equal( - expected - ) - - resetMockDate() - }) - - it('generates correct recurrences when recurrence is in dst and current time is dst', () => { - const currentLocalDate = DateTime.local(2013, 8, 6, 11, 0, 0) - setMockDate(currentLocalDate.toJSDate()) - - const rule = new RRule({ - dtstart, - count: 1, - tzid: targetZone - }) - const recurrence = rule.all()[0] - const expected = expectedDate(startDate, currentLocalDate, targetZone) - - expect(recurrence) - .to.deep.equal( - expected - ) - - resetMockDate() - }) - - it('generates correct recurrences when recurrence is in dst and current time is standard time', () => { - const currentLocalDate = DateTime.local(2013, 2, 6, 11, 0, 0) - setMockDate(currentLocalDate.toJSDate()) - - const rule = new RRule({ - dtstart, - count: 1, - tzid: targetZone - }) - const recurrence = rule.after(new Date(0)) - const expected = expectedDate(startDate, currentLocalDate, targetZone) - - expect(recurrence) - .to.deep.equal( - expected - ) - - resetMockDate() - }) - }) - - it('throws an error when dtstart is invalid', () => { - const invalidDate = new Date(undefined) - const validDate = new Date(Date.UTC(2017, 0, 1)) - expect(() => new RRule({ dtstart: invalidDate })).to.throw('Invalid options: dtstart') - expect(() => new RRule({ dtstart: validDate, until: invalidDate })).to.throw('Invalid options: until') - - const rule = new RRule({ - dtstart: new Date(Date.UTC(2017, 0, 1)), - freq: Frequency.DAILY, - interval: 1 - }) - - expect(() => rule.after(invalidDate)).to.throw('Invalid date passed in to RRule.after') - expect(() => rule.before(invalidDate)).to.throw('Invalid date passed in to RRule.before') - expect(() => rule.between(invalidDate, validDate)).to.throw('Invalid date passed in to RRule.between') - expect(() => rule.between(validDate, invalidDate)).to.throw('Invalid date passed in to RRule.between') - }) -}) diff --git a/test/rruleset.test.ts b/test/rruleset.test.ts deleted file mode 100644 index 2fe7f0da..00000000 --- a/test/rruleset.test.ts +++ /dev/null @@ -1,788 +0,0 @@ -import { parse, datetime, testRecurring, expectedDate } from './lib/utils' -import { RRule, RRuleSet, rrulestr, Frequency } from '../src' -import { DateTime } from 'luxon' -import { expect } from 'chai' -import { set as setMockDate, reset as resetMockDate } from 'mockdate' - -describe('RRuleSet', function () { - // Enable additional toString() / fromString() tests - // for each testRecurring(). - // this.ctx.ALSO_TEST_STRING_FUNCTIONS = false - - // Thorough after()/before()/between() tests. - // NOTE: can take a longer time. - this.ctx.ALSO_TEST_BEFORE_AFTER_BETWEEN = true - - testRecurring('testSet', - function () { - const set = new RRuleSet() - - set.rrule(new RRule({ - freq: RRule.YEARLY, - count: 2, - byweekday: RRule.TU, - dtstart: parse('19970902T090000') - })) - set.rrule(new RRule({ - freq: RRule.YEARLY, - count: 1, - byweekday: RRule.TH, - dtstart: parse('19970902T090000') - })) - return set - }, - [ - datetime(1997, 9, 2, 9, 0), - datetime(1997, 9, 4, 9, 0), - datetime(1997, 9, 9, 9, 0) - ] - ) - - testRecurring('testSetDate', - function () { - const set = new RRuleSet() - - set.rrule(new RRule({ - freq: RRule.YEARLY, - count: 1, - byweekday: RRule.TU, - dtstart: parse('19970902T090000') - })) - set.rdate(datetime(1997, 9, 4, 9)) - set.rdate(datetime(1997, 9, 9, 9)) - return set - }, - [ - datetime(1997, 9, 2, 9, 0), - datetime(1997, 9, 4, 9, 0), - datetime(1997, 9, 9, 9, 0) - ] - ) - - testRecurring('testSetExRule', - function () { - const set = new RRuleSet() - - set.rrule(new RRule({ - freq: RRule.YEARLY, - count: 6, - byweekday: [RRule.TU, RRule.TH], - dtstart: parse('19970902T090000') - })) - set.exrule(new RRule({ - freq: RRule.YEARLY, - count: 3, - byweekday: RRule.TH, - dtstart: parse('19970902T090000') - })) - return set - }, - [ - datetime(1997, 9, 2, 9, 0), - datetime(1997, 9, 9, 9, 0), - datetime(1997, 9, 16, 9, 0) - ] - ) - - testRecurring('testSetExDate', - function () { - const set = new RRuleSet() - - set.rrule(new RRule({ - freq: RRule.YEARLY, - count: 6, - byweekday: [RRule.TU, RRule.TH], - dtstart: parse('19970902T090000') - })) - set.exdate(datetime(1997, 9, 4, 9)) - set.exdate(datetime(1997, 9, 11, 9)) - set.exdate(datetime(1997, 9, 18, 9)) - return set - }, - [ - datetime(1997, 9, 2, 9, 0), - datetime(1997, 9, 9, 9, 0), - datetime(1997, 9, 16, 9, 0) - ] - ) - - testRecurring('testSetExDateRevOrder', - function () { - const set = new RRuleSet() - - set.rrule(new RRule({ - freq: RRule.MONTHLY, - count: 5, - bymonthday: 10, - dtstart: parse('20040101T090000') - })) - set.exdate(datetime(2004, 4, 10, 9, 0)) - set.exdate(datetime(2004, 2, 10, 9, 0)) - return set - }, - [ - datetime(2004, 1, 10, 9, 0), - datetime(2004, 3, 10, 9, 0), - datetime(2004, 5, 10, 9, 0) - ] - ) - - testRecurring('testSetDateAndExDate', - function () { - const set = new RRuleSet() - - set.rdate(datetime(1997, 9, 2, 9)) - set.rdate(datetime(1997, 9, 4, 9)) - set.rdate(datetime(1997, 9, 9, 9)) - set.rdate(datetime(1997, 9, 11, 9)) - set.rdate(datetime(1997, 9, 16, 9)) - set.rdate(datetime(1997, 9, 18, 9)) - set.exdate(datetime(1997, 9, 4, 9)) - set.exdate(datetime(1997, 9, 11, 9)) - set.exdate(datetime(1997, 9, 18, 9)) - return set - }, - [ - datetime(1997, 9, 2, 9, 0), - datetime(1997, 9, 9, 9, 0), - datetime(1997, 9, 16, 9, 0) - ] - ) - - testRecurring('testSetDateAndExRule', - function () { - const set = new RRuleSet() - - set.rdate(datetime(1997, 9, 2, 9)) - set.rdate(datetime(1997, 9, 4, 9)) - set.rdate(datetime(1997, 9, 9, 9)) - set.rdate(datetime(1997, 9, 11, 9)) - set.rdate(datetime(1997, 9, 16, 9)) - set.rdate(datetime(1997, 9, 18, 9)) - set.exrule(new RRule({ - freq: RRule.YEARLY, - count: 3, - byweekday: RRule.TH, - dtstart: parse('19970902T090000') - })) - return set - }, - [ - datetime(1997, 9, 2, 9, 0), - datetime(1997, 9, 9, 9, 0), - datetime(1997, 9, 16, 9, 0) - ] - ) - - testRecurring('testSetCachePre', - function () { - const set = new RRuleSet() - - set.rrule(new RRule({ - freq: RRule.YEARLY, - count: 2, - byweekday: RRule.TU, - dtstart: parse('19970902T090000') - })) - set.rrule(new RRule({ - freq: RRule.YEARLY, - count: 1, - byweekday: RRule.TH, - dtstart: parse('19970902T090000') - })) - return set - }, - [ - datetime(1997, 9, 2, 9, 0), - datetime(1997, 9, 4, 9, 0), - datetime(1997, 9, 9, 9, 0) - ] - ) - - testRecurring('testSetCachePost', - function () { - const set = new RRuleSet() - - set.rrule(new RRule({ - freq: RRule.YEARLY, - count: 2, - byweekday: RRule.TU, - dtstart: parse('19970902T090000') - })) - set.rrule(new RRule({ - freq: RRule.YEARLY, - count: 1, - byweekday: RRule.TH, - dtstart: parse('19970902T090000') - })) - set.all() - return set - }, - [ - datetime(1997, 9, 2, 9, 0), - datetime(1997, 9, 4, 9, 0), - datetime(1997, 9, 9, 9, 0) - ] - ) - - testRecurring('testSetInfiniteAll', - function () { - const set = new RRuleSet() - - set.rrule(new RRule({ - freq: RRule.YEARLY, - dtstart: parse('19970902T090000') - })) - set.exrule(new RRule({ - freq: RRule.YEARLY, - count: 10, - dtstart: parse('19970902T090000') - })) - - return { - rrule: set, - method: 'all', - args: [ - function (_: any, count: number) { - return count < 3 - } - ] - } - }, - [ - datetime(2007, 9, 2, 9, 0), - datetime(2008, 9, 2, 9, 0), - datetime(2009, 9, 2, 9, 0) - ] - ) - - testRecurring('testSetInfiniteBetween', - function () { - const set = new RRuleSet() - - set.rrule(new RRule({ - freq: RRule.YEARLY, - dtstart: parse('19970902T090000') - })) - set.exrule(new RRule({ - freq: RRule.YEARLY, - count: 10, - dtstart: parse('19970902T090000') - })) - return { - rrule: set, - method: 'between', - args: [ - datetime(2000, 9, 2, 9, 0), - datetime(2010, 9, 2, 9, 0) - ] - } - }, - [ - datetime(2007, 9, 2, 9, 0), - datetime(2008, 9, 2, 9, 0), - datetime(2009, 9, 2, 9, 0) - ] - ) - - testRecurring('testSetInfiniteBefore', - function () { - const set = new RRuleSet() - - set.rrule(new RRule({ - freq: RRule.YEARLY, - dtstart: parse('19970902T090000') - })) - set.exrule(new RRule({ - freq: RRule.YEARLY, - count: 10, - dtstart: parse('19970902T090000') - })) - return { - rrule: set, - method: 'before', - args: [ - datetime(2015, 9, 2, 9, 0), - false - ] - } - }, - [ - datetime(2014, 9, 2, 9, 0) - ] - ) - - testRecurring('testSetInfiniteAfter', - function () { - const set = new RRuleSet() - - set.rrule(new RRule({ - freq: RRule.YEARLY, - dtstart: parse('19970902T090000') - })) - set.exrule(new RRule({ - freq: RRule.YEARLY, - count: 10, - dtstart: parse('19970902T090000') - })) - return { - rrule: set, - method: 'after', - args: [ - datetime(2000, 9, 2, 9, 0), - false - ] - } - }, - [ - datetime(2007, 9, 2, 9, 0) - ] - ) - - testRecurring('testBefore70', - function () { - const set = new RRuleSet() - - set.rrule(new RRule({ - freq: RRule.YEARLY, - count: 2, - dtstart: parse('19600101T090000') - })) - return { - rrule: set, - method: 'all' - } - }, - [ - datetime(1960, 1, 1, 9, 0), - datetime(1961, 1, 1, 9, 0) - ] - ) - - describe('valueOf', () => { - it('generates rrule strings correctly', () => { - const set = new RRuleSet() - - set.rrule(new RRule({ - freq: RRule.YEARLY, - count: 2, - dtstart: parse('19600101T090000') - })) - - expect(set.valueOf()).to.deep.equal([ - "DTSTART:19600101T090000Z", - "RRULE:FREQ=YEARLY;COUNT=2" - ]) - }) - - it('generates multiline rules', () => { - const set = new RRuleSet() - - set.rrule(new RRule({ - freq: RRule.YEARLY, - count: 2, - dtstart: parse('19600101T090000') - })) - - set.rrule(new RRule({ - freq: RRule.WEEKLY, - count: 3, - })) - - expect(set.valueOf()).to.deep.equal([ - "DTSTART:19600101T090000Z", - "RRULE:FREQ=YEARLY;COUNT=2", - "RRULE:FREQ=WEEKLY;COUNT=3" - ]) - }) - - it('generates rules with tzid', () => { - const set = new RRuleSet() - - set.rrule(new RRule({ - freq: RRule.YEARLY, - count: 2, - dtstart: parse('19600101T090000'), - tzid: 'America/New_York' - })) - - set.rrule(new RRule({ - freq: RRule.WEEKLY, - count: 3, - })) - - expect(set.valueOf()).to.deep.equal([ - "DTSTART;TZID=America/New_York:19600101T090000", - "RRULE:FREQ=YEARLY;COUNT=2", - "RRULE:FREQ=WEEKLY;COUNT=3" - ]) - }) - - it('generates a value with RDATE with tzid', () => { - const set = new RRuleSet() - - set.rrule(new RRule({ - freq: RRule.YEARLY, - count: 2, - dtstart: parse('19600101T090000'), - tzid: 'America/New_York' - })) - - set.rdate( - parse('19610201T090000'), - ) - - set.rdate( - parse('19610301T090000'), - ) - - expect(set.valueOf()).to.deep.equal([ - "DTSTART;TZID=America/New_York:19600101T090000", - "RRULE:FREQ=YEARLY;COUNT=2", - "RDATE;TZID=America/New_York:19610201T090000,19610301T090000" - ]) - }) - - it('generates a string with RDATE with TZID when no RRULE is present', () => { - const set = new RRuleSet() - - set.tzid('America/New_York') - - set.rdate( - parse('19610201T090000'), - ) - - set.rdate( - parse('19610301T090000'), - ) - - expect(set.toString()).to.deep.equal( - "RDATE;TZID=America/New_York:19610201T090000,19610301T090000" - ) - }) - - it('generates a string with RDATE in UTC when no RRULE is present', () => { - const set = new RRuleSet() - - set.tzid('UTC') - - set.rdate( - parse('19610201T090000'), - ) - - set.rdate( - parse('19610301T090000'), - ) - - expect(set.toString()).to.deep.equal( - "RDATE:19610201T090000Z,19610301T090000Z" - ) - }) - - it('parses RDATE strings without an RRULE', () => { - const set = rrulestr("RDATE;TZID=America/New_York:19610201T090000,19610301T090000") as RRuleSet - expect(set).to.be.instanceof(RRuleSet) - expect(set.tzid()).to.equal('America/New_York') - }) - - it('generates EXDATE with tzid', () => { - const set = new RRuleSet() - - set.rrule(new RRule({ - freq: RRule.YEARLY, - count: 2, - dtstart: parse('19600101T090000'), - tzid: 'America/New_York' - })) - - set.exdate( - parse('19610201T090000'), - ) - - set.exdate( - parse('19610301T090000'), - ) - - expect(set.valueOf()).to.deep.equal([ - "DTSTART;TZID=America/New_York:19600101T090000", - "RRULE:FREQ=YEARLY;COUNT=2", - "EXDATE;TZID=America/New_York:19610201T090000,19610301T090000" - ]) - }) - - it('generates correcty zoned recurrences when a tzid is present', () => { - const targetZone = 'America/New_York' - const currentLocalDate = DateTime.local(2000, 2, 6, 11, 0, 0) - setMockDate(currentLocalDate.toJSDate()) - - const set = new RRuleSet() - - set.rrule(new RRule({ - freq: RRule.YEARLY, - count: 4, - dtstart: DateTime.fromISO('20000101T090000').toJSDate(), - tzid: targetZone - })) - - set.exdate( - DateTime.fromISO('20010101T090000').toJSDate(), - ) - - set.rdate( - DateTime.fromISO('20020301T090000').toJSDate(), - ) - - expect(set.all()).to.deep.equal([ - expectedDate(DateTime.fromISO('20000101T090000'), currentLocalDate, targetZone), - expectedDate(DateTime.fromISO('20020101T090000'), currentLocalDate, targetZone), - expectedDate(DateTime.fromISO('20020301T090000'), currentLocalDate, targetZone), - expectedDate(DateTime.fromISO('20030101T090000'), currentLocalDate, targetZone), - ]) - - resetMockDate() - }) - - it('permits only an rdate with a timezone', () => { - const set = new RRuleSet() - set.tzid('America/Los_Angeles') - set.rdate(new Date(Date.UTC(2010, 10, 10, 10, 0, 0))) - - expect(set.valueOf()).to.deep.equal(['RDATE;TZID=America/Los_Angeles:20101110T100000']) - expect(set.toString()).to.equal('RDATE;TZID=America/Los_Angeles:20101110T100000') - - const set2 = rrulestr(set.toString()) - expect(set2.toString()).to.equal('RDATE;TZID=America/Los_Angeles:20101110T100000') - }) - - it('generates correcty zoned recurrences when a tzid is present but no rrule is present', () => { - const targetZone = 'America/New_York' - const currentLocalDate = DateTime.local(2000, 2, 6, 11, 0, 0) - setMockDate(currentLocalDate.toJSDate()) - - const set = new RRuleSet() - - set.tzid(targetZone) - - set.rdate( - DateTime.fromISO('20020301T090000').toJSDate(), - ) - - expect(set.all()).to.deep.equal([ - expectedDate(DateTime.fromISO('20020301T090000'), currentLocalDate, targetZone) - ]) - - resetMockDate() - }) - }) - - describe('with end date', () => { - let cursor: DateTime - - beforeEach(() => { - cursor = DateTime.utc(2017, 12, 25, 16, 0, 0) - }) - - it('updates the ruleset to exclude recurrence date', () => { - const legacy = ['RRULE:DTSTART=19990104T110000Z;FREQ=DAILY;INTERVAL=1'] - const repeat = ['DTSTART:19990104T110000Z', 'RRULE:FREQ=DAILY;INTERVAL=1'] - - const recurrenceDate = DateTime.utc(2017, 8, 21, 16, 0, 0) - - expectRecurrence([repeat, legacy]).toAmendExdate(recurrenceDate, [ - 'DTSTART:19990104T110000Z', - 'RRULE:FREQ=DAILY;INTERVAL=1', - 'EXDATE:20170821T160000Z', - ]) - }) - - it('updates the ruleset to exclude recurrence rule', () => { - const legacy = ['RRULE:DTSTART=19990104T110000Z;FREQ=DAILY;INTERVAL=1'] - const repeat = ['DTSTART:19990104T110000Z', 'RRULE:FREQ=DAILY;INTERVAL=1'] - - const exrule = new RRule({ - dtstart: new Date(Date.UTC(1999, 0, 4, 11, 0, 0)), - freq: Frequency.WEEKLY, - interval: 2, - count: 1 - }) - - expectRecurrence([repeat, legacy]).toAmendExrule(exrule, [ - 'DTSTART:19990104T110000Z', - 'RRULE:FREQ=DAILY;INTERVAL=1', - 'EXRULE:FREQ=WEEKLY;INTERVAL=2;COUNT=1' - ]) - }) - - it('updates a never-ending recurrence with an end date', () => { - const legacy = ['RRULE:DTSTART=20171201T080000Z;FREQ=WEEKLY'] - const original = ['DTSTART:20171201T080000Z', 'RRULE:FREQ=WEEKLY'] - - expectRecurrence([original, legacy]).toBeUpdatedWithEndDate([ - 'DTSTART:20171201T080000Z', - 'RRULE:FREQ=WEEKLY;UNTIL=20171224T235959Z', - ].join('\n')) - }) - - it('replaces an existing end date with a new one', () => { - const legacy = [ - 'RRULE:DTSTART=20171201T080000Z;FREQ=WEEKLY;UNTIL=20180301T080000Z', - ] - const original = [ - 'DTSTART:20171201T080000Z', - 'RRULE:FREQ=WEEKLY;UNTIL=20180301T080000Z', - ] - - expectRecurrence([original, legacy]).toBeUpdatedWithEndDate([ - 'DTSTART:20171201T080000Z', - 'RRULE:FREQ=WEEKLY;UNTIL=20171224T235959Z', - ].join('\n')) - }) - - it('handles rule in a timezone', () => { - const legacy = [ - 'RRULE:DTSTART;TZID=America/New_York:20171201T080000;FREQ=WEEKLY', - ] - const original = [ - 'DTSTART;TZID=America/New_York:20171201T080000', - 'RRULE:FREQ=WEEKLY', - ] - - expectRecurrence([original, legacy]).toBeUpdatedWithEndDate([ - 'DTSTART;TZID=America/New_York:20171201T080000', - 'RRULE:FREQ=WEEKLY;UNTIL=20171224T235959', - ].join('\n')) - }) - - const updateWithEndDate = ( - recurrence: string[], - updatedCursor: DateTime, - ): string => { - const newEndDate = updatedCursor.minus({ days: 1 }).endOf('day') - - const rrule = rrulestr(recurrence.join('\n')) - - const newRuleSet = new RRuleSet() - const rule = new RRule({ - ...rrule.origOptions, - until: newEndDate.toJSDate(), - }) - - newRuleSet.rrule(rule) - - return newRuleSet.toString() - } - - const amendRuleSetWithExceptionDate = ( - recurrence: string[], - cursor: DateTime, - ): string => { - const ruleSet = rrulestr(recurrence.join('\n'), { forceset: true }) as RRuleSet - ruleSet.exdate(cursor.toJSDate()) - return ruleSet.toString() - } - - const amendRuleSetWithExceptionRule = ( - recurrence: string[], - exrule: RRule, - ): string => { - const ruleSet = rrulestr(recurrence.join('\n'), { forceset: true }) as RRuleSet - ruleSet.exrule(exrule) - return ruleSet.toString() - } - - function expectRecurrence(recurrences: string[][]) { - return { - toAmendExrule(excluded: RRule, expected: string[]) { - recurrences.forEach(recurrence => { - const actual = amendRuleSetWithExceptionRule(recurrence, excluded) - expect(actual).to.equal(expected.join('\n')) - }) - }, - toAmendExdate(excluded: DateTime, expected: string[]) { - recurrences.forEach(recurrence => { - const actual = amendRuleSetWithExceptionDate(recurrence, excluded) - expect(actual).to.equal(expected.join('\n')) - }) - }, - toBeUpdatedWithEndDate(expected: string) { - recurrences.forEach(recurrence => { - const actual = updateWithEndDate(recurrence, cursor) - expect(actual).to.equal(expected) - }) - }, - } - } - }) - - it('generates invalid date objects on an rruleset with invalid TZID and exdate', () => { - const set = new RRuleSet() - set.rrule(new RRule({ - count: 1, - dtstart: parse('19970902T090000'), - tzid: 'America/Unknown' - })) - set.exdate(parse('19970902T090000')) - - expect(set.all().map(String)).to.deep.equal([ - 'Invalid Date' - ]) - }) - - it('throws an error if non-rrules are added via rrule or exrule', () => { - const set = new RRuleSet() - - expect(() => set.rrule('foo' as any)).to.throw() - expect(() => set.exrule('foo' as any)).to.throw() - }) - - it('throws an error if non-dates are added via rdate or exdate', () => { - const set = new RRuleSet() - - expect(() => set.rdate('foo' as any)).to.throw() - expect(() => set.exdate('foo' as any)).to.throw() - }) - - describe('getters', () => { - it('rrules()', () => { - let set = new RRuleSet(); - let rrule = new RRule({ - freq: RRule.YEARLY, - count: 2, - dtstart: parse('19600101T090000'), - tzid: 'America/New_York' - }); - set.rrule(rrule); - - expect(set.rrules().map(e => e.toString())).eql([rrule.toString()]); - }); - - it('exrules()', () => { - let set = new RRuleSet(); - let rrule = new RRule({ - freq: RRule.YEARLY, - count: 2, - dtstart: parse('19600101T090000'), - tzid: 'America/New_York' - }); - set.exrule(rrule); - - expect(set.exrules().map(e => e.toString())).eql([rrule.toString()]); - }); - - it('rdates()', () => { - let set = new RRuleSet(); - let dt = parse('19610201T090000'); - set.rdate(dt); - - expect(set.rdates()).eql([dt]); - }); - - it('exdates()', () => { - let set = new RRuleSet(); - let dt = parse('19610201T090000'); - set.exdate(dt); - - expect(set.exdates()).eql([dt]); - }); - }); -}); \ No newline at end of file diff --git a/test/rrulestr.test.ts b/test/rrulestr.test.ts deleted file mode 100644 index 1ae2d511..00000000 --- a/test/rrulestr.test.ts +++ /dev/null @@ -1,409 +0,0 @@ -import { parse, datetime, datetimeUTC, testRecurring } from './lib/utils' -import { RRule, RRuleSet, rrulestr, Frequency } from '../src' -import { expect } from 'chai' -import { Days } from '../src/rrule'; -import { parseInput } from '../src/rrulestr'; - -describe('rrulestr', function () { - // Enable additional toString() / fromString() tests - // for each testRecurring(). - this.ctx.ALSO_TEST_STRING_FUNCTIONS = false - - // Enable additional toText() / fromText() tests - // for each testRecurring(). - // Many of the tests fail because the conversion is only approximate, - // but it gives an idea about how well or bad it converts. - this.ctx.ALSO_TEST_NLP_FUNCTIONS = false - - // Thorough after()/before()/between() tests. - // NOTE: can take a longer time. - this.ctx.ALSO_TEST_BEFORE_AFTER_BETWEEN = true - - it('parses an rrule', () => { - expect(rrulestr( - 'DTSTART:19970902T090000Z\n' + - 'RRULE:FREQ=YEARLY;COUNT=3\n' - )).to.be.instanceof(RRule) - }) - - it('parses an rrule without frequency', () => { - const rRuleString = 'DTSTART:19970902T090000Z'; - const parsedRRuleSet = rrulestr( - rRuleString, { forceset: true } - ) as RRuleSet; - expect(parsedRRuleSet.toString()).to.be.equal(rRuleString); - - const parsedRRule = rrulestr(rRuleString) as RRule; - expect(parsedRRule.toString()).to.be.equal(rRuleString); - }) - - it('parses an rruleset when forceset=true', () => { - expect(rrulestr( - 'DTSTART:19970902T090000Z\n' + - 'RRULE:FREQ=YEARLY;COUNT=3\n', - { - forceset: true - } - )).to.be.instanceof(RRuleSet) - }) - - it('parses an rruleset when there are multiple rrules', () => { - expect(rrulestr( - 'DTSTART:19970902T090000Z\n' + - 'RRULE:FREQ=YEARLY;COUNT=2;BYDAY=TU\n' + - 'RRULE:FREQ=YEARLY;COUNT=1;BYDAY=TH\n' - )).to.be.instanceof(RRuleSet) - }) - - testRecurring('testStr', - rrulestr( - 'DTSTART:19970902T090000Z\n' + - 'RRULE:FREQ=YEARLY;COUNT=3\n' - ), - [ - datetimeUTC(1997, 9, 2, 9, 0), - datetimeUTC(1998, 9, 2, 9, 0), - datetimeUTC(1999, 9, 2, 9, 0) - ] - ) - - testRecurring('testStrCase', - rrulestr( - 'dtstart:19970902T090000Z\n' + - 'rrule:freq=yearly;count=3\n' - ), - [ - datetimeUTC(1997, 9, 2, 9, 0), - datetimeUTC(1998, 9, 2, 9, 0), - datetimeUTC(1999, 9, 2, 9, 0) - ] - ) - - testRecurring('testStrSpaces', - rrulestr( - ' DTSTART:19970902T090000Z ' + - ' RRULE:FREQ=YEARLY;COUNT=3 ' - ), - [ - datetimeUTC(1997, 9, 2, 9, 0), - datetimeUTC(1998, 9, 2, 9, 0), - datetimeUTC(1999, 9, 2, 9, 0) - ] - ) - - testRecurring('testStrSpacesAndLines', - rrulestr( - ' DTSTART:19970902T090000Z \n' + - ' \n RRULE:FREQ=YEARLY;COUNT=3 \n' - ), - [ - datetimeUTC(1997, 9, 2, 9, 0), - datetimeUTC(1998, 9, 2, 9, 0), - datetimeUTC(1999, 9, 2, 9, 0) - ] - ) - - testRecurring('testStrNoDTStart', - rrulestr( - 'RRULE:FREQ=YEARLY;COUNT=3\n', - { - dtstart: parse('19970902T090000') - } - ), - [ - datetime(1997, 9, 2, 9, 0), - datetime(1998, 9, 2, 9, 0), - datetime(1999, 9, 2, 9, 0) - ] - ) - - testRecurring('testStrValueOnly', - rrulestr( - 'FREQ=YEARLY;COUNT=3\n', - { - dtstart: parse('19970902T090000') - } - ), - [ - datetime(1997, 9, 2, 9, 0), - datetime(1998, 9, 2, 9, 0), - datetime(1999, 9, 2, 9, 0) - ] - ) - - testRecurring('testStrUnfold', - rrulestr( - 'FREQ=YEA\n RLY;COUNT=3\n', - { - unfold: true, - dtstart: parse('19970902T090000') - } - ), - [ - datetime(1997, 9, 2, 9, 0), - datetime(1998, 9, 2, 9, 0), - datetime(1999, 9, 2, 9, 0) - ] - ) - - testRecurring('testStrSet', - rrulestr( - 'DTSTART:19970902T090000Z\n' + - 'RRULE:FREQ=YEARLY;COUNT=2;BYDAY=TU\n' + - 'RRULE:FREQ=YEARLY;COUNT=1;BYDAY=TH\n' - ), - [ - datetimeUTC(1997, 9, 2, 9, 0), - datetimeUTC(1997, 9, 4, 9, 0), - datetimeUTC(1997, 9, 9, 9, 0) - ] - ) - - testRecurring('testStrSetDate', - rrulestr( - 'DTSTART:19970902T090000Z\n' + - 'RRULE:FREQ=YEARLY;COUNT=1;BYDAY=TU\n' + - 'RDATE:19970904T090000Z\n' + - 'RDATE:19970909T090000Z\n' - ), - [ - datetimeUTC(1997, 9, 2, 9, 0), - datetimeUTC(1997, 9, 4, 9, 0), - datetimeUTC(1997, 9, 9, 9, 0) - ] - ) - - testRecurring('testStrSetExRule', - rrulestr( - 'DTSTART:19970902T090000Z\n' + - 'RRULE:FREQ=YEARLY;COUNT=6;BYDAY=TU,TH\n' + - 'EXRULE:FREQ=YEARLY;COUNT=3;BYDAY=TH\n' - ), - [ - datetimeUTC(1997, 9, 2, 9, 0), - datetimeUTC(1997, 9, 9, 9, 0), - datetimeUTC(1997, 9, 16, 9, 0) - ] - ) - - testRecurring('testStrSetExDate', - rrulestr( - 'DTSTART:19970902T090000Z\n' + - 'RRULE:FREQ=YEARLY;COUNT=6;BYDAY=TU,TH\n' + - 'EXDATE:19970904T090000Z\n' + - 'EXDATE:19970911T090000Z\n' + - 'EXDATE:19970918T090000Z\n' - ), - [ - datetimeUTC(1997, 9, 2, 9, 0), - datetimeUTC(1997, 9, 9, 9, 0), - datetimeUTC(1997, 9, 16, 9, 0) - ] - ) - - testRecurring('testStrSetDateAndExDate', - rrulestr( - 'DTSTART:19970902T090000Z\n' + - 'RDATE:19970902T090000Z\n' + - 'RDATE:19970904T090000Z\n' + - 'RDATE:19970909T090000Z\n' + - 'RDATE:19970911T090000Z\n' + - 'RDATE:19970916T090000Z\n' + - 'RDATE:19970918T090000Z\n' + - 'EXDATE:19970904T090000Z\n' + - 'EXDATE:19970911T090000Z\n' + - 'EXDATE:19970918T090000Z\n' - ), - [ - datetimeUTC(1997, 9, 2, 9, 0), - datetimeUTC(1997, 9, 9, 9, 0), - datetimeUTC(1997, 9, 16, 9, 0) - ] - ) - - testRecurring('testStrSetDateAndExRule', - rrulestr( - 'DTSTART:19970902T090000Z\n' + - 'RDATE:19970902T090000Z\n' + - 'RDATE:19970904T090000Z\n' + - 'RDATE:19970909T090000Z\n' + - 'RDATE:19970911T090000Z\n' + - 'RDATE:19970916T090000Z\n' + - 'RDATE:19970918T090000Z\n' + - 'EXRULE:FREQ=YEARLY;COUNT=3;BYDAY=TH\n' - ), - [ - datetimeUTC(1997, 9, 2, 9, 0), - datetimeUTC(1997, 9, 9, 9, 0), - datetimeUTC(1997, 9, 16, 9, 0) - ] - ) - - testRecurring('testStrKeywords', - rrulestr( - 'DTSTART:19970902T030000Z\n' + - 'RRULE:FREQ=YEARLY;COUNT=3;INTERVAL=3;' + - 'BYMONTH=3;byweekday=TH;BYMONTHDAY=3;' + - 'BYHOUR=3;BYMINUTE=3;BYSECOND=3\n' - ), - [ - datetimeUTC(2033, 3, 3, 3, 3, 3), - datetimeUTC(2039, 3, 3, 3, 3, 3), - datetimeUTC(2072, 3, 3, 3, 3, 3) - ] - ) - - testRecurring('testStrNWeekDay', - rrulestr( - 'DTSTART:19970902T090000Z\n' + - 'RRULE:FREQ=YEARLY;COUNT=3;BYDAY=1TU,-1TH\n' - ), - [ - datetimeUTC(1997, 12, 25, 9, 0), - datetimeUTC(1998, 1, 6, 9, 0), - datetimeUTC(1998, 12, 31, 9, 0) - ] - ) - - testRecurring('testStrNWeekDayLarge', - rrulestr( - 'DTSTART:19970902T090000Z\n' + - 'RRULE:FREQ=YEARLY;COUNT=3;BYDAY=13TU,-13TH\n' - ), - [ - datetimeUTC(1997, 10, 2, 9, 0), - datetimeUTC(1998, 3, 31, 9, 0), - datetimeUTC(1998, 10, 8, 9, 0) - ] - ) - - it('parses without TZID', () => { - const rrule = rrulestr( - 'DTSTART:19970902T090000\nRRULE:FREQ=WEEKLY' - ) - - expect(rrule.origOptions).to.deep.include({ - freq: Frequency.WEEKLY, - dtstart: new Date(Date.UTC(1997, 8, 2, 9, 0, 0)), - }) - }) - - it('parses TZID', () => { - const rrule = rrulestr( - 'DTSTART;TZID=America/New_York:19970902T090000\n' + - 'RRULE:FREQ=DAILY;UNTIL=19980902T090000' - ) - - expect(rrule.origOptions).to.deep.include({ - tzid: 'America/New_York', - freq: Frequency.DAILY, - dtstart: new Date(Date.UTC(1997, 8, 2, 9, 0, 0)), - until: new Date(Date.UTC(1998, 8, 2, 9, 0, 0)) - }) - }) - - it('parses a DTSTART inside an RRULE', () => { - const rrule = rrulestr( - 'RRULE:UNTIL=19990404T110000Z;DTSTART=19990104T110000Z;FREQ=WEEKLY;BYDAY=TU,WE' - ) - - expect(rrule.options).to.deep.include({ - until: new Date(Date.UTC(1999, 3, 4, 11, 0, 0)), - dtstart: new Date(Date.UTC(1999, 0, 4, 11, 0, 0)), - freq: Frequency.WEEKLY, - byweekday: [Days.TU.weekday, Days.WE.weekday] - }) - }) - - it('parses a DTSTART with a TZID inside an RRULE', () => { - const rrule = rrulestr( - 'RRULE:UNTIL=19990404T110000Z;DTSTART;TZID=America/New_York:19990104T110000Z;FREQ=WEEKLY;BYDAY=TU,WE' - ) - - expect(rrule.options).to.deep.include({ - until: new Date(Date.UTC(1999, 3, 4, 11, 0, 0)), - dtstart: new Date(Date.UTC(1999, 0, 4, 11, 0, 0)), - freq: Frequency.WEEKLY, - tzid: 'America/New_York', - byweekday: [Days.TU.weekday, Days.WE.weekday] - }) - }) - - it('parses a DTSTART if it is the first param', () => { - const rrule = rrulestr( - "RRULE:DTSTART;TZID=America/Los_Angeles:20180719T111500;FREQ=DAILY;INTERVAL=1" - ) - - expect(rrule.options).to.deep.include({ - dtstart: new Date(Date.UTC(2018, 6, 19, 11, 15, 0)), - freq: Frequency.DAILY, - interval: 1, - tzid: 'America/Los_Angeles' - }) - }) - - it('parses an RDATE with no TZID param', () => { - const rruleset = rrulestr( - "DTSTART:20180719T111500Z\n"+ - "RRULE:FREQ=DAILY;INTERVAL=1\n" + - "RDATE:20180720T111500Z\n"+ - "EXDATE:20180721T111500Z" - ) as RRuleSet - - expect(rruleset.valueOf()).to.deep.equal([ - "DTSTART:20180719T111500Z", - "RRULE:FREQ=DAILY;INTERVAL=1", - "RDATE:20180720T111500Z", - "EXDATE:20180721T111500Z" - ]) - }) - - it('parses an RDATE with a TZID param', () => { - const rruleset = rrulestr( - "DTSTART;TZID=America/Los_Angeles:20180719T111500\n"+ - "RRULE:FREQ=DAILY;INTERVAL=1\n" + - "RDATE;TZID=America/Los_Angeles:20180720T111500\n"+ - "EXDATE;TZID=America/Los_Angeles:20180721T111500" - ) as RRuleSet - - expect(rruleset.valueOf()).to.deep.equal([ - "DTSTART;TZID=America/Los_Angeles:20180719T111500", - "RRULE:FREQ=DAILY;INTERVAL=1", - "RDATE;TZID=America/Los_Angeles:20180720T111500", - "EXDATE;TZID=America/Los_Angeles:20180721T111500" - ]) - }) -}) - -describe('parseInput', () => { - it('parses an input into a structure', () => { - const output = parseInput( - 'DTSTART;TZID=America/New_York:19970902T090000\n' + - 'RRULE:FREQ=DAILY;UNTIL=19980902T090000;INTERVAL=1\n' + - 'RDATE:19970902T090000Z\n' + - 'RDATE:19970904T090000Z\n' + - 'EXDATE:19970904T090000Z\n' + - 'EXRULE:FREQ=WEEKLY;INTERVAL=2\n' - , {}) - expect(output).to.deep.include({ - dtstart: new Date(Date.UTC(1997, 8, 2, 9, 0, 0)), - tzid: 'America/New_York', - rrulevals: [{ - interval: 1, - freq: Frequency.DAILY, - until: new Date(Date.UTC(1998, 8, 2, 9, 0, 0)) - }], - exdatevals: [ - new Date(Date.UTC(1997, 8, 4, 9, 0, 0)), - ], - rdatevals: [ - new Date(Date.UTC(1997, 8, 2, 9, 0, 0)), - new Date(Date.UTC(1997, 8, 4, 9, 0, 0)), - ], - exrulevals: [{ - interval: 2, - freq: Frequency.WEEKLY - }] - }) - }) -}) diff --git a/test/tslint.json b/test/tslint.json deleted file mode 100644 index bc325e44..00000000 --- a/test/tslint.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "extends": ["../tslint"], - "no-unused-expression": false -} diff --git a/tsconfig.json b/tsconfig.json index 35747320..523ab517 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,6 +1,6 @@ { "compilerOptions": { - "outDir": "./dist/esm", + "outDir": "./dist", "declaration": true, "declarationMap": true, "noImplicitAny": true, @@ -12,8 +12,7 @@ "jsx": "react", "strictNullChecks": true, "importHelpers": true, - "rootDirs": ["./src/", "./test/", "./demo/"] + "rootDirs": ["./"] }, - "include": ["./src/**/*", "./demo/**/*"], - "exclude": ["node_modules", "./test/**/*"] + "exclude": ["node_modules", "dist"] } diff --git a/tsconfig.test.json b/tsconfig.test.json deleted file mode 100644 index 69243529..00000000 --- a/tsconfig.test.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "compilerOptions": { - "outDir": "./dist/es6", - "declaration": true, - "noImplicitAny": true, - "sourceMap": true, - "module": "commonjs", - "noEmitOnError": true, - "target": "es6", - "jsx": "react", - "baseUrl": ".", - "rootDirs": [ - "./src/", - "./test/", - ] - }, - "include": [ - "./src/**/*", - "./test/**/*" - ], - "exclude": [ - "node_modules", - ] -} \ No newline at end of file diff --git a/tslint.json b/tslint.json deleted file mode 100644 index 17689398..00000000 --- a/tslint.json +++ /dev/null @@ -1,144 +0,0 @@ -{ - "extends": ["tslint-eslint-rules"], - "rules": { - // TSLint rules. - "no-internal-module": true, - "typedef-whitespace": [ - true, - { - "call-signature": "nospace", - "index-signature": "nospace", - "parameter": "nospace", - "property-declaration": "nospace", - "variable-declaration": "nospace" - }, - { - "call-signature": "onespace", - "index-signature": "onespace", - "parameter": "onespace", - "property-declaration": "onespace", - "variable-declaration": "onespace" - } - ], - "await-promise": true, - "curly": [true, "ignore-same-line"], - "deprecation": true, - "label-position": true, - "no-arg": true, - "no-conditional-assignment": true, - "no-duplicate-imports": true, - "no-duplicate-variable": true, - "no-empty": true, - "no-eval": true, - "no-reference-import": true, - "no-return-await": true, - "no-switch-case-fall-through": true, - "no-unused-expression": [ - true, - "allow-fast-null-checks", - "allow-tagged-template" - ], - "no-var-keyword": true, - "radix": true, - "space-within-parens": [true, 0], - "triple-equals": [true, "allow-null-check"], - "use-isnan": true, - "eofline": true, - "ter-indent": [ - true, - 2, - { - "SwitchCase": 1 - } - ], - "no-trailing-whitespace": true, - "trailing-comma": [ - true, - { - "multiline": "never", - "singleline": "never" - } - ], - "class-name": true, - "comment-format": [true, "check-space"], - "jsdoc-format": true, - "new-parens": true, - "no-angle-bracket-type-assertion": true, - "no-consecutive-blank-lines": true, - "no-floating-promises": true, - "no-misused-new": true, - "no-string-throw": true, - "no-unnecessary-qualifier": true, - "no-unnecessary-type-assertion": true, - "one-line": [ - true, - "check-catch", - "check-finally", - "check-else", - "check-open-brace", - "check-whitespace" - ], - "one-variable-per-declaration": true, - "quotemark": [true, "single", "avoid-escape", "jsx-single"], - "semicolon": [true, "never"], - "space-before-function-paren": [true, "always"], - "unified-signatures": true, - "variable-name": [ - true, - "ban-keywords", - "check-format", - "allow-leading-underscore", - "allow-pascal-case" - ], - "whitespace": [ - true, - "check-branch", - "check-decl", - "check-operator", - // 'check-module', - "check-rest-spread", - "check-type", - "check-typecast", - "check-type-operator", - "check-preblock" - ], - // TSLint ESLint rules. - "no-constant-condition": [ - true, - { - "checkLoops": false - } - ], - "no-control-regex": true, - "no-duplicate-case": true, - "no-empty-character-class": true, - "no-ex-assign": true, - "no-extra-boolean-cast": true, - "no-inner-declarations": [true, "functions"], - "no-invalid-regexp": true, - "ter-no-irregular-whitespace": true, - "no-regex-spaces": true, - "ter-no-sparse-arrays": true, - "ter-func-call-spacing": [true, "never"], - "no-unexpected-multiline": true, - "valid-typeof": true, - "ter-arrow-spacing": [ - true, - { - "before": true, - "after": true - } - ], - "no-multi-spaces": true, - "handle-callback-err": [true, "^(err|error)$"], - "block-spacing": [true, "always"], - "brace-style": [ - true, - "1tbs", - { - "allowSingleLine": true - } - ], - "object-curly-spacing": [true, "always"] - } -} diff --git a/webpack.config.js b/webpack.config.js index a764dd9f..0aa242d1 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -6,66 +6,12 @@ const UglifyJsPlugin = require('uglifyjs-webpack-plugin'); const paths = { demo: { - source: path.resolve(__dirname, 'demo'), - styles: path.resolve(__dirname, "demo", "demo.css"), - template: path.resolve(__dirname, "demo", "index.html") + source: path.resolve(__dirname), + styles: path.resolve(__dirname, "demo.css"), + template: path.resolve(__dirname, "index.html") }, - source: path.resolve(__dirname, 'src'), - demoDist: path.resolve(__dirname, "dist", "esm", "demo"), - es5: path.resolve(__dirname, "dist", "es5"), - esm: path.resolve(__dirname, "dist", "esm") }; -const commonConfig = { - output: { - filename: '[name].js', - path: paths.es5, - library: 'rrule', - libraryTarget: 'umd', - globalObject: "typeof self !== 'undefined' ? self : this" - }, - devtool: 'source-map', - mode: 'production', - resolve: { - extensions: ['.js', '.ts'] - }, - module: { - rules: [ - { - exclude: /node_modules/, - loader: "ts-loader", - test: /\.ts$/ - } - ] - }, - optimization: { - minimize: true, - minimizer: [ - new UglifyJsPlugin({ - exclude: /\.ts$/, - include: /\.min\.js$/ - }) - ] - } -}; - -const rruleConfig = Object.assign({ - entry: { - rrule: path.join(paths.source, "index.ts"), - 'rrule.min': path.join(paths.source, "index.ts") - }, - plugins: [ - new webpack.NormalModuleReplacementPlugin(/^luxon$/, './fake-luxon.ts'), - ] -}, commonConfig); - -const rruleWithLuxonConfig = Object.assign({ - entry: { - 'rrule-tz': path.join(paths.source, "index.ts"), - 'rrule-tz.min': path.join(paths.source, "index.ts") - }, -}, commonConfig); - const demoConfig = { entry: { demo: path.join(paths.demo.source, "demo.ts"), @@ -110,4 +56,4 @@ const demoConfig = { mode: "production" }; -module.exports = [rruleConfig, rruleWithLuxonConfig, demoConfig]; +module.exports = [demoConfig]; diff --git a/yarn.lock b/yarn.lock index b510ef7a..0e3c4f42 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,147 +2,17 @@ # yarn lockfile v1 -"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.5.5": - version "7.5.5" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.5.5.tgz#bc0782f6d69f7b7d49531219699b988f669a8f9d" - integrity sha512-27d4lZoomVyo51VegxI20xZPuSHusqbQag/ztrBC7wegWoQ1nLREPVSKSW8byhTlzTKyNE4ifaTA6lCp7JjpFw== - dependencies: - "@babel/highlight" "^7.0.0" - -"@babel/generator@^7.4.0", "@babel/generator@^7.7.4": - version "7.7.4" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.7.4.tgz#db651e2840ca9aa66f327dcec1dc5f5fa9611369" - integrity sha512-m5qo2WgdOJeyYngKImbkyQrnUN1mPceaG5BV+G0E3gWsa4l/jCSryWJdM2x8OuGAOyh+3d5pVYfZWCiNFtynxg== - dependencies: - "@babel/types" "^7.7.4" - jsesc "^2.5.1" - lodash "^4.17.13" - source-map "^0.5.0" - -"@babel/helper-function-name@^7.7.4": - version "7.7.4" - resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.7.4.tgz#ab6e041e7135d436d8f0a3eca15de5b67a341a2e" - integrity sha512-AnkGIdiBhEuiwdoMnKm7jfPfqItZhgRaZfMg1XX3bS25INOnLPjPG1Ppnajh8eqgt5kPJnfqrRHqFqmjKDZLzQ== - dependencies: - "@babel/helper-get-function-arity" "^7.7.4" - "@babel/template" "^7.7.4" - "@babel/types" "^7.7.4" - -"@babel/helper-get-function-arity@^7.7.4": - version "7.7.4" - resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.7.4.tgz#cb46348d2f8808e632f0ab048172130e636005f0" - integrity sha512-QTGKEdCkjgzgfJ3bAyRwF4yyT3pg+vDgan8DSivq1eS0gwi+KGKE5x8kRcbeFTb/673mkO5SN1IZfmCfA5o+EA== - dependencies: - "@babel/types" "^7.7.4" - -"@babel/helper-split-export-declaration@^7.7.4": - version "7.7.4" - resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.7.4.tgz#57292af60443c4a3622cf74040ddc28e68336fd8" - integrity sha512-guAg1SXFcVr04Guk9eq0S4/rWS++sbmyqosJzVs8+1fH5NI+ZcmkaSkc7dmtAFbHFva6yRJnjW3yAcGxjueDug== - dependencies: - "@babel/types" "^7.7.4" - -"@babel/highlight@^7.0.0": - version "7.5.0" - resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.5.0.tgz#56d11312bd9248fa619591d02472be6e8cb32540" - integrity sha512-7dV4eu9gBxoM0dAnj/BCFDW9LFU0zvTrkq0ugM7pnHEgguOEeOz1so2ZghEdzviYzQEED0r4EAgpsBChKy1TRQ== - dependencies: - chalk "^2.0.0" - esutils "^2.0.2" - js-tokens "^4.0.0" - -"@babel/parser@^7.4.3", "@babel/parser@^7.7.4": - version "7.7.5" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.7.5.tgz#cbf45321619ac12d83363fcf9c94bb67fa646d71" - integrity sha512-KNlOe9+/nk4i29g0VXgl8PEXIRms5xKLJeuZ6UptN0fHv+jDiriG+y94X6qAgWTR0h3KaoM1wK5G5h7MHFRSig== - -"@babel/template@^7.4.0", "@babel/template@^7.7.4": - version "7.7.4" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.7.4.tgz#428a7d9eecffe27deac0a98e23bf8e3675d2a77b" - integrity sha512-qUzihgVPguAzXCK7WXw8pqs6cEwi54s3E+HrejlkuWO6ivMKx9hZl3Y2fSXp9i5HgyWmj7RKP+ulaYnKM4yYxw== - dependencies: - "@babel/code-frame" "^7.0.0" - "@babel/parser" "^7.7.4" - "@babel/types" "^7.7.4" - -"@babel/traverse@^7.4.3": - version "7.7.4" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.7.4.tgz#9c1e7c60fb679fe4fcfaa42500833333c2058558" - integrity sha512-P1L58hQyupn8+ezVA2z5KBm4/Zr4lCC8dwKCMYzsa5jFMDMQAzaBNy9W5VjB+KAmBjb40U7a/H6ao+Xo+9saIw== - dependencies: - "@babel/code-frame" "^7.5.5" - "@babel/generator" "^7.7.4" - "@babel/helper-function-name" "^7.7.4" - "@babel/helper-split-export-declaration" "^7.7.4" - "@babel/parser" "^7.7.4" - "@babel/types" "^7.7.4" - debug "^4.1.0" - globals "^11.1.0" - lodash "^4.17.13" - -"@babel/types@^7.4.0", "@babel/types@^7.7.4": - version "7.7.4" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.7.4.tgz#516570d539e44ddf308c07569c258ff94fde9193" - integrity sha512-cz5Ji23KCi4T+YIE/BolWosrJuSmoZeN1EFnRtBwF+KKLi8GG/Z2c2hOJJeCXPk4mwk4QFvTmwIodJowXgttRA== - dependencies: - esutils "^2.0.2" - lodash "^4.17.13" - to-fast-properties "^2.0.0" - -"@bcoe/v8-coverage@^0.2.3": - version "0.2.3" - resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" - integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== - -"@types/assert@^1.4.3": - version "1.4.3" - resolved "https://registry.yarnpkg.com/@types/assert/-/assert-1.4.3.tgz#c3b68c062a2375647d1b9efc41e57f8286bb30fe" - integrity sha512-491hfOvNr0+BGOHT2m36xJ+LK68IuOshvxV0VIrKOnzBDL11WlDa3PwO+drTYkwCdfzJRN9REcDPZVVcrx1ucw== - -"@types/chai@^4.2.7": - version "4.2.7" - resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.2.7.tgz#1c8c25cbf6e59ffa7d6b9652c78e547d9a41692d" - integrity sha512-luq8meHGYwvky0O7u0eQZdA7B4Wd9owUCqvbw2m3XCrCU8mplYOujMBbvyS547AxJkC+pGnd0Cm15eNxEUNU8g== - -"@types/is-windows@^0.2.0": - version "0.2.0" - resolved "https://registry.yarnpkg.com/@types/is-windows/-/is-windows-0.2.0.tgz#6f24ee48731d31168ea510610d6dd15e5fc9c6ff" - integrity sha1-byTuSHMdMRaOpRBhDW3RXl/Jxv8= - -"@types/istanbul-lib-coverage@^2.0.1": - version "2.0.1" - resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.1.tgz#42995b446db9a48a11a07ec083499a860e9138ff" - integrity sha512-hRJD2ahnnpLgsj6KWMYSrmXkM3rm2Dl1qkx6IOFD5FnuNPXJIG5L0dhgKXCYTRMGzU4n0wImQ/xfmRc4POUFlg== - "@types/jquery@^3.3.29": version "3.3.29" resolved "https://registry.yarnpkg.com/@types/jquery/-/jquery-3.3.29.tgz#680a2219ce3c9250483722fccf5570d1e2d08abd" dependencies: "@types/sizzle" "*" -"@types/luxon@^1.21.0": - version "1.21.0" - resolved "https://registry.yarnpkg.com/@types/luxon/-/luxon-1.21.0.tgz#db792d29f535d49522cb6d94dd9da053efc950a1" - integrity sha512-Zhrf65tpjOlVIYrUhX9eu1VzRo8iixQDLFPbfqFxPpG4pBTNNPZ2BFhYE0IAsDfW9GWg+RcrUqiLwrGJH4rq4w== - -"@types/mocha@^5.2.5": - version "5.2.5" - resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-5.2.5.tgz#8a4accfc403c124a0bafe8a9fc61a05ec1032073" - -"@types/mockdate@^2.0.0": - version "2.0.0" - resolved "https://registry.yarnpkg.com/@types/mockdate/-/mockdate-2.0.0.tgz#aaf388a1ead3b0f5ed6dc1611956ea7b40a57d3c" - "@types/node@^12.12.18": version "12.12.18" resolved "https://registry.yarnpkg.com/@types/node/-/node-12.12.18.tgz#8d16634797d63c2af5bc647ce879f8de20b56469" integrity sha512-DBkZuIMFuAfjJHiunyRc+aNvmXYNwV1IPMgGKGlwCp6zh6MKrVtmvjSWK/axWcD25KJffkXgkfvFra8ndenXAw== -"@types/normalize-package-data@^2.4.0": - version "2.4.0" - resolved "https://registry.yarnpkg.com/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz#e486d0d97396d79beedd0a6e33f4534ff6b4973e" - integrity sha512-f5j5b/Gf71L+dbqxIpQ4Z2WlmI/mPJ0fOkGGmFgtb6sAu97EPczzbS3/tJKxmcYDj55OX6ssqwDAWOHIYDRDGA== - "@types/sizzle@*": version "2.3.2" resolved "https://registry.yarnpkg.com/@types/sizzle/-/sizzle-2.3.2.tgz#a811b8c18e2babab7d542b3365887ae2e4d9de47" @@ -328,11 +198,6 @@ ajv@^6.1.0, ajv@^6.10.2: json-schema-traverse "^0.4.1" uri-js "^4.2.2" -ansi-colors@3.2.3: - version "3.2.3" - resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-3.2.3.tgz#57d35b8686e851e2cc04c403f1c00203976a1813" - integrity sha512-LEHHyuhlPY3TmuUYMh2oz89lTShfvgbmzaBcxve9t/9Wuy7Dwf4yoAKcND7KFT1HAQfqZ12qtc+DUrBMeKF9nw== - ansi-colors@^3.0.0: version "3.2.4" resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-3.2.4.tgz#e3a3da4bfbae6c86a9c285625de124a234026fbf" @@ -343,11 +208,6 @@ ansi-regex@^2.0.0: resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" integrity sha1-w7M6te42DYbg5ijwRorn7yfWVN8= -ansi-regex@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" - integrity sha1-7QMXwyIGT3lGbAKWa922Bas32Zg= - ansi-regex@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.1.0.tgz#8b9f8f08cf1acb843756a839ca8c7e3168c51997" @@ -368,33 +228,11 @@ anymatch@^2.0.0: micromatch "^3.1.4" normalize-path "^2.1.1" -append-transform@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/append-transform/-/append-transform-1.0.0.tgz#046a52ae582a228bd72f58acfbe2967c678759ab" - integrity sha512-P009oYkeHyU742iSZJzZZywj4QRJdnTWffaKuJQLablCZ1uz6/cW4yaRgcDaoQ+uwOxxnt0gRUcwfsNP2ri0gw== - dependencies: - default-require-extensions "^2.0.0" - aproba@^1.1.1: version "1.2.0" resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a" integrity sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw== -archy@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/archy/-/archy-1.0.0.tgz#f9c8c13757cc1dd7bc379ac77b2c62a5c2868c40" - -arg@^4.1.0: - version "4.1.2" - resolved "https://registry.yarnpkg.com/arg/-/arg-4.1.2.tgz#e70c90579e02c63d80e3ad4e31d8bfdb8bd50064" - integrity sha512-+ytCkGcBtHZ3V2r2Z06AncYO8jz46UEamcspGoU8lHcEbpn6J77QK0vdWvChsclg/tM5XIJC5tnjmPp7Eq6Obg== - -argparse@^1.0.7: - version "1.0.10" - resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" - dependencies: - sprintf-js "~1.0.2" - arr-diff@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-4.0.0.tgz#d6461074febfec71e7e15235761a329a5dc7c520" @@ -446,11 +284,6 @@ assert@^1.1.1: object-assign "^4.1.1" util "0.10.3" -assertion-error@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/assertion-error/-/assertion-error-1.1.0.tgz#e60b6b0e8f301bd97e5375215bda406c85118c0b" - integrity sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw== - assign-symbols@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367" @@ -566,10 +399,6 @@ brorand@^1.0.1: resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f" integrity sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8= -browser-stdout@1.3.1: - version "1.3.1" - resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.1.tgz#baa559ee14ced73452229bad7326467c61fabd60" - browserify-aes@^1.0.0, browserify-aes@^1.0.4: version "1.2.0" resolved "https://registry.yarnpkg.com/browserify-aes/-/browserify-aes-1.2.0.tgz#326734642f403dabc3003209853bb70ad428ef48" @@ -648,33 +477,11 @@ buffer@^4.3.0: ieee754 "^1.1.4" isarray "^1.0.0" -builtin-modules@^1.0.0, builtin-modules@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f" - builtin-status-codes@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz#85982878e21b98e1c66425e03d0174788f569ee8" integrity sha1-hZgoeOIbmOHGZCXgPQF0eI9Wnug= -c8@^5.0.1: - version "5.0.4" - resolved "https://registry.yarnpkg.com/c8/-/c8-5.0.4.tgz#a247fd6a4cbc19b33dae17178a7d903a8dd7fa79" - integrity sha512-MgWIJ3HYe4NTtqwD+v16OdHvfqSzSLOmsptMuUxkzsYMoZzEeUv3yVep2d84qFjgio/3WbVEd9bkYQCFSDKeMw== - dependencies: - "@bcoe/v8-coverage" "^0.2.3" - find-up "^4.0.0" - foreground-child "^2.0.0" - furi "^1.3.0" - istanbul-lib-coverage "^2.0.5" - istanbul-lib-report "^2.0.8" - istanbul-reports "^2.2.6" - rimraf "^3.0.0" - test-exclude "^5.2.3" - v8-to-istanbul "^3.2.3" - yargs "^14.0.0" - yargs-parser "^14.0.0" - cacache@^12.0.2, cacache@^12.0.3: version "12.0.3" resolved "https://registry.yarnpkg.com/cacache/-/cacache-12.0.3.tgz#be99abba4e1bf5df461cd5a2c1071fc432573390" @@ -711,35 +518,6 @@ cache-base@^1.0.1: union-value "^1.0.0" unset-value "^1.0.0" -caching-transform@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/caching-transform/-/caching-transform-3.0.2.tgz#601d46b91eca87687a281e71cef99791b0efca70" - integrity sha512-Mtgcv3lh3U0zRii/6qVgQODdPA4G3zhG+jtbCWj39RXuUFTMzH0vcdMtaJS1jPowd+It2Pqr6y3NJMQqOqCE2w== - dependencies: - hasha "^3.0.0" - make-dir "^2.0.0" - package-hash "^3.0.0" - write-file-atomic "^2.4.2" - -caller-callsite@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/caller-callsite/-/caller-callsite-2.0.0.tgz#847e0fce0a223750a9a027c54b33731ad3154134" - integrity sha1-hH4PzgoiN1CpoCfFSzNzGtMVQTQ= - dependencies: - callsites "^2.0.0" - -caller-path@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/caller-path/-/caller-path-2.0.0.tgz#468f83044e369ab2010fac5f06ceee15bb2cb1f4" - integrity sha1-Ro+DBE42mrIBD6xfBs7uFbsssfQ= - dependencies: - caller-callsite "^2.0.0" - -callsites@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/callsites/-/callsites-2.0.0.tgz#06eb84f00eea413da86affefacbffb36093b3c50" - integrity sha1-BuuE8A7qQT2oav/vrL/7Ngk7PFA= - camel-case@3.0.x: version "3.0.0" resolved "https://registry.yarnpkg.com/camel-case/-/camel-case-3.0.0.tgz#ca3c3688a4e9cf3a4cda777dc4dcbc713249cf73" @@ -752,19 +530,7 @@ camelcase@^5.0.0: resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== -chai@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/chai/-/chai-4.2.0.tgz#760aa72cf20e3795e84b12877ce0e83737aa29e5" - integrity sha512-XQU3bhBukrOsQCuwZndwGcCVQHyZi53fQ6Ys1Fym7E4olpIqqZZhhoFJoaKVvV17lWQoXYwgWN2nF5crA8J2jw== - dependencies: - assertion-error "^1.1.0" - check-error "^1.0.2" - deep-eql "^3.0.1" - get-func-name "^2.0.0" - pathval "^1.1.0" - type-detect "^4.0.5" - -chalk@2.4.2, chalk@^2.0.1, chalk@^2.4.2: +chalk@2.4.2: version "2.4.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== @@ -773,7 +539,7 @@ chalk@2.4.2, chalk@^2.0.1, chalk@^2.4.2: escape-string-regexp "^1.0.5" supports-color "^5.3.0" -chalk@^2.0.0, chalk@^2.3.0: +chalk@^2.3.0: version "2.4.1" resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.1.tgz#18c49ab16a037b6eb0152cc83e3471338215b66e" dependencies: @@ -781,11 +547,6 @@ chalk@^2.0.0, chalk@^2.3.0: escape-string-regexp "^1.0.5" supports-color "^5.3.0" -check-error@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/check-error/-/check-error-1.0.2.tgz#574d312edd88bb5dd8912e9286dd6c0aed4aac82" - integrity sha1-V00xLt2Iu13YkS6Sht1sCu1KrII= - chokidar@^2.0.2: version "2.1.8" resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-2.1.8.tgz#804b3a7b6a99358c3c5c61e71d8728f041cff917" @@ -817,11 +578,6 @@ chrome-trace-event@^1.0.2: dependencies: tslib "^1.9.0" -ci-info@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-2.0.0.tgz#67a9e964be31a51e15e5010d58e6f12834002f46" - integrity sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ== - cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3: version "1.0.4" resolved "https://registry.yarnpkg.com/cipher-base/-/cipher-base-1.0.4.tgz#8760e4ecc272f4c363532f926d874aae2c1397de" @@ -873,7 +629,7 @@ color-name@1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.1.tgz#4b1415304cf50028ea81643643bd82ea05803689" -commander@2.16.x, commander@^2.12.1, commander@~2.16.0: +commander@2.16.x, commander@~2.16.0: version "2.16.0" resolved "https://registry.yarnpkg.com/commander/-/commander-2.16.0.tgz#f16390593996ceb4f3eeb020b31d78528f7f8a50" @@ -917,13 +673,6 @@ constants-browserify@^1.0.0: resolved "https://registry.yarnpkg.com/constants-browserify/-/constants-browserify-1.0.0.tgz#c20b96d8c617748aaf1c16021760cd27fcb8cb75" integrity sha1-wguW2MYXdIqvHBYCF2DNJ/y4y3U= -convert-source-map@^1.6.0: - version "1.7.0" - resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.7.0.tgz#17a2cb882d7f77d3490585e2ce6c524424a3a442" - integrity sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA== - dependencies: - safe-buffer "~5.1.1" - copy-concurrently@^1.0.0: version "1.0.5" resolved "https://registry.yarnpkg.com/copy-concurrently/-/copy-concurrently-1.0.5.tgz#92297398cae34937fcafd6ec8139c18051f0b5e0" @@ -964,40 +713,6 @@ core-util-is@~1.0.0: resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac= -cosmiconfig@^5.2.1: - version "5.2.1" - resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-5.2.1.tgz#040f726809c591e77a17c0a3626ca45b4f168b1a" - integrity sha512-H65gsXo1SKjf8zmrJ67eJk8aIRKV5ff2D4uKZIBZShbhGSpEmsQOPW/SKMKYhSTrqR7ufy6RP69rPogdaPh/kA== - dependencies: - import-fresh "^2.0.0" - is-directory "^0.3.1" - js-yaml "^3.13.1" - parse-json "^4.0.0" - -coverage@^0.4.1: - version "0.4.1" - resolved "https://registry.yarnpkg.com/coverage/-/coverage-0.4.1.tgz#71297733f6f54af749f64a58520dbae8d81ca966" - integrity sha512-Nwe6RSpwaUR6R++b5QukGrbu3rpeSOGZ805f6IXwG63pIaJZ7NV5osfDgJ43Fz0B9IwXha+jwArWB8Tpngi8lA== - dependencies: - c8 "^5.0.1" - foreground-child "^1.5.6" - normalize-package-data "^2.5.0" - slash "^3.0.0" - test-exclude "^5.2.3" - which "^1.3.1" - yargs-parser "^13.1.1" - -cp-file@^6.2.0: - version "6.2.0" - resolved "https://registry.yarnpkg.com/cp-file/-/cp-file-6.2.0.tgz#40d5ea4a1def2a9acdd07ba5c0b0246ef73dc10d" - integrity sha512-fmvV4caBnofhPe8kOcitBwSn2f39QLjnAnGq3gO9dfd75mUytzKNZB1hde6QHunW2Rt+OwuBOMc3i1tNElbszA== - dependencies: - graceful-fs "^4.1.2" - make-dir "^2.0.0" - nested-error-stacks "^2.0.0" - pify "^4.0.1" - safe-buffer "^5.0.1" - create-ecdh@^4.0.0: version "4.0.3" resolved "https://registry.yarnpkg.com/create-ecdh/-/create-ecdh-4.0.3.tgz#c9111b6f33045c4697f144787f9254cdc77c45ff" @@ -1040,22 +755,6 @@ cross-spawn@6.0.5, cross-spawn@^6.0.0: shebang-command "^1.2.0" which "^1.2.9" -cross-spawn@^4: - version "4.0.2" - resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-4.0.2.tgz#7b9247621c23adfdd3856004a823cbe397424d41" - dependencies: - lru-cache "^4.0.1" - which "^1.2.9" - -cross-spawn@^7.0.0: - version "7.0.1" - resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.1.tgz#0ab56286e0f7c24e153d04cc2aa027e43a9a5d14" - integrity sha512-u7v4o84SwFpD32Z8IIcPZ6z1/ie24O6RU3RbtL5Y316l3KuHVPx9ItBgWQ6VlfAFnRnTtMUrsQ9MUUTuEZjogg== - dependencies: - path-key "^3.1.0" - shebang-command "^2.0.0" - which "^2.0.1" - crypto-browserify@^3.11.0: version "3.12.0" resolved "https://registry.yarnpkg.com/crypto-browserify/-/crypto-browserify-3.12.0.tgz#396cf9f3137f03e4b8e532c58f698254e00f80ec" @@ -1091,13 +790,6 @@ cyclist@^1.0.1: resolved "https://registry.yarnpkg.com/cyclist/-/cyclist-1.0.1.tgz#596e9698fd0c80e12038c2b82d6eb1b35b6224d9" integrity sha1-WW6WmP0MgOEgOMK4LW6xs1tiJNk= -debug@3.2.6: - version "3.2.6" - resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.6.tgz#e83d17de16d8a7efb7717edbe5fb10135eee629b" - integrity sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ== - dependencies: - ms "^2.1.1" - debug@^2.2.0, debug@^2.3.3: version "2.6.9" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" @@ -1105,13 +797,6 @@ debug@^2.2.0, debug@^2.3.3: dependencies: ms "2.0.0" -debug@^4.1.0, debug@^4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791" - integrity sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw== - dependencies: - ms "^2.1.1" - decamelize@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" @@ -1122,20 +807,6 @@ decode-uri-component@^0.2.0: resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545" integrity sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU= -deep-eql@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/deep-eql/-/deep-eql-3.0.1.tgz#dfc9404400ad1c8fe023e7da1df1c147c4b444df" - integrity sha512-+QeIQyN5ZuO+3Uk5DYh6/1eKO0m0YmJFGNmFHGACpf1ClL1nmlV/p4gNgbl2pJGxgXb4faqo6UE+M5ACEMyVcw== - dependencies: - type-detect "^4.0.0" - -default-require-extensions@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/default-require-extensions/-/default-require-extensions-2.0.0.tgz#f5f8fbb18a7d6d50b21f641f649ebb522cfe24f7" - integrity sha1-9fj7sYp9bVCyH2QfZJ67Uiz+JPc= - dependencies: - strip-bom "^3.0.0" - define-properties@^1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.2.tgz#83a73f2fea569898fb737193c8f873caf6d45c94" @@ -1178,15 +849,6 @@ detect-file@^1.0.0: resolved "https://registry.yarnpkg.com/detect-file/-/detect-file-1.0.0.tgz#f0d66d03672a825cb1b73bdb3fe62310c8e552b7" integrity sha1-8NZtA2cqglyxtzvbP+YjEMjlUrc= -diff@3.5.0: - version "3.5.0" - resolved "https://registry.yarnpkg.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12" - -diff@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.1.tgz#0c667cb467ebbb5cea7f14f135cc2dba7780a8ff" - integrity sha512-s2+XdvhPCOF01LRQBC8hf4vhbVmI2CGS5aZnxLJlT5FtdhPCDFq80q++zK2KlrVorVDdL5BOGZ/VfLrVtYNF+Q== - diffie-hellman@^5.0.0: version "5.0.3" resolved "https://registry.yarnpkg.com/diffie-hellman/-/diffie-hellman-5.0.3.tgz#40e8ee98f55a2149607146921c63e1ae5f3d2875" @@ -1203,13 +865,6 @@ dir-glob@^2.0.0: arrify "^1.0.1" path-type "^3.0.0" -doctrine@0.7.2: - version "0.7.2" - resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-0.7.2.tgz#7cb860359ba3be90e040b26b729ce4bfa654c523" - dependencies: - esutils "^1.1.6" - isarray "0.0.1" - dom-converter@~0.1: version "0.1.4" resolved "https://registry.yarnpkg.com/dom-converter/-/dom-converter-0.1.4.tgz#a45ef5727b890c9bffe6d7c876e7b19cb0e17f3b" @@ -1323,12 +978,6 @@ errno@^0.1.3, errno@~0.1.7: dependencies: prr "~1.0.1" -error-ex@^1.3.1: - version "1.3.2" - resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" - dependencies: - is-arrayish "^0.2.1" - es-abstract@^1.5.1: version "1.12.0" resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.12.0.tgz#9dbbdd27c6856f0001421ca18782d786bf8a6165" @@ -1347,12 +996,7 @@ es-to-primitive@^1.1.1: is-date-object "^1.0.1" is-symbol "^1.0.1" -es6-error@^4.0.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/es6-error/-/es6-error-4.1.1.tgz#9e3af407459deed47e9a91f9b885a84eb05c561d" - integrity sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg== - -escape-string-regexp@1.0.5, escape-string-regexp@^1.0.5: +escape-string-regexp@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" @@ -1364,10 +1008,6 @@ eslint-scope@^4.0.3: esrecurse "^4.1.0" estraverse "^4.1.1" -esprima@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" - esrecurse@^4.1.0: version "4.2.1" resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.2.1.tgz#007a3b9fdbc2b3bb87e4879ea19c92fdbd3942cf" @@ -1380,14 +1020,6 @@ estraverse@^4.1.0, estraverse@^4.1.1: resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.3.0.tgz#398ad3f3c5a24948be7725e83d11a7de28cdbd1d" integrity sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw== -esutils@^1.1.6: - version "1.1.6" - resolved "https://registry.yarnpkg.com/esutils/-/esutils-1.1.6.tgz#c01ccaa9ae4b897c6d0c3e210ae52f3c7a844375" - -esutils@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" - events@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/events/-/events-3.0.0.tgz#9a0a0dfaf62893d92b875b8f2698ca4114973e88" @@ -1509,21 +1141,13 @@ find-cache-dir@^2.1.0: make-dir "^2.0.0" pkg-dir "^3.0.0" -find-up@3.0.0, find-up@^3.0.0: +find-up@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/find-up/-/find-up-3.0.0.tgz#49169f1d7993430646da61ecc5ae355c21c97b73" integrity sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg== dependencies: locate-path "^3.0.0" -find-up@^4.0.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/find-up/-/find-up-4.1.0.tgz#97afe7d6cdc0bc5928584b7c8d7b16e8a9aa5d19" - integrity sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw== - dependencies: - locate-path "^5.0.0" - path-exists "^4.0.0" - findup-sync@3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/findup-sync/-/findup-sync-3.0.0.tgz#17b108f9ee512dfb7a5c7f3c8b27ea9e1a9c08d1" @@ -1534,13 +1158,6 @@ findup-sync@3.0.0: micromatch "^3.0.4" resolve-dir "^1.0.1" -flat@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/flat/-/flat-4.1.0.tgz#090bec8b05e39cba309747f1d588f04dbaf98db2" - integrity sha512-Px/TiLIznH7gEDlPXcUD4KnBusa6kR6ayRUVcnEAbreRIuhkqow/mun59BuRXwoYk7ZQOLW1ZM05ilIvK38hFw== - dependencies: - is-buffer "~2.0.3" - flush-write-stream@^1.0.0: version "1.1.1" resolved "https://registry.yarnpkg.com/flush-write-stream/-/flush-write-stream-1.1.1.tgz#8dd7d873a1babc207d94ead0c2e0e44276ebf2e8" @@ -1558,21 +1175,6 @@ foreach@^2.0.5: version "2.0.5" resolved "https://registry.yarnpkg.com/foreach/-/foreach-2.0.5.tgz#0bee005018aeb260d0a3af3ae658dd0136ec1b99" -foreground-child@^1.5.6: - version "1.5.6" - resolved "https://registry.yarnpkg.com/foreground-child/-/foreground-child-1.5.6.tgz#4fd71ad2dfde96789b980a5c0a295937cb2f5ce9" - dependencies: - cross-spawn "^4" - signal-exit "^3.0.0" - -foreground-child@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/foreground-child/-/foreground-child-2.0.0.tgz#71b32800c9f15aa8f2f83f4a6bd9bff35d861a53" - integrity sha512-dCIq9FpEcyQyXKCkyzmlPTFNgrCzPudOe+mhvJU5zAtlBnGVy2yKxtfsxK2tQBThwq225jcvBjpw1Gr40uzZCA== - dependencies: - cross-spawn "^7.0.0" - signal-exit "^3.0.2" - fragment-cache@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/fragment-cache/-/fragment-cache-0.2.1.tgz#4290fad27f13e89be7f33799c6bc5a0abfff0d19" @@ -1615,28 +1217,11 @@ function-bind@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" -furi@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/furi/-/furi-1.3.0.tgz#5fd4186d805ae80a3acd29efaf954761003391f8" - integrity sha512-TYoXEeRLKHXNWcCBP0VH1psPktQ9G8Y0GfZwMXCvwVbhbfNx7JItKWhB5mMBYufNjqxEHq+Ivd1nLtr5vQyVoQ== - dependencies: - "@types/is-windows" "^0.2.0" - is-windows "^1.0.2" - get-caller-file@^2.0.1: version "2.0.5" resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== -get-func-name@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/get-func-name/-/get-func-name-2.0.0.tgz#ead774abee72e20409433a066366023dd6887a41" - -get-stdin@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-7.0.0.tgz#8d5de98f15171a125c5e516643c7a6d0ea8a96f6" - integrity sha512-zRKcywvrXlXsA0v0i9Io4KDRaAw7+a1ZpjRwl9Wox8PFlVCCHra7E9c4kqXCoCM9nR5tBkaTTZRBoCm60bFqTQ== - get-stream@^4.0.0: version "4.1.0" resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-4.1.0.tgz#c1b255575f3dc21d59bfc79cd3d2b46b1c3a54b5" @@ -1657,10 +1242,9 @@ glob-parent@^3.1.0: is-glob "^3.1.0" path-dirname "^1.0.0" -glob@7.1.3: - version "7.1.3" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1" - integrity sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ== +glob@^7.1.2: + version "7.1.2" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15" dependencies: fs.realpath "^1.0.0" inflight "^1.0.4" @@ -1669,7 +1253,7 @@ glob@7.1.3: once "^1.3.0" path-is-absolute "^1.0.0" -glob@^7.0.5, glob@^7.1.3, glob@^7.1.4: +glob@^7.1.3, glob@^7.1.4: version "7.1.6" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.6.tgz#141f33b81a7c2492e125594307480c46679278a6" integrity sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA== @@ -1681,17 +1265,6 @@ glob@^7.0.5, glob@^7.1.3, glob@^7.1.4: once "^1.3.0" path-is-absolute "^1.0.0" -glob@^7.1.1, glob@^7.1.2: - version "7.1.2" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15" - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.4" - once "^1.3.0" - path-is-absolute "^1.0.0" - global-modules@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/global-modules/-/global-modules-2.0.0.tgz#997605ad2345f27f51539bea26574421215c7780" @@ -1728,10 +1301,6 @@ global-prefix@^3.0.0: kind-of "^6.0.2" which "^1.3.1" -globals@^11.1.0: - version "11.7.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-11.7.0.tgz#a583faa43055b1aca771914bf68258e2fc125673" - globby@^7.1.1: version "7.1.1" resolved "https://registry.yarnpkg.com/globby/-/globby-7.1.1.tgz#fb2ccff9401f8600945dfada97440cca972b8680" @@ -1752,30 +1321,10 @@ graceful-fs@^4.1.15, graceful-fs@^4.1.2: resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.3.tgz#4a12ff1b60376ef09862c2093edd908328be8423" integrity sha512-a30VEBm4PEdx1dRB7MFK7BejejvCvBronbLjht+sHuGYj8PHs7M/5Z+rt5lw551vZ7yfTCj4Vuyy3mSJytDWRQ== -growl@1.10.5: - version "1.10.5" - resolved "https://registry.yarnpkg.com/growl/-/growl-1.10.5.tgz#f2735dc2283674fa67478b10181059355c369e5e" - -handlebars@^4.1.2: - version "4.5.3" - resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.5.3.tgz#5cf75bd8714f7605713511a56be7c349becb0482" - integrity sha512-3yPecJoJHK/4c6aZhSvxOyG4vJKDshV36VHp0iVCDVh7o9w2vwi3NSnL2MMPj3YdduqaBcu7cGbggJQM0br9xA== - dependencies: - neo-async "^2.6.0" - optimist "^0.6.1" - source-map "^0.6.1" - optionalDependencies: - uglify-js "^3.1.4" - has-flag@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" -has-symbols@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.1.tgz#9f5214758a44196c406d9bd76cebf81ec2dd31e8" - integrity sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg== - has-value@^0.3.1: version "0.3.1" resolved "https://registry.yarnpkg.com/has-value/-/has-value-0.3.1.tgz#7b1f58bada62ca827ec0a2078025654845995e1f" @@ -1829,22 +1378,10 @@ hash.js@^1.0.0, hash.js@^1.0.3: inherits "^2.0.3" minimalistic-assert "^1.0.1" -hasha@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/hasha/-/hasha-3.0.0.tgz#52a32fab8569d41ca69a61ff1a214f8eb7c8bd39" - integrity sha1-UqMvq4Vp1BymmmH/GiFPjrfIvTk= - dependencies: - is-stream "^1.0.1" - he@1.1.x: version "1.1.1" resolved "https://registry.yarnpkg.com/he/-/he-1.1.1.tgz#93410fd21b009735151f8868c2f271f3427e23fd" -he@1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f" - integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw== - hmac-drbg@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/hmac-drbg/-/hmac-drbg-1.0.1.tgz#d2745701025a6c775a6c545793ed502fc0c649a1" @@ -1861,10 +1398,6 @@ homedir-polyfill@^1.0.1: dependencies: parse-passwd "^1.0.0" -hosted-git-info@^2.1.4: - version "2.7.1" - resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.7.1.tgz#97f236977bd6e125408930ff6de3eec6281ec047" - html-minifier@^3.2.3: version "3.5.19" resolved "https://registry.yarnpkg.com/html-minifier/-/html-minifier-3.5.19.tgz#ed53c4b7326fe507bc3a1adbcc3bbb56660a2ebd" @@ -1903,23 +1436,6 @@ https-browserify@^1.0.0: resolved "https://registry.yarnpkg.com/https-browserify/-/https-browserify-1.0.0.tgz#ec06c10e0a34c0f2faf199f7fd7fc78fffd03c73" integrity sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM= -husky@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/husky/-/husky-3.1.0.tgz#5faad520ab860582ed94f0c1a77f0f04c90b57c0" - integrity sha512-FJkPoHHB+6s4a+jwPqBudBDvYZsoQW5/HBuMSehC8qDiCe50kpcxeqFoDSlow+9I6wg47YxBoT3WxaURlrDIIQ== - dependencies: - chalk "^2.4.2" - ci-info "^2.0.0" - cosmiconfig "^5.2.1" - execa "^1.0.0" - get-stdin "^7.0.0" - opencollective-postinstall "^2.0.2" - pkg-dir "^4.2.0" - please-upgrade-node "^3.2.0" - read-pkg "^5.2.0" - run-node "^1.0.0" - slash "^3.0.0" - ieee754@^1.1.4: version "1.1.13" resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.1.13.tgz#ec168558e95aa181fd87d37f55c32bbcb6708b84" @@ -1934,14 +1450,6 @@ ignore@^3.3.5: version "3.3.10" resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.3.10.tgz#0a97fb876986e8081c631160f8f9f389157f0043" -import-fresh@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-2.0.0.tgz#d81355c15612d386c61f9ddd3922d4304822a546" - integrity sha1-2BNVwVYS04bGH53dOSLUMEgipUY= - dependencies: - caller-path "^2.0.0" - resolve-from "^3.0.0" - import-local@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/import-local/-/import-local-2.0.0.tgz#55070be38a5993cf18ef6db7e961f5bee5c5a09d" @@ -2011,10 +1519,6 @@ is-accessor-descriptor@^1.0.0: dependencies: kind-of "^6.0.0" -is-arrayish@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" - is-binary-path@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-1.0.1.tgz#75f16642b480f187a711c814161fd3a4a7655898" @@ -2027,17 +1531,6 @@ is-buffer@^1.1.5: resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w== -is-buffer@~2.0.3: - version "2.0.4" - resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-2.0.4.tgz#3e572f23c8411a5cfd9557c849e3665e0b290623" - integrity sha512-Kq1rokWXOPXWuaMAqZiJW4XxsmD9zGx9q4aePabbn3qCRGedtH7Cm+zV8WETitMfu1wdh+Rvd6w5egwSngUX2A== - -is-builtin-module@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-builtin-module/-/is-builtin-module-1.0.0.tgz#540572d34f7ac3119f8f76c30cbc1b1e037affbe" - dependencies: - builtin-modules "^1.0.0" - is-callable@^1.1.1, is-callable@^1.1.3: version "1.1.4" resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.4.tgz#1e1adf219e1eeb684d691f9d6a05ff0d30a24d75" @@ -2078,10 +1571,6 @@ is-descriptor@^1.0.0, is-descriptor@^1.0.2: is-data-descriptor "^1.0.0" kind-of "^6.0.2" -is-directory@^0.3.1: - version "0.3.1" - resolved "https://registry.yarnpkg.com/is-directory/-/is-directory-0.3.1.tgz#61339b6f2475fc772fd9c9d83f5c8575dc154ae1" - is-extendable@^0.1.0, is-extendable@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" @@ -2143,7 +1632,7 @@ is-regex@^1.0.4: dependencies: has "^1.0.1" -is-stream@^1.0.1, is-stream@^1.1.0: +is-stream@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" @@ -2186,80 +1675,11 @@ isobject@^3.0.0, isobject@^3.0.1: resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" integrity sha1-TkMekrEalzFjaqH5yNHMvP2reN8= -istanbul-lib-coverage@^2.0.5: - version "2.0.5" - resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.5.tgz#675f0ab69503fad4b1d849f736baaca803344f49" - integrity sha512-8aXznuEPCJvGnMSRft4udDRDtb1V3pkQkMMI5LI+6HuQz5oQ4J2UFn1H82raA3qJtyOLkkwVqICBQkjnGtn5mA== - -istanbul-lib-hook@^2.0.7: - version "2.0.7" - resolved "https://registry.yarnpkg.com/istanbul-lib-hook/-/istanbul-lib-hook-2.0.7.tgz#c95695f383d4f8f60df1f04252a9550e15b5b133" - integrity sha512-vrRztU9VRRFDyC+aklfLoeXyNdTfga2EI3udDGn4cZ6fpSXpHLV9X6CHvfoMCPtggg8zvDDmC4b9xfu0z6/llA== - dependencies: - append-transform "^1.0.0" - -istanbul-lib-instrument@^3.3.0: - version "3.3.0" - resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-3.3.0.tgz#a5f63d91f0bbc0c3e479ef4c5de027335ec6d630" - integrity sha512-5nnIN4vo5xQZHdXno/YDXJ0G+I3dAm4XgzfSVTPLQpj/zAV2dV6Juy0yaf10/zrJOJeHoN3fraFe+XRq2bFVZA== - dependencies: - "@babel/generator" "^7.4.0" - "@babel/parser" "^7.4.3" - "@babel/template" "^7.4.0" - "@babel/traverse" "^7.4.3" - "@babel/types" "^7.4.0" - istanbul-lib-coverage "^2.0.5" - semver "^6.0.0" - -istanbul-lib-report@^2.0.8: - version "2.0.8" - resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-2.0.8.tgz#5a8113cd746d43c4889eba36ab10e7d50c9b4f33" - integrity sha512-fHBeG573EIihhAblwgxrSenp0Dby6tJMFR/HvlerBsrCTD5bkUuoNtn3gVh29ZCS824cGGBPn7Sg7cNk+2xUsQ== - dependencies: - istanbul-lib-coverage "^2.0.5" - make-dir "^2.1.0" - supports-color "^6.1.0" - -istanbul-lib-source-maps@^3.0.6: - version "3.0.6" - resolved "https://registry.yarnpkg.com/istanbul-lib-source-maps/-/istanbul-lib-source-maps-3.0.6.tgz#284997c48211752ec486253da97e3879defba8c8" - integrity sha512-R47KzMtDJH6X4/YW9XTx+jrLnZnscW4VpNN+1PViSYTejLVPWv7oov+Duf8YQSPyVRUvueQqz1TcsC6mooZTXw== - dependencies: - debug "^4.1.1" - istanbul-lib-coverage "^2.0.5" - make-dir "^2.1.0" - rimraf "^2.6.3" - source-map "^0.6.1" - -istanbul-reports@^2.2.4, istanbul-reports@^2.2.6: - version "2.2.6" - resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-2.2.6.tgz#7b4f2660d82b29303a8fe6091f8ca4bf058da1af" - integrity sha512-SKi4rnMyLBKe0Jy2uUdx28h8oG7ph2PPuQPvIAh31d+Ci+lSiEu4C+h3oBPuJ9+mPKhOyW0M8gY4U5NM1WLeXA== - dependencies: - handlebars "^4.1.2" - jquery@^3.3.1: version "3.3.1" resolved "https://registry.yarnpkg.com/jquery/-/jquery-3.3.1.tgz#958ce29e81c9790f31be7792df5d4d95fc57fbca" -js-tokens@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" - integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== - -js-yaml@3.13.1, js-yaml@^3.13.1: - version "3.13.1" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.13.1.tgz#aff151b30bfdfa8e49e05da22e7415e9dfa37847" - integrity sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw== - dependencies: - argparse "^1.0.7" - esprima "^4.0.0" - -jsesc@^2.5.1: - version "2.5.1" - resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.1.tgz#e421a2a8e20d6b0819df28908f782526b96dd1fe" - -json-parse-better-errors@^1.0.1, json-parse-better-errors@^1.0.2: +json-parse-better-errors@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz#bb867cfb3450e69107c131d1c514bab3dc8bcaa9" @@ -2310,21 +1730,6 @@ lcid@^2.0.0: dependencies: invert-kv "^2.0.0" -lines-and-columns@^1.1.6: - version "1.1.6" - resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.1.6.tgz#1c00c743b433cd0a4e80758f7b64a57440d9ff00" - integrity sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA= - -load-json-file@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-4.0.0.tgz#2f5f45ab91e33216234fd53adab668eb4ec0993b" - integrity sha1-L19Fq5HjMhYjT9U62rZo607AmTs= - dependencies: - graceful-fs "^4.1.2" - parse-json "^4.0.0" - pify "^3.0.0" - strip-bom "^3.0.0" - loader-runner@^2.4.0: version "2.4.0" resolved "https://registry.yarnpkg.com/loader-runner/-/loader-runner-2.4.0.tgz#ed47066bfe534d7e84c4c7b9998c2a75607d9357" @@ -2364,45 +1769,14 @@ locate-path@^3.0.0: p-locate "^3.0.0" path-exists "^3.0.0" -locate-path@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-5.0.0.tgz#1afba396afd676a6d42504d0a67a3a7eb9f62aa0" - integrity sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g== - dependencies: - p-locate "^4.1.0" - -lodash.flattendeep@^4.4.0: - version "4.4.0" - resolved "https://registry.yarnpkg.com/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz#fb030917f86a3134e5bc9bec0d69e0013ddfedb2" - integrity sha1-+wMJF/hqMTTlvJvsDWngAT3f7bI= - lodash@^4.17.10, lodash@^4.17.3: version "4.17.10" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.10.tgz#1b7793cf7259ea38fb3661d4d38b3260af8ae4e7" -lodash@^4.17.13, lodash@^4.17.15: - version "4.17.15" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548" - integrity sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A== - -log-symbols@2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-2.2.0.tgz#5740e1c5d6f0dfda4ad9323b5332107ef6b4c40a" - integrity sha512-VeIAFslyIerEJLXHziedo2basKbMKtTw3vfn5IzG0XTjhAVEJyNHnL2p7vc+wBDSdQuUpNw3M2u6xb9QsAY5Eg== - dependencies: - chalk "^2.0.1" - lower-case@^1.1.1: version "1.1.4" resolved "https://registry.yarnpkg.com/lower-case/-/lower-case-1.1.4.tgz#9a2cabd1b9e8e0ae993a4bf7d5875c39c42e8eac" -lru-cache@^4.0.1: - version "4.1.3" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.3.tgz#a1175cf3496dfc8436c156c334b4955992bce69c" - dependencies: - pseudomap "^1.0.2" - yallist "^2.1.2" - lru-cache@^5.1.1: version "5.1.1" resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-5.1.1.tgz#1da27e6710271947695daf6848e847f01d84b920" @@ -2410,12 +1784,7 @@ lru-cache@^5.1.1: dependencies: yallist "^3.0.2" -luxon@^1.21.3: - version "1.21.3" - resolved "https://registry.yarnpkg.com/luxon/-/luxon-1.21.3.tgz#f1d5c2a7e855d039836cf4954f883ecac8fc4727" - integrity sha512-lLRwNcNnkZLuv13A1FUuZRZmTWF7ro2ricYvb0L9cvBYHPvZhQdKwrYnZzi103D2XKmlVmxWpdn2wfIiOt2YEw== - -make-dir@^2.0.0, make-dir@^2.1.0: +make-dir@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-2.1.0.tgz#5f0310e18b8be898cc07009295a30ae41e91e6f5" integrity sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA== @@ -2423,10 +1792,6 @@ make-dir@^2.0.0, make-dir@^2.1.0: pify "^4.0.1" semver "^5.6.0" -make-error@^1.1.1: - version "1.3.4" - resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.4.tgz#19978ed575f9e9545d2ff8c13e33b5d18a67d535" - mamacro@^0.0.3: version "0.0.3" resolved "https://registry.yarnpkg.com/mamacro/-/mamacro-0.0.3.tgz#ad2c9576197c9f1abf308d0787865bd975a3f3e4" @@ -2485,12 +1850,6 @@ memory-fs@^0.5.0: errno "^0.1.3" readable-stream "^2.0.1" -merge-source-map@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/merge-source-map/-/merge-source-map-1.1.0.tgz#2fdde7e6020939f70906a68f2d7ae685e4c8c646" - dependencies: - source-map "^0.6.1" - micromatch@^3.0.4, micromatch@^3.1.10, micromatch@^3.1.4: version "3.1.10" resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" @@ -2540,7 +1899,7 @@ minimalistic-crypto-utils@^1.0.0, minimalistic-crypto-utils@^1.0.1: resolved "https://registry.yarnpkg.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a" integrity sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo= -minimatch@3.0.4, minimatch@^3.0.4: +minimatch@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== @@ -2557,10 +1916,6 @@ minimist@^1.2.0: resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" integrity sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ= -minimist@~0.0.1: - version "0.0.10" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.10.tgz#de3f98543dbf96082be48ad1a0c7cda836301dcf" - mississippi@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/mississippi/-/mississippi-3.0.0.tgz#ea0a3291f97e0b5e8776b363d5f0a12d94c67022" @@ -2585,47 +1940,13 @@ mixin-deep@^1.2.0: for-in "^1.0.2" is-extendable "^1.0.1" -mkdirp@0.5.1, mkdirp@^0.5.0, mkdirp@^0.5.1: +mkdirp@^0.5.1: version "0.5.1" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" integrity sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM= dependencies: minimist "0.0.8" -mocha@^6.2.2: - version "6.2.2" - resolved "https://registry.yarnpkg.com/mocha/-/mocha-6.2.2.tgz#5d8987e28940caf8957a7d7664b910dc5b2fea20" - integrity sha512-FgDS9Re79yU1xz5d+C4rv1G7QagNGHZ+iXF81hO8zY35YZZcLEsJVfFolfsqKFWunATEvNzMK0r/CwWd/szO9A== - dependencies: - ansi-colors "3.2.3" - browser-stdout "1.3.1" - debug "3.2.6" - diff "3.5.0" - escape-string-regexp "1.0.5" - find-up "3.0.0" - glob "7.1.3" - growl "1.10.5" - he "1.2.0" - js-yaml "3.13.1" - log-symbols "2.2.0" - minimatch "3.0.4" - mkdirp "0.5.1" - ms "2.1.1" - node-environment-flags "1.0.5" - object.assign "4.1.0" - strip-json-comments "2.0.1" - supports-color "6.0.0" - which "1.3.1" - wide-align "1.1.3" - yargs "13.3.0" - yargs-parser "13.1.1" - yargs-unparser "1.6.0" - -mockdate@^2.0.5: - version "2.0.5" - resolved "https://registry.yarnpkg.com/mockdate/-/mockdate-2.0.5.tgz#70c6abf9ed4b2dae65c81dfc170dd1a5cec53620" - integrity sha512-ST0PnThzWKcgSLyc+ugLVql45PvESt3Ul/wrdV/OPc/6Pr8dbLAIJsN1cIp41FLzbN+srVTNIRn+5Cju0nyV6A== - move-concurrently@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/move-concurrently/-/move-concurrently-1.0.1.tgz#be2c005fda32e0b29af1f05d7c4b33214c701f92" @@ -2643,16 +1964,6 @@ ms@2.0.0: resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= -ms@2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a" - integrity sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg== - -ms@^2.1.1: - version "2.1.2" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" - integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== - nan@^2.12.1: version "2.14.0" resolved "https://registry.yarnpkg.com/nan/-/nan-2.14.0.tgz#7818f722027b2459a86f0295d434d1fc2336c52c" @@ -2675,16 +1986,11 @@ nanomatch@^1.2.9: snapdragon "^0.8.1" to-regex "^3.0.1" -neo-async@^2.5.0, neo-async@^2.6.0, neo-async@^2.6.1: +neo-async@^2.5.0, neo-async@^2.6.1: version "2.6.1" resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.1.tgz#ac27ada66167fa8849a6addd837f6b189ad2081c" integrity sha512-iyam8fBuCUpWeKPGpaNMetEocMt364qkCsfL9JuhjXX6dRnguRVOfk2GZaDpPjcOKiiXCPINZC1GczQ7iTq3Zw== -nested-error-stacks@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/nested-error-stacks/-/nested-error-stacks-2.1.0.tgz#0fbdcf3e13fe4994781280524f8b96b0cdff9c61" - integrity sha512-AO81vsIO1k1sM4Zrd6Hu7regmJN1NSiAja10gc4bX3F0wd+9rQmcuHQaHVQCYIEC8iFXnE+mavh23GOt7wBgug== - nice-try@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.4.tgz#d93962f6c52f2c1558c0fbda6d512819f1efe1c4" @@ -2695,14 +2001,6 @@ no-case@^2.2.0: dependencies: lower-case "^1.1.1" -node-environment-flags@1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/node-environment-flags/-/node-environment-flags-1.0.5.tgz#fa930275f5bf5dae188d6192b24b4c8bbac3d76a" - integrity sha512-VNYPRfGfmZLx0Ye20jWzHUjyTW/c+6Wq+iLhDzUI4XmhrDd9l/FozXV3F2xOaXjvp0co0+v1YSR3CMP6g+VvLQ== - dependencies: - object.getownpropertydescriptors "^2.0.3" - semver "^5.7.0" - node-libs-browser@^2.2.1: version "2.2.1" resolved "https://registry.yarnpkg.com/node-libs-browser/-/node-libs-browser-2.2.1.tgz#b64f513d18338625f90346d27b0d235e631f6425" @@ -2732,25 +2030,6 @@ node-libs-browser@^2.2.1: util "^0.11.0" vm-browserify "^1.0.1" -normalize-package-data@^2.3.2: - version "2.4.0" - resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.4.0.tgz#12f95a307d58352075a04907b84ac8be98ac012f" - dependencies: - hosted-git-info "^2.1.4" - is-builtin-module "^1.0.0" - semver "2 || 3 || 4 || 5" - validate-npm-package-license "^3.0.1" - -normalize-package-data@^2.5.0: - version "2.5.0" - resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.5.0.tgz#e66db1838b200c1dfc233225d12cb36520e234a8" - integrity sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA== - dependencies: - hosted-git-info "^2.1.4" - resolve "^1.10.0" - semver "2 || 3 || 4 || 5" - validate-npm-package-license "^3.0.1" - normalize-path@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" @@ -2775,37 +2054,6 @@ nth-check@~1.0.1: dependencies: boolbase "~1.0.0" -nyc@^14.1.1: - version "14.1.1" - resolved "https://registry.yarnpkg.com/nyc/-/nyc-14.1.1.tgz#151d64a6a9f9f5908a1b73233931e4a0a3075eeb" - integrity sha512-OI0vm6ZGUnoGZv/tLdZ2esSVzDwUC88SNs+6JoSOMVxA+gKMB8Tk7jBwgemLx4O40lhhvZCVw1C+OYLOBOPXWw== - dependencies: - archy "^1.0.0" - caching-transform "^3.0.2" - convert-source-map "^1.6.0" - cp-file "^6.2.0" - find-cache-dir "^2.1.0" - find-up "^3.0.0" - foreground-child "^1.5.6" - glob "^7.1.3" - istanbul-lib-coverage "^2.0.5" - istanbul-lib-hook "^2.0.7" - istanbul-lib-instrument "^3.3.0" - istanbul-lib-report "^2.0.8" - istanbul-lib-source-maps "^3.0.6" - istanbul-reports "^2.2.4" - js-yaml "^3.13.1" - make-dir "^2.1.0" - merge-source-map "^1.1.0" - resolve-from "^4.0.0" - rimraf "^2.6.3" - signal-exit "^3.0.2" - spawn-wrap "^1.4.2" - test-exclude "^5.2.3" - uuid "^3.3.2" - yargs "^13.2.2" - yargs-parser "^13.0.0" - object-assign@^4.0.1, object-assign@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" @@ -2819,11 +2067,6 @@ object-copy@^0.1.0: define-property "^0.2.5" kind-of "^3.0.3" -object-keys@^1.0.11: - version "1.1.1" - resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e" - integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA== - object-keys@^1.0.8: version "1.0.12" resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.0.12.tgz#09c53855377575310cca62f55bb334abff7b3ed2" @@ -2835,16 +2078,6 @@ object-visit@^1.0.0: dependencies: isobject "^3.0.0" -object.assign@4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.0.tgz#968bf1100d7956bb3ca086f006f846b3bc4008da" - integrity sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w== - dependencies: - define-properties "^1.1.2" - function-bind "^1.1.1" - has-symbols "^1.0.0" - object-keys "^1.0.11" - object.getownpropertydescriptors@^2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.0.3.tgz#8758c846f5b407adab0f236e0986f14b051caa16" @@ -2866,27 +2099,11 @@ once@^1.3.0, once@^1.3.1, once@^1.4.0: dependencies: wrappy "1" -opencollective-postinstall@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/opencollective-postinstall/-/opencollective-postinstall-2.0.2.tgz#5657f1bede69b6e33a45939b061eb53d3c6c3a89" - integrity sha512-pVOEP16TrAO2/fjej1IdOyupJY8KDUM1CvsaScRbw6oddvpQoOfGk4ywha0HKKVAD6RkW4x6Q+tNBwhf3Bgpuw== - -optimist@^0.6.1: - version "0.6.1" - resolved "https://registry.yarnpkg.com/optimist/-/optimist-0.6.1.tgz#da3ea74686fa21a19a111c326e90eb15a0196686" - dependencies: - minimist "~0.0.1" - wordwrap "~0.0.2" - os-browserify@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/os-browserify/-/os-browserify-0.3.0.tgz#854373c7f5c2315914fc9bfc6bd8238fdda1ec27" integrity sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc= -os-homedir@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" - os-locale@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-3.1.0.tgz#a802a6ee17f24c10483ab9935719cef4ed16bf1a" @@ -2910,7 +2127,7 @@ p-is-promise@^2.0.0: resolved "https://registry.yarnpkg.com/p-is-promise/-/p-is-promise-2.1.0.tgz#918cebaea248a62cf7ffab8e3bca8c5f882fc42e" integrity sha512-Y3W0wlRPK8ZMRbNq97l4M5otioeA5lm1z7bkNkxCka8HSPjR0xRWmpCmc9utiaLP9Jb1eD8BgeIxTW4AIF45Pg== -p-limit@^2.0.0, p-limit@^2.2.0, p-limit@^2.2.1: +p-limit@^2.0.0, p-limit@^2.2.1: version "2.2.1" resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.2.1.tgz#aa07a788cc3151c939b5131f63570f0dd2009537" integrity sha512-85Tk+90UCVWvbDavCLKPOLC9vvY8OwEX/RtKF+/1OADJMVlFfEHOiMTPVyxg7mk/dKa+ipdHm0OUkTvCpMTuwg== @@ -2924,28 +2141,11 @@ p-locate@^3.0.0: dependencies: p-limit "^2.0.0" -p-locate@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-4.1.0.tgz#a3428bb7088b3a60292f66919278b7c297ad4f07" - integrity sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A== - dependencies: - p-limit "^2.2.0" - p-try@^2.0.0: version "2.2.0" resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6" integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== -package-hash@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/package-hash/-/package-hash-3.0.0.tgz#50183f2d36c9e3e528ea0a8605dff57ce976f88e" - integrity sha512-lOtmukMDVvtkL84rJHI7dpTYq+0rli8N2wlnqUcBuDWCfVhRUfOmnR9SsoHFMLpACvEV60dX7rd0rFaYDZI+FA== - dependencies: - graceful-fs "^4.1.15" - hasha "^3.0.0" - lodash.flattendeep "^4.4.0" - release-zalgo "^1.0.0" - pako@~1.0.5: version "1.0.10" resolved "https://registry.yarnpkg.com/pako/-/pako-1.0.10.tgz#4328badb5086a426aa90f541977d4955da5c9732" @@ -2978,23 +2178,6 @@ parse-asn1@^5.0.0: pbkdf2 "^3.0.3" safe-buffer "^5.1.1" -parse-json@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-4.0.0.tgz#be35f5425be1f7f6c747184f98a788cb99477ee0" - dependencies: - error-ex "^1.3.1" - json-parse-better-errors "^1.0.1" - -parse-json@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-5.0.0.tgz#73e5114c986d143efa3712d4ea24db9a4266f60f" - integrity sha512-OOY5b7PAEFV0E2Fir1KOkxchnZNCdowAJgQ5NuxjpBKTRP3pQhwkrkxqQjeoKJ+fO7bCpmIZaogI4eZGDMEGOw== - dependencies: - "@babel/code-frame" "^7.0.0" - error-ex "^1.3.1" - json-parse-better-errors "^1.0.1" - lines-and-columns "^1.1.6" - parse-passwd@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/parse-passwd/-/parse-passwd-1.0.0.tgz#6d5b934a456993b23d37f40a382d6f1666a8e5c6" @@ -3020,11 +2203,6 @@ path-exists@^3.0.0: resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" integrity sha1-zg6+ql94yxiSXqfYENe1mwEP1RU= -path-exists@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3" - integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w== - path-is-absolute@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" @@ -3034,31 +2212,12 @@ path-key@^2.0.0, path-key@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" -path-key@^3.1.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375" - integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== - -path-parse@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.5.tgz#3c1adf871ea9cd6c9431b6ea2bd74a0ff055c4c1" - -path-parse@^1.0.6: - version "1.0.6" - resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c" - integrity sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw== - path-type@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/path-type/-/path-type-3.0.0.tgz#cef31dc8e0a1a3bb0d105c0cd97cf3bf47f4e36f" dependencies: pify "^3.0.0" -pathval@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/pathval/-/pathval-1.1.0.tgz#b942e6d4bde653005ef6b71361def8727d0645e0" - integrity sha1-uULm1L3mUwBe9rcTYd74cn0GReA= - pbkdf2@^3.0.3: version "3.0.17" resolved "https://registry.yarnpkg.com/pbkdf2/-/pbkdf2-3.0.17.tgz#976c206530617b14ebb32114239f7b09336e93a6" @@ -3091,20 +2250,6 @@ pkg-dir@^3.0.0: dependencies: find-up "^3.0.0" -pkg-dir@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-4.2.0.tgz#f099133df7ede422e81d1d8448270eeb3e4261f3" - integrity sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ== - dependencies: - find-up "^4.0.0" - -please-upgrade-node@^3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/please-upgrade-node/-/please-upgrade-node-3.2.0.tgz#aeddd3f994c933e4ad98b99d9a556efa0e2fe942" - integrity sha512-gQR3WpIgNIKwBMVLkpMUeR3e1/E1y42bqDQZfql+kDeXd8COYfM8PQA4X6y7a8u9Ua9FHmsrrmirW2vHs45hWg== - dependencies: - semver-compare "^1.0.0" - posix-character-classes@^0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" @@ -3137,10 +2282,6 @@ prr@~1.0.1: resolved "https://registry.yarnpkg.com/prr/-/prr-1.0.1.tgz#d3fc114ba06995a45ec6893f484ceb1d78f5f476" integrity sha1-0/wRS6BplaRexok/SEzrHXj19HY= -pseudomap@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" - public-encrypt@^4.0.0: version "4.0.3" resolved "https://registry.yarnpkg.com/public-encrypt/-/public-encrypt-4.0.3.tgz#4fcc9d77a07e48ba7527e7cbe0de33d0701331e0" @@ -3218,33 +2359,6 @@ randomfill@^1.0.3: randombytes "^2.0.5" safe-buffer "^5.1.0" -read-pkg-up@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-4.0.0.tgz#1b221c6088ba7799601c808f91161c66e58f8978" - integrity sha512-6etQSH7nJGsK0RbG/2TeDzZFa8shjQ1um+SwQQ5cwKy0dhSXdOncEhb1CPpvQG4h7FyOV6EB6YlV0yJvZQNAkA== - dependencies: - find-up "^3.0.0" - read-pkg "^3.0.0" - -read-pkg@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-3.0.0.tgz#9cbc686978fee65d16c00e2b19c237fcf6e38389" - integrity sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k= - dependencies: - load-json-file "^4.0.0" - normalize-package-data "^2.3.2" - path-type "^3.0.0" - -read-pkg@^5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-5.2.0.tgz#7bf295438ca5a33e56cd30e053b34ee7250c93cc" - integrity sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg== - dependencies: - "@types/normalize-package-data" "^2.4.0" - normalize-package-data "^2.5.0" - parse-json "^5.0.0" - type-fest "^0.6.0" - "readable-stream@1 || 2", readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.1.5, readable-stream@^2.2.2, readable-stream@^2.3.3, readable-stream@^2.3.6, readable-stream@~2.3.6: version "2.3.6" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.6.tgz#b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf" @@ -3288,13 +2402,6 @@ relateurl@0.2.x: version "0.2.7" resolved "https://registry.yarnpkg.com/relateurl/-/relateurl-0.2.7.tgz#54dbf377e51440aca90a4cd274600d3ff2d888a9" -release-zalgo@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/release-zalgo/-/release-zalgo-1.0.0.tgz#09700b7e5074329739330e535c5a90fb67851730" - integrity sha1-CXALflB0Mpc5Mw5TXFqQ+2eFFzA= - dependencies: - es6-error "^4.0.1" - remove-trailing-separator@^1.0.1: version "1.1.0" resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef" @@ -3347,29 +2454,11 @@ resolve-from@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-3.0.0.tgz#b22c7af7d9d6881bc8b6e653335eebcb0a188748" -resolve-from@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6" - integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g== - resolve-url@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" integrity sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo= -resolve@^1.10.0: - version "1.13.1" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.13.1.tgz#be0aa4c06acd53083505abb35f4d66932ab35d16" - integrity sha512-CxqObCX8K8YtAhOBRg+lrcdn+LK+WYOS8tSjqSFbjtrI5PnS63QPhZl4+yKfrU9tdsbMu9Anr/amegT87M9Z6w== - dependencies: - path-parse "^1.0.6" - -resolve@^1.3.2: - version "1.8.1" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.8.1.tgz#82f1ec19a423ac1fbd080b0bab06ba36e84a7a26" - dependencies: - path-parse "^1.0.5" - ret@~0.1.10: version "0.1.15" resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" @@ -3382,19 +2471,6 @@ rimraf@^2.5.4, rimraf@^2.6.3: dependencies: glob "^7.1.3" -rimraf@^2.6.2: - version "2.6.2" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.2.tgz#2ed8150d24a16ea8651e6d6ef0f47c4158ce7a36" - dependencies: - glob "^7.0.5" - -rimraf@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-3.0.0.tgz#614176d4b3010b75e5c390eb0ee96f6dc0cebb9b" - integrity sha512-NDGVxTsjqfunkds7CqsOiEnxln4Bo7Nddl3XhS4pXg5OzwkLqJ971ZVAAnB+DDLnF76N+VnDEiBHaVV8I06SUg== - dependencies: - glob "^7.1.3" - ripemd160@^2.0.0, ripemd160@^2.0.1: version "2.0.2" resolved "https://registry.yarnpkg.com/ripemd160/-/ripemd160-2.0.2.tgz#a1c1a6f624751577ba5d07914cbc92850585890c" @@ -3403,9 +2479,12 @@ ripemd160@^2.0.0, ripemd160@^2.0.1: hash-base "^3.0.0" inherits "^2.0.1" -run-node@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/run-node/-/run-node-1.0.0.tgz#46b50b946a2aa2d4947ae1d886e9856fd9cabe5e" +rrule@2.7.0: + version "2.7.0" + resolved "https://registry.yarnpkg.com/rrule/-/rrule-2.7.0.tgz#f985bae79102a08893885a81e551a4977c6e6bcc" + integrity sha512-PnSvdJLHrETO4qQxm9nlDvSxNfbPdDFbgdz2BSHXTP+IzHbdwSNvTHOeN0O9khiy91GjzWXyiVJhnPDOQvejNg== + dependencies: + tslib "^1.10.0" run-queue@^1.0.0, run-queue@^1.0.3: version "1.0.3" @@ -3440,15 +2519,11 @@ schema-utils@^1.0.0: ajv-errors "^1.0.0" ajv-keywords "^3.1.0" -semver-compare@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/semver-compare/-/semver-compare-1.0.0.tgz#0dee216a1c941ab37e9efb1788f6afc5ff5537fc" - -"semver@2 || 3 || 4 || 5", semver@^5.5.0: +semver@^5.5.0: version "5.5.0" resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.0.tgz#dc4bbc7a6ca9d916dee5d43516f0092b58f7b8ab" -semver@^5.3.0, semver@^5.6.0, semver@^5.7.0: +semver@^5.6.0: version "5.7.1" resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== @@ -3501,23 +2576,11 @@ shebang-command@^1.2.0: dependencies: shebang-regex "^1.0.0" -shebang-command@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea" - integrity sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA== - dependencies: - shebang-regex "^3.0.0" - shebang-regex@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" -shebang-regex@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" - integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== - -signal-exit@^3.0.0, signal-exit@^3.0.2: +signal-exit@^3.0.0: version "3.0.2" resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" @@ -3525,11 +2588,6 @@ slash@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/slash/-/slash-1.0.0.tgz#c41f2f6c39fc16d1cd17ad4b5d896114ae470d55" -slash@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" - integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== - snapdragon-node@^2.0.1: version "2.1.1" resolved "https://registry.yarnpkg.com/snapdragon-node/-/snapdragon-node-2.1.1.tgz#6c175f86ff14bdb0724563e8f3c1b021a286853b" @@ -3591,19 +2649,12 @@ source-map-support@^0.5.16, source-map-support@~0.5.12: buffer-from "^1.0.0" source-map "^0.6.0" -source-map-support@^0.5.6: - version "0.5.6" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.6.tgz#4435cee46b1aab62b8e8610ce60f788091c51c13" - dependencies: - buffer-from "^1.0.0" - source-map "^0.6.0" - source-map-url@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/source-map-url/-/source-map-url-0.4.0.tgz#3e935d7ddd73631b97659956d55128e87b5084a3" integrity sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM= -source-map@0.5.x, source-map@^0.5.0, source-map@^0.5.6: +source-map@0.5.x, source-map@^0.5.6: version "0.5.7" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" @@ -3612,44 +2663,6 @@ source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.1: resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== -source-map@^0.7.3: - version "0.7.3" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.7.3.tgz#5302f8169031735226544092e64981f751750383" - integrity sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ== - -spawn-wrap@^1.4.2: - version "1.4.2" - resolved "https://registry.yarnpkg.com/spawn-wrap/-/spawn-wrap-1.4.2.tgz#cff58e73a8224617b6561abdc32586ea0c82248c" - dependencies: - foreground-child "^1.5.6" - mkdirp "^0.5.0" - os-homedir "^1.0.1" - rimraf "^2.6.2" - signal-exit "^3.0.2" - which "^1.3.0" - -spdx-correct@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.0.0.tgz#05a5b4d7153a195bc92c3c425b69f3b2a9524c82" - dependencies: - spdx-expression-parse "^3.0.0" - spdx-license-ids "^3.0.0" - -spdx-exceptions@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/spdx-exceptions/-/spdx-exceptions-2.1.0.tgz#2c7ae61056c714a5b9b9b2b2af7d311ef5c78fe9" - -spdx-expression-parse@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz#99e119b7a5da00e05491c9fa338b7904823b41d0" - dependencies: - spdx-exceptions "^2.1.0" - spdx-license-ids "^3.0.0" - -spdx-license-ids@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.0.tgz#7a7cd28470cc6d3a1cfe6d66886f6bc430d3ac87" - split-string@^3.0.1, split-string@^3.0.2: version "3.1.0" resolved "https://registry.yarnpkg.com/split-string/-/split-string-3.1.0.tgz#7cb09dda3a86585705c64b39a6466038682e8fe2" @@ -3657,10 +2670,6 @@ split-string@^3.0.1, split-string@^3.0.2: dependencies: extend-shallow "^3.0.0" -sprintf-js@~1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" - ssri@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/ssri/-/ssri-6.0.1.tgz#2a3c41b28dd45b62b63676ecb74001265ae9edd8" @@ -3708,14 +2717,6 @@ stream-shift@^1.0.0: resolved "https://registry.yarnpkg.com/stream-shift/-/stream-shift-1.0.1.tgz#d7088281559ab2778424279b0877da3c392d5a3d" integrity sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ== -"string-width@^1.0.2 || 2": - version "2.1.1" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" - integrity sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw== - dependencies: - is-fullwidth-code-point "^2.0.0" - strip-ansi "^4.0.0" - string-width@^3.0.0, string-width@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/string-width/-/string-width-3.1.0.tgz#22767be21b62af1081574306f69ac51b62203961" @@ -3750,13 +2751,6 @@ strip-ansi@^3.0.0: dependencies: ansi-regex "^2.0.0" -strip-ansi@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" - integrity sha1-qEeQIusaw2iocTibY1JixQXuNo8= - dependencies: - ansi-regex "^3.0.0" - strip-ansi@^5.0.0, strip-ansi@^5.1.0, strip-ansi@^5.2.0: version "5.2.0" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-5.2.0.tgz#8c9a536feb6afc962bdfa5b104a5091c1ad9c0ae" @@ -3764,28 +2758,11 @@ strip-ansi@^5.0.0, strip-ansi@^5.1.0, strip-ansi@^5.2.0: dependencies: ansi-regex "^4.1.0" -strip-bom@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" - integrity sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM= - strip-eof@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf" -strip-json-comments@2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" - integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo= - -supports-color@6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-6.0.0.tgz#76cfe742cf1f41bb9b1c29ad03068c05b4c0e40a" - integrity sha512-on9Kwidc1IUQo+bQdhi8+Tijpo0e1SS6RoGo2guUwn5vdaxw8RXOF9Vb2ws+ihWOmh4JnCJOvaziZWP1VABaLg== - dependencies: - has-flag "^3.0.0" - -supports-color@6.1.0, supports-color@^6.1.0: +supports-color@6.1.0: version "6.1.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-6.1.0.tgz#0764abc69c63d5ac842dd4867e8d025e880df8f3" integrity sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ== @@ -3827,16 +2804,6 @@ terser@^4.1.2: source-map "~0.6.1" source-map-support "~0.5.12" -test-exclude@^5.2.3: - version "5.2.3" - resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-5.2.3.tgz#c3d3e1e311eb7ee405e092dac10aefd09091eac0" - integrity sha512-M+oxtseCFO3EDtAaGH7iiej3CBkzXqFMbzqYAACdzKui4eZA+pq3tZEwChvOdNfa7xxy8BfbmgJSIr43cC/+2g== - dependencies: - glob "^7.1.3" - minimatch "^3.0.4" - read-pkg-up "^4.0.0" - require-main-filename "^2.0.0" - through2@^2.0.0: version "2.0.5" resolved "https://registry.yarnpkg.com/through2/-/through2-2.0.5.tgz#01c1e39eb31d07cb7d03a96a70823260b23132cd" @@ -3857,10 +2824,6 @@ to-arraybuffer@^1.0.0: resolved "https://registry.yarnpkg.com/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz#7d229b1fcc637e466ca081180836a7aabff83f43" integrity sha1-fSKbH8xjfkZsoIEYCDanqr/4P0M= -to-fast-properties@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" - to-object-path@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/to-object-path/-/to-object-path-0.3.0.tgz#297588b7b0e7e0ac08e04e672f85c1f4999e17af" @@ -3908,85 +2871,16 @@ ts-loader@^6.2.1: micromatch "^4.0.0" semver "^6.0.0" -ts-node@^8.5.4: - version "8.5.4" - resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-8.5.4.tgz#a152add11fa19c221d0b48962c210cf467262ab2" - integrity sha512-izbVCRV68EasEPQ8MSIGBNK9dc/4sYJJKYA+IarMQct1RtEot6Xp0bXuClsbUSnKpg50ho+aOAx8en5c+y4OFw== - dependencies: - arg "^4.1.0" - diff "^4.0.1" - make-error "^1.1.1" - source-map-support "^0.5.6" - yn "^3.0.0" - -tslib@1.9.0: - version "1.9.0" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.0.tgz#e37a86fda8cbbaf23a057f473c9f4dc64e5fc2e8" - tslib@^1.10.0, tslib@^1.9.0: version "1.10.0" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.10.0.tgz#c3c19f95973fb0a62973fb09d90d961ee43e5c8a" integrity sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ== -tslib@^1.8.0, tslib@^1.8.1: - version "1.9.3" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286" - -tslint-eslint-rules@^5.4.0: - version "5.4.0" - resolved "https://registry.yarnpkg.com/tslint-eslint-rules/-/tslint-eslint-rules-5.4.0.tgz#e488cc9181bf193fe5cd7bfca213a7695f1737b5" - dependencies: - doctrine "0.7.2" - tslib "1.9.0" - tsutils "^3.0.0" - -tslint@^5.20.1: - version "5.20.1" - resolved "https://registry.yarnpkg.com/tslint/-/tslint-5.20.1.tgz#e401e8aeda0152bc44dd07e614034f3f80c67b7d" - integrity sha512-EcMxhzCFt8k+/UP5r8waCf/lzmeSyVlqxqMEDQE7rWYiQky8KpIBz1JAoYXfROHrPZ1XXd43q8yQnULOLiBRQg== - dependencies: - "@babel/code-frame" "^7.0.0" - builtin-modules "^1.1.1" - chalk "^2.3.0" - commander "^2.12.1" - diff "^4.0.1" - glob "^7.1.1" - js-yaml "^3.13.1" - minimatch "^3.0.4" - mkdirp "^0.5.1" - resolve "^1.3.2" - semver "^5.3.0" - tslib "^1.8.0" - tsutils "^2.29.0" - -tsutils@^2.29.0: - version "2.29.0" - resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.29.0.tgz#32b488501467acbedd4b85498673a0812aca0b99" - integrity sha512-g5JVHCIJwzfISaXpXE1qvNalca5Jwob6FjI4AoPlqMusJ6ftFE7IkkFoMhVLRgK+4Kx3gkzb8UZK5t5yTTvEmA== - dependencies: - tslib "^1.8.1" - -tsutils@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.0.0.tgz#0c5070a17a0503e056da038c48b5a1870a50a9ad" - dependencies: - tslib "^1.8.1" - tty-browserify@0.0.0: version "0.0.0" resolved "https://registry.yarnpkg.com/tty-browserify/-/tty-browserify-0.0.0.tgz#a157ba402da24e9bf957f9aa69d524eed42901a6" integrity sha1-oVe6QC2iTpv5V/mqadUk7tQpAaY= -type-detect@^4.0.0, type-detect@^4.0.5: - version "4.0.8" - resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c" - integrity sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g== - -type-fest@^0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.6.0.tgz#8d2a2370d3df886eb5c90ada1c5bf6188acf838b" - integrity sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg== - typedarray@^0.0.6: version "0.0.6" resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" @@ -4004,7 +2898,7 @@ uglify-js@3.4.x: commander "~2.16.0" source-map "~0.6.1" -uglify-js@^3.1.4, uglify-js@^3.6.0: +uglify-js@^3.6.0: version "3.7.2" resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.7.2.tgz#cb1a601e67536e9ed094a92dd1e333459643d3f9" integrity sha512-uhRwZcANNWVLrxLfNFEdltoPNhECUR3lc+UdJoG9CBpMcSnKyWA94tc3eAujB1GcMY5Uwq8ZMp4qWpxWYDQmaA== @@ -4137,22 +3031,6 @@ v8-compile-cache@2.0.3: resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.0.3.tgz#00f7494d2ae2b688cfe2899df6ed2c54bef91dbe" integrity sha512-CNmdbwQMBjwr9Gsmohvm0pbL954tJrNzf6gWL3K+QMQf00PF7ERGrEiLgjuU3mKreLC2MeGhUsNV9ybTbLgd3w== -v8-to-istanbul@^3.2.3: - version "3.2.6" - resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-3.2.6.tgz#42333fe6b2a9849b108ff781af6faa1a61390eac" - integrity sha512-M6zzkVjsr+6sFdWPCuq7fjg9oCOXlssin05Yhobt9jMqHlEhw8AQ4/ClDiLCVWzXjpS2ezik53mhgSivw0XwmQ== - dependencies: - "@types/istanbul-lib-coverage" "^2.0.1" - convert-source-map "^1.6.0" - source-map "^0.7.3" - -validate-npm-package-license@^3.0.1: - version "3.0.4" - resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a" - dependencies: - spdx-correct "^3.0.0" - spdx-expression-parse "^3.0.0" - vm-browserify@^1.0.1: version "1.1.2" resolved "https://registry.yarnpkg.com/vm-browserify/-/vm-browserify-1.1.2.tgz#78641c488b8e6ca91a75f511e7a3b32a86e5dda0" @@ -4233,30 +3111,12 @@ which-module@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" -which@1.3.1, which@^1.2.14, which@^1.2.9, which@^1.3.0, which@^1.3.1: +which@^1.2.14, which@^1.2.9, which@^1.3.1: version "1.3.1" resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" dependencies: isexe "^2.0.0" -which@^2.0.1: - version "2.0.2" - resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" - integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== - dependencies: - isexe "^2.0.0" - -wide-align@1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.3.tgz#ae074e6bdc0c14a431e804e624549c633b000457" - integrity sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA== - dependencies: - string-width "^1.0.2 || 2" - -wordwrap@~0.0.2: - version "0.0.3" - resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.3.tgz#a3d5da6cd5c0bc0008d37234bbaf1bed63059107" - worker-farm@^1.7.0: version "1.7.0" resolved "https://registry.yarnpkg.com/worker-farm/-/worker-farm-1.7.0.tgz#26a94c5391bbca926152002f69b84a4bf772e5a8" @@ -4278,15 +3138,6 @@ wrappy@1: resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= -write-file-atomic@^2.4.2: - version "2.4.3" - resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-2.4.3.tgz#1fd2e9ae1df3e75b8d8c367443c692d4ca81f481" - integrity sha512-GaETH5wwsX+GcnzhPgKcKjJ6M2Cq3/iZp1WyY/X1CSqrW+jVNM9Y7D8EC2sM4ZG/V8wZlSniJnCKWPmBYAucRQ== - dependencies: - graceful-fs "^4.1.11" - imurmurhash "^0.1.4" - signal-exit "^3.0.2" - xtend@^4.0.0, xtend@~4.0.1: version "4.0.2" resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.2.tgz#bb72779f5fa465186b1f438f674fa347fdb5db54" @@ -4297,16 +3148,12 @@ y18n@^4.0.0: resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.0.tgz#95ef94f85ecc81d007c264e190a120f0a3c8566b" integrity sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w== -yallist@^2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52" - yallist@^3.0.2: version "3.1.1" resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.1.1.tgz#dbb7daf9bfd8bac9ab45ebf602b8cbad0d5d08fd" integrity sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g== -yargs-parser@13.1.1, yargs-parser@^13.0.0, yargs-parser@^13.1.0, yargs-parser@^13.1.1: +yargs-parser@^13.1.0: version "13.1.1" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-13.1.1.tgz#d26058532aa06d365fe091f6a1fc06b2f7e5eca0" integrity sha512-oVAVsHz6uFrg3XQheFII8ESO2ssAf9luWuAd6Wexsu4F3OtIW0o8IribPXYrD4WC24LWtPrJlGy87y5udK+dxQ== @@ -4314,31 +3161,6 @@ yargs-parser@13.1.1, yargs-parser@^13.0.0, yargs-parser@^13.1.0, yargs-parser@^1 camelcase "^5.0.0" decamelize "^1.2.0" -yargs-parser@^14.0.0: - version "14.0.0" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-14.0.0.tgz#42e25777b06718ec99eac2c3a98ad3de73b6818f" - integrity sha512-zn/Mnx+tbFjkCFUodEpjXckNS65NfpB5oyqOkDDEG/8uxlfLZJu2IoBLQFjukUkn9rBbGkVYNzrDh6qy4NUd3g== - dependencies: - camelcase "^5.0.0" - decamelize "^1.2.0" - -yargs-parser@^15.0.0: - version "15.0.0" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-15.0.0.tgz#cdd7a97490ec836195f59f3f4dbe5ea9e8f75f08" - integrity sha512-xLTUnCMc4JhxrPEPUYD5IBR1mWCK/aT6+RJ/K29JY2y1vD+FhtgKK0AXRWvI262q3QSffAQuTouFIKUuHX89wQ== - dependencies: - camelcase "^5.0.0" - decamelize "^1.2.0" - -yargs-unparser@1.6.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/yargs-unparser/-/yargs-unparser-1.6.0.tgz#ef25c2c769ff6bd09e4b0f9d7c605fb27846ea9f" - integrity sha512-W9tKgmSn0DpSatfri0nx52Joq5hVXgeLiqR/5G0sZNDoLZFOr/xjBUDcShCOGNsBnEMNo1KAMBkTej1Hm62HTw== - dependencies: - flat "^4.1.0" - lodash "^4.17.15" - yargs "^13.3.0" - yargs@13.2.4: version "13.2.4" resolved "https://registry.yarnpkg.com/yargs/-/yargs-13.2.4.tgz#0b562b794016eb9651b98bd37acf364aa5d6dc83" @@ -4355,41 +3177,3 @@ yargs@13.2.4: which-module "^2.0.0" y18n "^4.0.0" yargs-parser "^13.1.0" - -yargs@13.3.0, yargs@^13.2.2, yargs@^13.3.0: - version "13.3.0" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-13.3.0.tgz#4c657a55e07e5f2cf947f8a366567c04a0dedc83" - integrity sha512-2eehun/8ALW8TLoIl7MVaRUrg+yCnenu8B4kBlRxj3GJGDKU1Og7sMXPNm1BYyM1DOJmTZ4YeN/Nwxv+8XJsUA== - dependencies: - cliui "^5.0.0" - find-up "^3.0.0" - get-caller-file "^2.0.1" - require-directory "^2.1.1" - require-main-filename "^2.0.0" - set-blocking "^2.0.0" - string-width "^3.0.0" - which-module "^2.0.0" - y18n "^4.0.0" - yargs-parser "^13.1.1" - -yargs@^14.0.0: - version "14.2.2" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-14.2.2.tgz#2769564379009ff8597cdd38fba09da9b493c4b5" - integrity sha512-/4ld+4VV5RnrynMhPZJ/ZpOCGSCeghMykZ3BhdFBDa9Wy/RH6uEGNWDJog+aUlq+9OM1CFTgtYRW5Is1Po9NOA== - dependencies: - cliui "^5.0.0" - decamelize "^1.2.0" - find-up "^3.0.0" - get-caller-file "^2.0.1" - require-directory "^2.1.1" - require-main-filename "^2.0.0" - set-blocking "^2.0.0" - string-width "^3.0.0" - which-module "^2.0.0" - y18n "^4.0.0" - yargs-parser "^15.0.0" - -yn@^3.0.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50" - integrity sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==