@js-joda/extra 0.7.1 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,7 +1,9 @@
1
1
  @js-joda/extra Changelog
2
2
  =========
3
3
 
4
- ### next
4
+ ### Later version
5
+
6
+ For later versions check the global [`CHANGELOG.md`](../../CHANGELOG.md) file in the root folder.
5
7
 
6
8
  ### 0.7.0
7
9
 
@@ -1,4 +1,4 @@
1
- //! @version @js-joda/extra - 0.7.0
1
+ //! @version @js-joda/extra - 0.8.0
2
2
  //! @copyright (c) 2015-present, Philipp Thürwächter, Pattrick Hüper & js-joda contributors
3
3
  //! @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos
4
4
  //! @license BSD-3-Clause (see LICENSE in the root directory of this source tree)
@@ -1,523 +1,329 @@
1
- //! @version @js-joda/extra - 0.7.1
2
- //! @copyright (c) 2015-2016, Philipp Thürwächter, Pattrick Hüper & js-joda contributors
1
+ //! @version @js-joda/extra - 0.8.0
2
+ //! @copyright (c) 2015-present, Philipp Thürwächter, Pattrick Hüper & js-joda contributors
3
3
  //! @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos
4
4
  //! @license BSD-3-Clause (see LICENSE in the root directory of this source tree)
5
5
 
6
- (function webpackUniversalModuleDefinition(root, factory) {
7
- if(typeof exports === 'object' && typeof module === 'object')
8
- module.exports = factory(require("@js-joda/core"));
9
- else if(typeof define === 'function' && define.amd)
10
- define(["@js-joda/core"], factory);
11
- else if(typeof exports === 'object')
12
- exports["JSJodaExtra"] = factory(require("@js-joda/core"));
13
- else
14
- root["JSJodaExtra"] = factory(root["JSJoda"]);
15
- })(this, function(__WEBPACK_EXTERNAL_MODULE__js_joda_core__) {
16
- return /******/ (function(modules) { // webpackBootstrap
17
- /******/ // The module cache
18
- /******/ var installedModules = {};
19
- /******/
20
- /******/ // The require function
21
- /******/ function __webpack_require__(moduleId) {
22
- /******/
23
- /******/ // Check if module is in cache
24
- /******/ if(installedModules[moduleId]) {
25
- /******/ return installedModules[moduleId].exports;
26
- /******/ }
27
- /******/ // Create a new module (and put it into the cache)
28
- /******/ var module = installedModules[moduleId] = {
29
- /******/ i: moduleId,
30
- /******/ l: false,
31
- /******/ exports: {}
32
- /******/ };
33
- /******/
34
- /******/ // Execute the module function
35
- /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
36
- /******/
37
- /******/ // Flag the module as loaded
38
- /******/ module.l = true;
39
- /******/
40
- /******/ // Return the exports of the module
41
- /******/ return module.exports;
42
- /******/ }
43
- /******/
44
- /******/
45
- /******/ // expose the modules object (__webpack_modules__)
46
- /******/ __webpack_require__.m = modules;
47
- /******/
48
- /******/ // expose the module cache
49
- /******/ __webpack_require__.c = installedModules;
50
- /******/
51
- /******/ // define getter function for harmony exports
52
- /******/ __webpack_require__.d = function(exports, name, getter) {
53
- /******/ if(!__webpack_require__.o(exports, name)) {
54
- /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
55
- /******/ }
56
- /******/ };
57
- /******/
58
- /******/ // define __esModule on exports
59
- /******/ __webpack_require__.r = function(exports) {
60
- /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
61
- /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
62
- /******/ }
63
- /******/ Object.defineProperty(exports, '__esModule', { value: true });
64
- /******/ };
65
- /******/
66
- /******/ // create a fake namespace object
67
- /******/ // mode & 1: value is a module id, require it
68
- /******/ // mode & 2: merge all properties of value into the ns
69
- /******/ // mode & 4: return value when already ns object
70
- /******/ // mode & 8|1: behave like require
71
- /******/ __webpack_require__.t = function(value, mode) {
72
- /******/ if(mode & 1) value = __webpack_require__(value);
73
- /******/ if(mode & 8) return value;
74
- /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
75
- /******/ var ns = Object.create(null);
76
- /******/ __webpack_require__.r(ns);
77
- /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
78
- /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
79
- /******/ return ns;
80
- /******/ };
81
- /******/
82
- /******/ // getDefaultExport function for compatibility with non-harmony modules
83
- /******/ __webpack_require__.n = function(module) {
84
- /******/ var getter = module && module.__esModule ?
85
- /******/ function getDefault() { return module['default']; } :
86
- /******/ function getModuleExports() { return module; };
87
- /******/ __webpack_require__.d(getter, 'a', getter);
88
- /******/ return getter;
89
- /******/ };
90
- /******/
91
- /******/ // Object.prototype.hasOwnProperty.call
92
- /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
93
- /******/
94
- /******/ // __webpack_public_path__
95
- /******/ __webpack_require__.p = "";
96
- /******/
97
- /******/
98
- /******/ // Load entry module and return exports
99
- /******/ return __webpack_require__(__webpack_require__.s = "./src/js-joda-extra.js");
100
- /******/ })
101
- /************************************************************************/
102
- /******/ ({
103
-
104
- /***/ "./src/Interval.js":
105
- /*!*************************!*\
106
- !*** ./src/Interval.js ***!
107
- \*************************/
108
- /*! exports provided: Interval, _init */
109
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
110
-
111
- "use strict";
112
- __webpack_require__.r(__webpack_exports__);
113
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Interval", function() { return Interval; });
114
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_init", function() { return _init; });
115
- /* harmony import */ var _js_joda_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @js-joda/core */ "@js-joda/core");
116
- /* harmony import */ var _js_joda_core__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__);
117
- /* harmony import */ var _assert__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./assert */ "./src/assert.js");
118
- /*
119
- * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper
120
- * @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos
121
- * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)
122
- */
123
-
124
-
125
- var Interval = function () {
126
- Interval.of = function of(startInstant, endInstantOrDuration) {
127
- if (endInstantOrDuration instanceof _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["Duration"]) {
128
- return Interval.ofInstantDuration(startInstant, endInstantOrDuration);
129
- } else {
130
- return Interval.ofInstantInstant(startInstant, endInstantOrDuration);
131
- }
132
- };
6
+ (function (global, factory) {
7
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@js-joda/core')) :
8
+ typeof define === 'function' && define.amd ? define(['exports', '@js-joda/core'], factory) :
9
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.JSJodaExtra = {}, global.JSJoda));
10
+ })(this, (function (exports, core) { 'use strict';
11
+
12
+ /**
13
+ * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper
14
+ * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)
15
+ */
16
+ function requireNonNull(value, parameterName) {
17
+ if (value == null) {
18
+ throw new core.NullPointerException(parameterName + " must not be null");
19
+ }
133
20
 
134
- Interval.ofInstantInstant = function ofInstantInstant(startInclusive, endExclusive) {
135
- Object(_assert__WEBPACK_IMPORTED_MODULE_1__["requireNonNull"])(startInclusive, 'startInclusive');
136
- Object(_assert__WEBPACK_IMPORTED_MODULE_1__["requireNonNull"])(endExclusive, 'endExclusive');
137
- Object(_assert__WEBPACK_IMPORTED_MODULE_1__["requireInstance"])(startInclusive, _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["Instant"], 'startInclusive');
138
- Object(_assert__WEBPACK_IMPORTED_MODULE_1__["requireInstance"])(endExclusive, _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["Instant"], 'endExclusive');
21
+ return value;
22
+ }
23
+ function requireInstance(value, _class, parameterName) {
24
+ if (!(value instanceof _class)) {
25
+ throw new core.IllegalArgumentException(parameterName + " must be an instance of " + (_class.name ? _class.name : _class) + (value && value.constructor && value.constructor.name ? ", but is " + value.constructor.name : ''));
26
+ }
139
27
 
140
- if (endExclusive.isBefore(startInclusive)) {
141
- throw new _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["DateTimeException"]('End instant must on or after start instant');
28
+ return value;
142
29
  }
143
30
 
144
- return new Interval(startInclusive, endExclusive);
145
- };
31
+ /*
32
+ * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper
33
+ * @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos
34
+ * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)
35
+ */
36
+ var Interval = function () {
37
+ Interval.of = function of(startInstant, endInstantOrDuration) {
38
+ if (endInstantOrDuration instanceof core.Duration) {
39
+ return Interval.ofInstantDuration(startInstant, endInstantOrDuration);
40
+ } else {
41
+ return Interval.ofInstantInstant(startInstant, endInstantOrDuration);
42
+ }
43
+ };
146
44
 
147
- Interval.ofInstantDuration = function ofInstantDuration(startInclusive, duration) {
148
- Object(_assert__WEBPACK_IMPORTED_MODULE_1__["requireNonNull"])(startInclusive, 'startInclusive');
149
- Object(_assert__WEBPACK_IMPORTED_MODULE_1__["requireNonNull"])(duration, 'duration');
150
- Object(_assert__WEBPACK_IMPORTED_MODULE_1__["requireInstance"])(startInclusive, _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["Instant"], 'startInclusive');
151
- Object(_assert__WEBPACK_IMPORTED_MODULE_1__["requireInstance"])(duration, _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["Duration"], 'duration');
45
+ Interval.ofInstantInstant = function ofInstantInstant(startInclusive, endExclusive) {
46
+ requireNonNull(startInclusive, 'startInclusive');
47
+ requireNonNull(endExclusive, 'endExclusive');
48
+ requireInstance(startInclusive, core.Instant, 'startInclusive');
49
+ requireInstance(endExclusive, core.Instant, 'endExclusive');
152
50
 
153
- if (duration.isNegative()) {
154
- throw new _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["DateTimeException"]('Duration must not be zero or negative');
155
- }
51
+ if (endExclusive.isBefore(startInclusive)) {
52
+ throw new core.DateTimeException('End instant must on or after start instant');
53
+ }
156
54
 
157
- return new Interval(startInclusive, startInclusive.plus(duration));
158
- };
55
+ return new Interval(startInclusive, endExclusive);
56
+ };
159
57
 
160
- Interval.parse = function parse(text) {
161
- Object(_assert__WEBPACK_IMPORTED_MODULE_1__["requireNonNull"])(text, 'text');
58
+ Interval.ofInstantDuration = function ofInstantDuration(startInclusive, duration) {
59
+ requireNonNull(startInclusive, 'startInclusive');
60
+ requireNonNull(duration, 'duration');
61
+ requireInstance(startInclusive, core.Instant, 'startInclusive');
62
+ requireInstance(duration, core.Duration, 'duration');
162
63
 
163
- if (!(typeof text === 'string')) {
164
- throw new _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["IllegalArgumentException"]("text must be a string, but is " + text.constructor.name);
165
- }
64
+ if (duration.isNegative()) {
65
+ throw new core.DateTimeException('Duration must not be zero or negative');
66
+ }
166
67
 
167
- for (var i = 0; i < text.length; i += 1) {
168
- if (text.charAt(i) === '/') {
169
- var firstChar = text.charAt(0);
68
+ return new Interval(startInclusive, startInclusive.plus(duration));
69
+ };
170
70
 
171
- if (firstChar === 'P' || firstChar === 'p') {
172
- var duration = _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["Duration"].parse(text.substring(0, i));
173
- var end = _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ZonedDateTime"].parse(text.substring(i + 1, text.length)).toInstant();
174
- return Interval.of(end.minus(duration), end);
175
- } else {
176
- var start = _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ZonedDateTime"].parse(text.substring(0, i)).toInstant();
71
+ Interval.parse = function parse(text) {
72
+ requireNonNull(text, 'text');
73
+
74
+ if (!(typeof text === 'string')) {
75
+ throw new core.IllegalArgumentException("text must be a string, but is " + text.constructor.name);
76
+ }
177
77
 
178
- if (i + 1 < text.length) {
179
- var c = text.charAt(i + 1);
78
+ for (var i = 0; i < text.length; i += 1) {
79
+ if (text.charAt(i) === '/') {
80
+ var firstChar = text.charAt(0);
180
81
 
181
- if (c === 'P' || c === 'p') {
182
- var _duration = _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["Duration"].parse(text.substring(i + 1, text.length));
82
+ if (firstChar === 'P' || firstChar === 'p') {
83
+ var duration = core.Duration.parse(text.substring(0, i));
84
+ var end = core.ZonedDateTime.parse(text.substring(i + 1, text.length)).toInstant();
85
+ return Interval.of(end.minus(duration), end);
86
+ } else {
87
+ var start = core.ZonedDateTime.parse(text.substring(0, i)).toInstant();
183
88
 
184
- return Interval.of(start, start.plus(_duration));
89
+ if (i + 1 < text.length) {
90
+ var c = text.charAt(i + 1);
91
+
92
+ if (c === 'P' || c === 'p') {
93
+ var _duration = core.Duration.parse(text.substring(i + 1, text.length));
94
+
95
+ return Interval.of(start, start.plus(_duration));
96
+ }
97
+ }
98
+
99
+ var _end = core.ZonedDateTime.parse(text.substring(i + 1, text.length)).toInstant();
100
+
101
+ return Interval.of(start, _end);
185
102
  }
186
103
  }
104
+ }
187
105
 
188
- var _end = _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ZonedDateTime"].parse(text.substring(i + 1, text.length)).toInstant();
106
+ throw new core.DateTimeParseException('Interval cannot be parsed, no forward slash found', text, 0);
107
+ };
189
108
 
190
- return Interval.of(start, _end);
191
- }
109
+ function Interval(startInclusive, endExclusive) {
110
+ this._start = startInclusive;
111
+ this._end = endExclusive;
192
112
  }
193
- }
194
113
 
195
- throw new _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["DateTimeParseException"]('Interval cannot be parsed, no forward slash found', text, 0);
196
- };
197
-
198
- function Interval(startInclusive, endExclusive) {
199
- this._start = startInclusive;
200
- this._end = endExclusive;
201
- }
202
-
203
- var _proto = Interval.prototype;
204
-
205
- _proto.start = function start() {
206
- return this._start;
207
- };
208
-
209
- _proto.end = function end() {
210
- return this._end;
211
- };
212
-
213
- _proto.isEmpty = function isEmpty() {
214
- return this._start.equals(this._end);
215
- };
216
-
217
- _proto.isUnboundedStart = function isUnboundedStart() {
218
- return this._start.equals(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["Instant"].MIN);
219
- };
220
-
221
- _proto.isUnboundedEnd = function isUnboundedEnd() {
222
- return this._end.equals(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["Instant"].MAX);
223
- };
224
-
225
- _proto.withStart = function withStart(start) {
226
- return Interval.of(start, this._end);
227
- };
228
-
229
- _proto.withEnd = function withEnd(end) {
230
- return Interval.of(this._start, end);
231
- };
232
-
233
- _proto.contains = function contains(instant) {
234
- Object(_assert__WEBPACK_IMPORTED_MODULE_1__["requireNonNull"])(instant, 'instant');
235
- Object(_assert__WEBPACK_IMPORTED_MODULE_1__["requireInstance"])(instant, _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["Instant"], 'instant');
236
- return this._start.compareTo(instant) <= 0 && (instant.compareTo(this._end) < 0 || this.isUnboundedEnd());
237
- };
238
-
239
- _proto.encloses = function encloses(other) {
240
- Object(_assert__WEBPACK_IMPORTED_MODULE_1__["requireNonNull"])(other, 'other');
241
- Object(_assert__WEBPACK_IMPORTED_MODULE_1__["requireInstance"])(other, Interval, 'other');
242
- return this._start.compareTo(other.start()) <= 0 && other.end().compareTo(this._end) <= 0;
243
- };
244
-
245
- _proto.abuts = function abuts(other) {
246
- Object(_assert__WEBPACK_IMPORTED_MODULE_1__["requireNonNull"])(other, 'other');
247
- Object(_assert__WEBPACK_IMPORTED_MODULE_1__["requireInstance"])(other, Interval, 'other');
248
- return !this._end.equals(other.start()) !== !this._start.equals(other.end());
249
- };
250
-
251
- _proto.isConnected = function isConnected(other) {
252
- Object(_assert__WEBPACK_IMPORTED_MODULE_1__["requireNonNull"])(other, 'other');
253
- Object(_assert__WEBPACK_IMPORTED_MODULE_1__["requireInstance"])(other, Interval, 'other');
254
- return this.equals(other) || this._start.compareTo(other.end()) <= 0 && other.start().compareTo(this._end) <= 0;
255
- };
256
-
257
- _proto.overlaps = function overlaps(other) {
258
- Object(_assert__WEBPACK_IMPORTED_MODULE_1__["requireNonNull"])(other, 'other');
259
- Object(_assert__WEBPACK_IMPORTED_MODULE_1__["requireInstance"])(other, Interval, 'other');
260
- return other.equals(this) || this._start.compareTo(other.end()) < 0 && other.start().compareTo(this._end) < 0;
261
- };
262
-
263
- _proto.intersection = function intersection(other) {
264
- Object(_assert__WEBPACK_IMPORTED_MODULE_1__["requireNonNull"])(other, 'other');
265
- Object(_assert__WEBPACK_IMPORTED_MODULE_1__["requireInstance"])(other, Interval, 'other');
266
-
267
- if (this.isConnected(other) === false) {
268
- throw new _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["DateTimeException"]("Intervals do not connect: " + this + " and " + other);
269
- }
114
+ var _proto = Interval.prototype;
115
+
116
+ _proto.start = function start() {
117
+ return this._start;
118
+ };
119
+
120
+ _proto.end = function end() {
121
+ return this._end;
122
+ };
123
+
124
+ _proto.isEmpty = function isEmpty() {
125
+ return this._start.equals(this._end);
126
+ };
127
+
128
+ _proto.isUnboundedStart = function isUnboundedStart() {
129
+ return this._start.equals(core.Instant.MIN);
130
+ };
131
+
132
+ _proto.isUnboundedEnd = function isUnboundedEnd() {
133
+ return this._end.equals(core.Instant.MAX);
134
+ };
135
+
136
+ _proto.withStart = function withStart(start) {
137
+ return Interval.of(start, this._end);
138
+ };
139
+
140
+ _proto.withEnd = function withEnd(end) {
141
+ return Interval.of(this._start, end);
142
+ };
143
+
144
+ _proto.contains = function contains(instant) {
145
+ requireNonNull(instant, 'instant');
146
+ requireInstance(instant, core.Instant, 'instant');
147
+ return this._start.compareTo(instant) <= 0 && (instant.compareTo(this._end) < 0 || this.isUnboundedEnd());
148
+ };
149
+
150
+ _proto.encloses = function encloses(other) {
151
+ requireNonNull(other, 'other');
152
+ requireInstance(other, Interval, 'other');
153
+ return this._start.compareTo(other.start()) <= 0 && other.end().compareTo(this._end) <= 0;
154
+ };
155
+
156
+ _proto.abuts = function abuts(other) {
157
+ requireNonNull(other, 'other');
158
+ requireInstance(other, Interval, 'other');
159
+ return !this._end.equals(other.start()) !== !this._start.equals(other.end());
160
+ };
161
+
162
+ _proto.isConnected = function isConnected(other) {
163
+ requireNonNull(other, 'other');
164
+ requireInstance(other, Interval, 'other');
165
+ return this.equals(other) || this._start.compareTo(other.end()) <= 0 && other.start().compareTo(this._end) <= 0;
166
+ };
167
+
168
+ _proto.overlaps = function overlaps(other) {
169
+ requireNonNull(other, 'other');
170
+ requireInstance(other, Interval, 'other');
171
+ return other.equals(this) || this._start.compareTo(other.end()) < 0 && other.start().compareTo(this._end) < 0;
172
+ };
173
+
174
+ _proto.intersection = function intersection(other) {
175
+ requireNonNull(other, 'other');
176
+ requireInstance(other, Interval, 'other');
177
+
178
+ if (this.isConnected(other) === false) {
179
+ throw new core.DateTimeException("Intervals do not connect: " + this + " and " + other);
180
+ }
270
181
 
271
- var cmpStart = this._start.compareTo(other.start());
182
+ var cmpStart = this._start.compareTo(other.start());
272
183
 
273
- var cmpEnd = this._end.compareTo(other.end());
184
+ var cmpEnd = this._end.compareTo(other.end());
274
185
 
275
- if (cmpStart >= 0 && cmpEnd <= 0) {
276
- return this;
277
- } else if (cmpStart <= 0 && cmpEnd >= 0) {
278
- return other;
279
- } else {
280
- var newStart = cmpStart >= 0 ? this._start : other.start();
281
- var newEnd = cmpEnd <= 0 ? this._end : other.end();
282
- return Interval.of(newStart, newEnd);
283
- }
284
- };
186
+ if (cmpStart >= 0 && cmpEnd <= 0) {
187
+ return this;
188
+ } else if (cmpStart <= 0 && cmpEnd >= 0) {
189
+ return other;
190
+ } else {
191
+ var newStart = cmpStart >= 0 ? this._start : other.start();
192
+ var newEnd = cmpEnd <= 0 ? this._end : other.end();
193
+ return Interval.of(newStart, newEnd);
194
+ }
195
+ };
285
196
 
286
- _proto.union = function union(other) {
287
- Object(_assert__WEBPACK_IMPORTED_MODULE_1__["requireNonNull"])(other, 'other');
288
- Object(_assert__WEBPACK_IMPORTED_MODULE_1__["requireInstance"])(other, Interval, 'other');
197
+ _proto.union = function union(other) {
198
+ requireNonNull(other, 'other');
199
+ requireInstance(other, Interval, 'other');
289
200
 
290
- if (this.isConnected(other) === false) {
291
- throw new _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["DateTimeException"]("Intervals do not connect: " + this + " and " + other);
292
- }
201
+ if (this.isConnected(other) === false) {
202
+ throw new core.DateTimeException("Intervals do not connect: " + this + " and " + other);
203
+ }
293
204
 
294
- var cmpStart = this._start.compareTo(other.start());
205
+ var cmpStart = this._start.compareTo(other.start());
295
206
 
296
- var cmpEnd = this._end.compareTo(other.end());
207
+ var cmpEnd = this._end.compareTo(other.end());
297
208
 
298
- if (cmpStart >= 0 && cmpEnd <= 0) {
299
- return other;
300
- } else if (cmpStart <= 0 && cmpEnd >= 0) {
301
- return this;
302
- } else {
303
- var newStart = cmpStart >= 0 ? other.start() : this._start;
304
- var newEnd = cmpEnd <= 0 ? other.end() : this._end;
305
- return Interval.of(newStart, newEnd);
306
- }
307
- };
209
+ if (cmpStart >= 0 && cmpEnd <= 0) {
210
+ return other;
211
+ } else if (cmpStart <= 0 && cmpEnd >= 0) {
212
+ return this;
213
+ } else {
214
+ var newStart = cmpStart >= 0 ? other.start() : this._start;
215
+ var newEnd = cmpEnd <= 0 ? other.end() : this._end;
216
+ return Interval.of(newStart, newEnd);
217
+ }
218
+ };
308
219
 
309
- _proto.span = function span(other) {
310
- Object(_assert__WEBPACK_IMPORTED_MODULE_1__["requireNonNull"])(other, 'other');
311
- Object(_assert__WEBPACK_IMPORTED_MODULE_1__["requireInstance"])(other, Interval, 'other');
220
+ _proto.span = function span(other) {
221
+ requireNonNull(other, 'other');
222
+ requireInstance(other, Interval, 'other');
312
223
 
313
- var cmpStart = this._start.compareTo(other.start());
224
+ var cmpStart = this._start.compareTo(other.start());
314
225
 
315
- var cmpEnd = this._end.compareTo(other.end());
226
+ var cmpEnd = this._end.compareTo(other.end());
316
227
 
317
- var newStart = cmpStart >= 0 ? other.start() : this._start;
318
- var newEnd = cmpEnd <= 0 ? other.end() : this._end;
319
- return Interval.of(newStart, newEnd);
320
- };
228
+ var newStart = cmpStart >= 0 ? other.start() : this._start;
229
+ var newEnd = cmpEnd <= 0 ? other.end() : this._end;
230
+ return Interval.of(newStart, newEnd);
231
+ };
321
232
 
322
- _proto.isAfter = function isAfter(instantOrInterval) {
323
- if (instantOrInterval instanceof _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["Instant"]) {
324
- return this.isAfterInstant(instantOrInterval);
325
- } else {
326
- return this.isAfterInterval(instantOrInterval);
327
- }
328
- };
233
+ _proto.isAfter = function isAfter(instantOrInterval) {
234
+ if (instantOrInterval instanceof core.Instant) {
235
+ return this.isAfterInstant(instantOrInterval);
236
+ } else {
237
+ return this.isAfterInterval(instantOrInterval);
238
+ }
239
+ };
329
240
 
330
- _proto.isBefore = function isBefore(instantOrInterval) {
331
- if (instantOrInterval instanceof _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["Instant"]) {
332
- return this.isBeforeInstant(instantOrInterval);
333
- } else {
334
- return this.isBeforeInterval(instantOrInterval);
335
- }
336
- };
241
+ _proto.isBefore = function isBefore(instantOrInterval) {
242
+ if (instantOrInterval instanceof core.Instant) {
243
+ return this.isBeforeInstant(instantOrInterval);
244
+ } else {
245
+ return this.isBeforeInterval(instantOrInterval);
246
+ }
247
+ };
337
248
 
338
- _proto.isAfterInstant = function isAfterInstant(instant) {
339
- return this._start.compareTo(instant) > 0;
340
- };
249
+ _proto.isAfterInstant = function isAfterInstant(instant) {
250
+ return this._start.compareTo(instant) > 0;
251
+ };
341
252
 
342
- _proto.isBeforeInstant = function isBeforeInstant(instant) {
343
- return this._end.compareTo(instant) <= 0 && this._start.compareTo(instant) < 0;
344
- };
253
+ _proto.isBeforeInstant = function isBeforeInstant(instant) {
254
+ return this._end.compareTo(instant) <= 0 && this._start.compareTo(instant) < 0;
255
+ };
345
256
 
346
- _proto.isAfterInterval = function isAfterInterval(interval) {
347
- return this._start.compareTo(interval.end()) >= 0 && !interval.equals(this);
348
- };
257
+ _proto.isAfterInterval = function isAfterInterval(interval) {
258
+ return this._start.compareTo(interval.end()) >= 0 && !interval.equals(this);
259
+ };
349
260
 
350
- _proto.isBeforeInterval = function isBeforeInterval(interval) {
351
- return this._end.compareTo(interval.start()) <= 0 && !interval.equals(this);
352
- };
261
+ _proto.isBeforeInterval = function isBeforeInterval(interval) {
262
+ return this._end.compareTo(interval.start()) <= 0 && !interval.equals(this);
263
+ };
353
264
 
354
- _proto.toDuration = function toDuration() {
355
- return _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["Duration"].between(this._start, this._end);
356
- };
265
+ _proto.toDuration = function toDuration() {
266
+ return core.Duration.between(this._start, this._end);
267
+ };
357
268
 
358
- _proto.equals = function equals(obj) {
359
- if (this === obj) {
360
- return true;
361
- }
269
+ _proto.equals = function equals(obj) {
270
+ if (this === obj) {
271
+ return true;
272
+ }
273
+
274
+ if (obj instanceof Interval) {
275
+ return this._start.equals(obj.start()) && this._end.equals(obj.end());
276
+ }
277
+
278
+ return false;
279
+ };
280
+
281
+ _proto.hashCode = function hashCode() {
282
+ return this._start.hashCode() ^ this._end.hashCode();
283
+ };
284
+
285
+ _proto.toString = function toString() {
286
+ return this._start.toString() + "/" + this._end.toString();
287
+ };
362
288
 
363
- if (obj instanceof Interval) {
364
- return this._start.equals(obj.start()) && this._end.equals(obj.end());
289
+ return Interval;
290
+ }();
291
+ function _init() {
292
+ Interval.ALL = Interval.of(core.Instant.MIN, core.Instant.MAX);
365
293
  }
366
294
 
367
- return false;
368
- };
369
-
370
- _proto.hashCode = function hashCode() {
371
- return this._start.hashCode() ^ this._end.hashCode();
372
- };
373
-
374
- _proto.toString = function toString() {
375
- return this._start.toString() + "/" + this._end.toString();
376
- };
377
-
378
- return Interval;
379
- }();
380
- function _init() {
381
- Interval.ALL = Interval.of(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["Instant"].MIN, _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["Instant"].MAX);
382
- }
383
-
384
- /***/ }),
385
-
386
- /***/ "./src/_init.js":
387
- /*!**********************!*\
388
- !*** ./src/_init.js ***!
389
- \**********************/
390
- /*! no exports provided */
391
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
392
-
393
- "use strict";
394
- __webpack_require__.r(__webpack_exports__);
395
- /* harmony import */ var _Interval__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Interval */ "./src/Interval.js");
396
- /*
397
- * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper
398
- * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)
399
- */
400
-
401
- var isInit = false;
402
-
403
- function init() {
404
- if (isInit) {
405
- return;
406
- }
407
-
408
- isInit = true;
409
- Object(_Interval__WEBPACK_IMPORTED_MODULE_0__["_init"])();
410
- }
411
-
412
- init();
413
-
414
- /***/ }),
415
-
416
- /***/ "./src/assert.js":
417
- /*!***********************!*\
418
- !*** ./src/assert.js ***!
419
- \***********************/
420
- /*! exports provided: assert, requireNonNull, requireInstance, abstractMethodFail */
421
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
422
-
423
- "use strict";
424
- __webpack_require__.r(__webpack_exports__);
425
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "assert", function() { return assert; });
426
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "requireNonNull", function() { return requireNonNull; });
427
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "requireInstance", function() { return requireInstance; });
428
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "abstractMethodFail", function() { return abstractMethodFail; });
429
- /* harmony import */ var _js_joda_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @js-joda/core */ "@js-joda/core");
430
- /* harmony import */ var _js_joda_core__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__);
431
- /**
432
- * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper
433
- * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)
434
- */
435
-
436
- function assert(assertion, msg, error) {
437
- if (!assertion) {
438
- if (error) {
439
- throw new error(msg);
440
- } else {
441
- throw new Error(msg);
295
+ /*
296
+ * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper
297
+ * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)
298
+ */
299
+ var isInit = false;
300
+
301
+ function init() {
302
+ if (isInit) {
303
+ return;
304
+ }
305
+
306
+ isInit = true;
307
+ _init();
442
308
  }
443
- }
444
- }
445
- function requireNonNull(value, parameterName) {
446
- if (value == null) {
447
- throw new _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["NullPointerException"](parameterName + " must not be null");
448
- }
449
-
450
- return value;
451
- }
452
- function requireInstance(value, _class, parameterName) {
453
- if (!(value instanceof _class)) {
454
- throw new _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["IllegalArgumentException"](parameterName + " must be an instance of " + (_class.name ? _class.name : _class) + (value && value.constructor && value.constructor.name ? ", but is " + value.constructor.name : ''));
455
- }
456
-
457
- return value;
458
- }
459
- function abstractMethodFail(methodName) {
460
- throw new TypeError("abstract method \"" + methodName + "\" is not implemented");
461
- }
462
-
463
- /***/ }),
464
-
465
- /***/ "./src/js-joda-extra.js":
466
- /*!******************************!*\
467
- !*** ./src/js-joda-extra.js ***!
468
- \******************************/
469
- /*! exports provided: Interval */
470
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
471
-
472
- "use strict";
473
- __webpack_require__.r(__webpack_exports__);
474
- /* harmony import */ var _js_joda_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @js-joda/core */ "@js-joda/core");
475
- /* harmony import */ var _js_joda_core__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__);
476
- /* harmony import */ var _Interval__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Interval */ "./src/Interval.js");
477
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Interval", function() { return _Interval__WEBPACK_IMPORTED_MODULE_1__["Interval"]; });
478
-
479
- /* harmony import */ var _plug__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./plug */ "./src/plug.js");
480
- /*
481
- * @copyright (c) 2016, Philipp Thuerwaechter & Pattrick Hueper
482
- * @license BSD-3-Clause (see LICENSE.md in the root directory of this source tree)
483
- */
484
-
485
-
486
-
487
- Object(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["use"])(_plug__WEBPACK_IMPORTED_MODULE_2__["default"]);
488
-
489
-
490
- /***/ }),
491
-
492
- /***/ "./src/plug.js":
493
- /*!*********************!*\
494
- !*** ./src/plug.js ***!
495
- \*********************/
496
- /*! exports provided: default */
497
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
498
-
499
- "use strict";
500
- __webpack_require__.r(__webpack_exports__);
501
- /* harmony import */ var _init__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_init */ "./src/_init.js");
502
- /*
503
- * @copyright (c) 2016, Philipp Thuerwaechter & Pattrick Hueper
504
- * @license BSD-3-Clause (see LICENSE.md in the root directory of this source tree)
505
- */
506
-
507
- /* harmony default export */ __webpack_exports__["default"] = (function () {});
508
-
509
- /***/ }),
510
-
511
- /***/ "@js-joda/core":
512
- /*!***************************************************************************************************************!*\
513
- !*** external {"amd":"@js-joda/core","commonjs":"@js-joda/core","commonjs2":"@js-joda/core","root":"JSJoda"} ***!
514
- \***************************************************************************************************************/
515
- /*! no static exports found */
516
- /***/ (function(module, exports) {
517
-
518
- module.exports = __WEBPACK_EXTERNAL_MODULE__js_joda_core__;
519
-
520
- /***/ })
521
-
522
- /******/ });
523
- });
309
+
310
+ init();
311
+
312
+ /*
313
+ * @copyright (c) 2016, Philipp Thuerwaechter & Pattrick Hueper
314
+ * @license BSD-3-Clause (see LICENSE.md in the root directory of this source tree)
315
+ */
316
+ function plug () {}
317
+
318
+ /*
319
+ * @copyright (c) 2016, Philipp Thuerwaechter & Pattrick Hueper
320
+ * @license BSD-3-Clause (see LICENSE.md in the root directory of this source tree)
321
+ */
322
+ core.use(plug);
323
+
324
+ exports.Interval = Interval;
325
+
326
+ Object.defineProperty(exports, '__esModule', { value: true });
327
+
328
+ }));
329
+ //# sourceMappingURL=js-joda-extra.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["webpack://JSJodaExtra/webpack/universalModuleDefinition","webpack://JSJodaExtra/webpack/bootstrap","webpack://JSJodaExtra/./src/Interval.js","webpack://JSJodaExtra/./src/_init.js","webpack://JSJodaExtra/./src/assert.js","webpack://JSJodaExtra/./src/js-joda-extra.js","webpack://JSJodaExtra/./src/plug.js","webpack://JSJodaExtra/external {\"amd\":\"@js-joda/core\",\"commonjs\":\"@js-joda/core\",\"commonjs2\":\"@js-joda/core\",\"root\":\"JSJoda\"}"],"names":["Interval","of","startInstant","endInstantOrDuration","Duration","ofInstantDuration","ofInstantInstant","startInclusive","endExclusive","requireNonNull","requireInstance","Instant","isBefore","DateTimeException","duration","isNegative","plus","parse","text","IllegalArgumentException","constructor","name","i","length","charAt","firstChar","substring","end","ZonedDateTime","toInstant","minus","start","c","DateTimeParseException","_start","_end","isEmpty","equals","isUnboundedStart","MIN","isUnboundedEnd","MAX","withStart","withEnd","contains","instant","compareTo","encloses","other","abuts","isConnected","overlaps","intersection","cmpStart","cmpEnd","newStart","newEnd","union","span","isAfter","instantOrInterval","isAfterInstant","isAfterInterval","isBeforeInstant","isBeforeInterval","interval","toDuration","between","obj","hashCode","toString","_init","ALL","isInit","init","intervalInit","assert","assertion","msg","error","Error","value","parameterName","NullPointerException","_class","abstractMethodFail","methodName","TypeError","use","plug"],"mappings":";;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;QCVA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QAC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AA3M,EAAN;AACH;;AACD,SAAO4D,KAAP;AACH;AAOM,SAASI,kBAAT,CAA4BC,UAA5B,EAAwC;AAC3C,QAAM,IAAIC,SAAJ,wBAAkCD,UAAlC,2BAAN;AACH,C;;;;;;;;;;;;AC5DD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AAEA;AAEA;AACA;AAEAE,yDAAG,CAACC,6CAAD,CAAH;;;;;;;;;;;;;ACVA;AAAA;AAAA;AACA;AACA;AACA;AAIA;AAOe,2EAAwB,CAGtC,C;;;;;;;;;;;ACjBD,2D","file":"js-joda-extra.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"@js-joda/core\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"@js-joda/core\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"JSJodaExtra\"] = factory(require(\"@js-joda/core\"));\n\telse\n\t\troot[\"JSJodaExtra\"] = factory(root[\"JSJoda\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE__js_joda_core__) {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./src/js-joda-extra.js\");\n","/*\n * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper\n * @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos\n * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)\n */\n\n/* eslint-disable no-else-return */\nimport { DateTimeException, DateTimeParseException, Duration, IllegalArgumentException, Instant, ZonedDateTime } from '@js-joda/core';\n\n// TODO: hm... is this a good idea?? copied from joda currently, could we add a js-joda-utils module??\nimport { requireNonNull, requireInstance } from './assert';\n\n/**\n * An immutable interval of time between two instants.\n * <p>\n * An interval represents the time on the time-line between two {@link Instant}s.\n * The class stores the start and end instants, with the start inclusive and the end exclusive.\n * The end instant is always greater than or equal to the start instant.\n * <p>\n * The {@link Duration} of an interval can be obtained, but is a separate concept.\n * An interval is connected to the time-line, whereas a duration is not.\n * <p>\n * Intervals are not comparable. To compare the length of two intervals, it is\n * generally recommended to compare their durations.\n *\n */\nexport class Interval {\n //-----------------------------------------------------------------------\n /**\n * function overloading for {@link Interval.of}\n *\n * if called without arguments, then {@link Interval.ofInstantInstant} is executed.\n\n * if called with 1 arguments and first argument is an instance of ZoneId, then {@link Interval.ofInstantDuration} is executed.\n *\n * Otherwise {@link Interval.ofInstantDuration} is executed.\n *\n * @param {!(Instant)} startInstant\n * @param {!(Instant|Duration)} endInstantOrDuration\n * @returns {Interval}\n */\n static of(startInstant, endInstantOrDuration) {\n if (endInstantOrDuration instanceof Duration) {\n return Interval.ofInstantDuration(startInstant, endInstantOrDuration);\n } else {\n return Interval.ofInstantInstant(startInstant, endInstantOrDuration);\n }\n }\n\n /**\n * Obtains an instance of {@code Interval} from the start and end instant.\n * <p>\n * The end instant must not be before the start instant.\n *\n * @param {Instant} startInclusive the start instant, inclusive, MIN_DATE treated as unbounded, not null\n * @param {Instant} endExclusive the end instant, exclusive, MAX_DATE treated as unbounded, not null\n * @return {Interval} the half-open interval, not null\n * @throws DateTimeException if the end is before the start\n */\n static ofInstantInstant(startInclusive, endExclusive) {\n requireNonNull(startInclusive, 'startInclusive');\n requireNonNull(endExclusive, 'endExclusive');\n requireInstance(startInclusive, Instant, 'startInclusive');\n requireInstance(endExclusive, Instant, 'endExclusive');\n if (endExclusive.isBefore(startInclusive)) {\n throw new DateTimeException('End instant must on or after start instant');\n }\n return new Interval(startInclusive, endExclusive);\n }\n\n /**\n * Obtains an instance of {@code Interval} from the start and a duration.\n * <p>\n * The end instant is calculated as the start plus the duration.\n * The duration must not be negative.\n *\n * @param {Instant} startInclusive the start instant, inclusive, not null\n * @param {Duration} duration the duration from the start to the end, not null\n * @return {Interval} the interval, not null\n * @throws DateTimeException if the end is before the start,\n * or if the duration addition cannot be made\n * @throws ArithmeticException if numeric overflow occurs when adding the duration\n */\n static ofInstantDuration(startInclusive, duration) {\n requireNonNull(startInclusive, 'startInclusive');\n requireNonNull(duration, 'duration');\n requireInstance(startInclusive, Instant, 'startInclusive');\n requireInstance(duration, Duration, 'duration');\n if (duration.isNegative()) {\n throw new DateTimeException('Duration must not be zero or negative');\n }\n return new Interval(startInclusive, startInclusive.plus(duration));\n }\n\n //-----------------------------------------------------------------------\n\n /**\n * Obtains an instance of {@code Interval} from a text string such as\n * {@code 2007-12-03T10:15:30Z/2007-12-04T10:15:30Z}, where the end instant is exclusive.\n * <p>\n * The string must consist of one of the following three formats:\n * <ul>\n * <li>a representations of an {@link ZonedDateTime}, followed by a forward slash,\n * followed by a representation of a {@link ZonedDateTime}\n * <li>a representation of an {@link ZonedDateTime}, followed by a forward slash,\n * followed by a representation of a {@link Duration}\n * <li>a representation of a {@link Duration}, followed by a forward slash,\n * followed by a representation of an {@link ZonedDateTime}\n * </ul>\n *\n * NOTE: in contrast to the threeten-extra base we are not using `OffsetDateTime` but `ZonedDateTime` to parse\n * the string, this does not change the format but adds the possibility to optionally specify a zone\n *\n * @param {string} text the text to parse, not null\n * @return {Interval} the parsed interval, not null\n * @throws DateTimeParseException if the text cannot be parsed\n */\n static parse(text) {\n requireNonNull(text, 'text');\n if (!(typeof text === 'string')) {\n throw new IllegalArgumentException(`text must be a string, but is ${text.constructor.name}`);\n }\n for (let i = 0; i < text.length; i += 1) {\n if (text.charAt(i) === '/') {\n const firstChar = text.charAt(0);\n if (firstChar === 'P' || firstChar === 'p') {\n // duration followed by instant\n const duration = Duration.parse(text.substring(0, i));\n const end = ZonedDateTime.parse(text.substring(i + 1, text.length)).toInstant();\n return Interval.of(end.minus(duration), end);\n } else {\n // instant followed by instant or duration\n const start = ZonedDateTime.parse(text.substring(0, i)).toInstant();\n if (i + 1 < text.length) {\n const c = text.charAt(i + 1);\n if (c === 'P' || c === 'p') {\n const duration = Duration.parse(text.substring(i + 1, text.length));\n return Interval.of(start, start.plus(duration));\n }\n }\n const end = ZonedDateTime.parse(text.substring(i + 1, text.length)).toInstant();\n return Interval.of(start, end);\n }\n }\n }\n throw new DateTimeParseException('Interval cannot be parsed, no forward slash found', text, 0);\n }\n //-----------------------------------------------------------------------\n /**\n * Constructor.\n *\n * @param {Instant} startInclusive the start instant, inclusive, validated not null\n * @param {Instant} endExclusive the end instant, exclusive, validated not null\n */\n constructor(startInclusive, endExclusive) {\n this._start = startInclusive;\n this._end = endExclusive;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Gets the start of this time interval, inclusive.\n * <p>\n * This will return {@link Instant#MIN} if the range is unbounded at the start.\n * In this case, the range includes all dates into the far-past.\n *\n * @return {Instant} the start of the time interval\n */\n start() {\n return this._start;\n }\n\n /**\n * Gets the end of this time interval, exclusive.\n * <p>\n * This will return {@link Instant#MAX} if the range is unbounded at the end.\n * In this case, the range includes all dates into the far-future.\n *\n * @return {Instant} the end of the time interval, exclusive\n */\n end() {\n return this._end;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Checks if the range is empty.\n * <p>\n * An empty range occurs when the start date equals the inclusive end date.\n *\n * @return {boolean} true if the range is empty\n */\n isEmpty() {\n return this._start.equals(this._end);\n }\n\n /**\n * Checks if the start of the interval is unbounded.\n *\n * @return {boolean} true if start is unbounded\n */\n isUnboundedStart() {\n return this._start.equals(Instant.MIN);\n }\n\n /**\n * Checks if the end of the interval is unbounded.\n *\n * @return {boolean} true if end is unbounded\n */\n isUnboundedEnd() {\n return this._end.equals(Instant.MAX);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Returns a copy of this range with the specified start instant.\n *\n * @param {Instant} start the start instant for the new interval, not null\n * @return {Interval} an interval with the end from this interval and the specified start\n * @throws DateTimeException if the resulting interval has end before start\n */\n withStart(start) {\n return Interval.of(start, this._end);\n }\n\n /**\n * Returns a copy of this range with the specified end instant.\n *\n * @param {Instant} end the end instant for the new interval, not null\n * @return {Interval} an interval with the start from this interval and the specified end\n * @throws DateTimeException if the resulting interval has end before start\n */\n withEnd(end) {\n return Interval.of(this._start, end);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Checks if this interval contains the specified instant.\n * <p>\n * This checks if the specified instant is within the bounds of this interval.\n * If this range has an unbounded start then {@code contains(Instant#MIN)} returns true.\n * If this range has an unbounded end then {@code contains(Instant#MAX)} returns true.\n * If this range is empty then this method always returns false.\n *\n * @param {Instant} instant the instant, not null\n * @return {boolean} true if this interval contains the instant\n */\n contains(instant) {\n requireNonNull(instant, 'instant');\n requireInstance(instant, Instant, 'instant');\n return this._start.compareTo(instant) <= 0 && (instant.compareTo(this._end) < 0 || this.isUnboundedEnd());\n }\n\n /**\n * Checks if this interval encloses the specified interval.\n * <p>\n * This checks if the bounds of the specified interval are within the bounds of this interval.\n * An empty interval encloses itself.\n *\n * @param {Interval} other the other interval, not null\n * @return {boolean} true if this interval contains the other interval\n */\n encloses(other) {\n requireNonNull(other, 'other');\n requireInstance(other, Interval, 'other');\n return this._start.compareTo(other.start()) <= 0 && other.end().compareTo(this._end) <= 0;\n }\n\n /**\n * Checks if this interval abuts the specified interval.\n * <p>\n * The result is true if the end of this interval is the start of the other, or vice versa.\n * An empty interval does not abut itself.\n *\n * @param {Interval} other the other interval, not null\n * @return {boolean} true if this interval abuts the other interval\n */\n abuts(other) {\n requireNonNull(other, 'other');\n requireInstance(other, Interval, 'other');\n return !this._end.equals(other.start()) !== !this._start.equals(other.end());\n }\n\n /**\n * Checks if this interval is connected to the specified interval.\n * <p>\n * The result is true if the two intervals have an enclosed interval in common, even if that interval is empty.\n * An empty interval is connected to itself.\n * <p>\n * This is equivalent to {@code (overlaps(other) || abuts(other))}.\n *\n * @param {Interval} other the other interval, not null\n * @return {boolean} true if this interval is connected to the other interval\n */\n isConnected(other) {\n requireNonNull(other, 'other');\n requireInstance(other, Interval, 'other');\n return this.equals(other) || (this._start.compareTo(other.end()) <= 0 && other.start().compareTo(this._end) <= 0);\n }\n\n /**\n * Checks if this interval overlaps the specified interval.\n * <p>\n * The result is true if the the two intervals share some part of the time-line.\n * An empty interval overlaps itself.\n * <p>\n * This is equivalent to {@code (isConnected(other) && !abuts(other))}.\n *\n * @param {Interval} other the time interval to compare to, null means a zero length interval now\n * @return {boolean} true if the time intervals overlap\n */\n overlaps(other) {\n requireNonNull(other, 'other');\n requireInstance(other, Interval, 'other');\n return other.equals(this) || (this._start.compareTo(other.end()) < 0 && other.start().compareTo(this._end) < 0);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Calculates the interval that is the intersection of this interval and the specified interval.\n * <p>\n * This finds the intersection of two intervals.\n * This throws an exception if the two intervals are not {@linkplain #isConnected(Interval) connected}.\n *\n * @param {Interval} other the other interval to check for, not null\n * @return {Interval} the interval that is the intersection of the two intervals\n * @throws DateTimeException if the intervals do not connect\n */\n intersection(other) {\n requireNonNull(other, 'other');\n requireInstance(other, Interval, 'other');\n if (this.isConnected(other) === false) {\n throw new DateTimeException(`Intervals do not connect: ${this} and ${other}`);\n }\n const cmpStart = this._start.compareTo(other.start());\n const cmpEnd = this._end.compareTo(other.end());\n if (cmpStart >= 0 && cmpEnd <= 0) {\n return this;\n } else if (cmpStart <= 0 && cmpEnd >= 0) {\n return other;\n } else {\n const newStart = (cmpStart >= 0 ? this._start : other.start());\n const newEnd = (cmpEnd <= 0 ? this._end : other.end());\n return Interval.of(newStart, newEnd);\n }\n }\n\n /**\n * Calculates the interval that is the union of this interval and the specified interval.\n * <p>\n * This finds the union of two intervals.\n * This throws an exception if the two intervals are not {@linkplain #isConnected(Interval) connected}.\n *\n * @param {Interval} other the other interval to check for, not null\n * @return {Interval} the interval that is the union of the two intervals\n * @throws DateTimeException if the intervals do not connect\n */\n union(other) {\n requireNonNull(other, 'other');\n requireInstance(other, Interval, 'other');\n if (this.isConnected(other) === false) {\n throw new DateTimeException(`Intervals do not connect: ${this} and ${other}`);\n }\n const cmpStart = this._start.compareTo(other.start());\n const cmpEnd = this._end.compareTo(other.end());\n if (cmpStart >= 0 && cmpEnd <= 0) {\n return other;\n } else if (cmpStart <= 0 && cmpEnd >= 0) {\n return this;\n } else {\n const newStart = (cmpStart >= 0 ? other.start() : this._start);\n const newEnd = (cmpEnd <= 0 ? other.end() : this._end);\n return Interval.of(newStart, newEnd);\n }\n }\n\n /**\n * Calculates the smallest interval that encloses this interval and the specified interval.\n * <p>\n * The result of this method will {@linkplain #encloses(Interval) enclose}\n * this interval and the specified interval.\n *\n * @param {Interval} other the other interval to check for, not null\n * @return {Interval} the interval that spans the two intervals\n */\n span(other) {\n requireNonNull(other, 'other');\n requireInstance(other, Interval, 'other');\n const cmpStart = this._start.compareTo(other.start());\n const cmpEnd = this._end.compareTo(other.end());\n const newStart = (cmpStart >= 0 ? other.start() : this._start);\n const newEnd = (cmpEnd <= 0 ? other.end() : this._end);\n return Interval.of(newStart, newEnd);\n }\n\n //-------------------------------------------------------------------------\n /**\n * function overloading for {@link Interval#isAfter}\n *\n * if called with an Instant, then {@link Interval#isAfterInstant} is executed.\n *\n * Otherwise {@link Interval#isAfterInterval} is executed.\n *\n * @param {!(Instant|Interval)} instantOrInterval\n * @returns {boolean}\n */\n isAfter(instantOrInterval) {\n if (instantOrInterval instanceof Instant) {\n return this.isAfterInstant(instantOrInterval);\n } else {\n return this.isAfterInterval(instantOrInterval);\n }\n }\n\n /**\n * function overloading for {@link Interval#isBefore}\n *\n * if called with an Instant, then {@link Interval#isBeforeInstant} is executed.\n *\n * Otherwise {@link Interval#isBeforeInterval} is executed.\n *\n * @param {!(Instant|Interval)} instantOrInterval\n * @returns {boolean}\n */\n isBefore(instantOrInterval) {\n if (instantOrInterval instanceof Instant) {\n return this.isBeforeInstant(instantOrInterval);\n } else {\n return this.isBeforeInterval(instantOrInterval);\n }\n }\n\n /**\n * Checks if this interval is after the specified instant.\n * <p>\n * The result is true if the this instant starts after the specified instant.\n * An empty interval behaves as though it is an instant for comparison purposes.\n *\n * @param {Instant} instant the other instant to compare to, not null\n * @return {boolean} true if the start of this interval is after the specified instant\n */\n isAfterInstant(instant) {\n return this._start.compareTo(instant) > 0;\n }\n\n /**\n * Checks if this interval is before the specified instant.\n * <p>\n * The result is true if the this instant ends before the specified instant.\n * Since intervals do not include their end points, this will return true if the\n * instant equals the end of the interval.\n * An empty interval behaves as though it is an instant for comparison purposes.\n *\n * @param {Instant} instant the other instant to compare to, not null\n * @return {boolean} true if the start of this interval is before the specified instant\n */\n isBeforeInstant(instant) {\n return this._end.compareTo(instant) <= 0 && this._start.compareTo(instant) < 0;\n }\n\n //-------------------------------------------------------------------------\n /**\n * Checks if this interval is after the specified interval.\n * <p>\n * The result is true if the this instant starts after the end of the specified interval.\n * Since intervals do not include their end points, this will return true if the\n * instant equals the end of the interval.\n * An empty interval behaves as though it is an instant for comparison purposes.\n *\n * @param {Interval} interval the other interval to compare to, not null\n * @return {boolean} true if this instant is after the specified instant\n */\n isAfterInterval(interval) {\n return this._start.compareTo(interval.end()) >= 0 && !interval.equals(this);\n }\n\n /**\n * Checks if this interval is before the specified interval.\n * <p>\n * The result is true if the this instant ends before the start of the specified interval.\n * Since intervals do not include their end points, this will return true if the\n * two intervals abut.\n * An empty interval behaves as though it is an instant for comparison purposes.\n *\n * @param {Interval} interval the other interval to compare to, not null\n * @return {boolean} true if this instant is before the specified instant\n */\n isBeforeInterval(interval) {\n return this._end.compareTo(interval.start()) <= 0 && !interval.equals(this);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Obtains the duration of this interval.\n * <p>\n * An {@code Interval} is associated with two specific instants on the time-line.\n * A {@code Duration} is simply an amount of time, separate from the time-line.\n *\n * @return {Duration} the duration of the time interval\n * @throws ArithmeticException if the calculation exceeds the capacity of {@code Duration}\n */\n toDuration() {\n return Duration.between(this._start, this._end);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Checks if this interval is equal to another interval.\n * <p>\n * Compares this {@code Interval} with another ensuring that the two instants are the same.\n * Only objects of type {@code Interval} are compared, other types return false.\n *\n * @param {*} obj the object to check, null returns false\n * @return {boolean} true if this is equal to the other interval\n */\n equals(obj) {\n if (this === obj) {\n return true;\n }\n if (obj instanceof Interval) {\n return this._start.equals(obj.start()) && this._end.equals(obj.end());\n }\n return false;\n }\n\n /**\n * A hash code for this interval.\n *\n * @return {number} a suitable hash code\n */\n hashCode() {\n // eslint-disable-next-line no-bitwise\n return this._start.hashCode() ^ this._end.hashCode();\n }\n\n //-----------------------------------------------------------------------\n /**\n * Outputs this interval as a {@code String}, such as {@code 2007-12-03T10:15:30/2007-12-04T10:15:30}.\n * <p>\n * The output will be the ISO-8601 format formed by combining the\n * {@code toString()} methods of the two instants, separated by a forward slash.\n *\n * @return {string} a string representation of this instant, not null\n */\n toString() {\n return `${this._start.toString()}/${this._end.toString()}`;\n }\n}\n\nexport function _init() {\n Interval.ALL = Interval.of(Instant.MIN, Instant.MAX);\n}\n","/*\n * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper\n * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)\n */\n\nimport { _init as intervalInit } from './Interval';\n\nlet isInit = false;\n\nfunction init() {\n if (isInit) {\n return;\n }\n\n isInit = true;\n\n intervalInit();\n}\n\ninit();\n","/**\n * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper\n * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)\n */\nimport { NullPointerException, IllegalArgumentException } from '@js-joda/core';\n\n/**\n * @private\n *\n * @param assertion\n * @param msg\n * @param error\n */\nexport function assert(assertion, msg, error) {\n if (!assertion) {\n if (error) {\n // eslint-disable-next-line new-cap\n throw new error(msg);\n } else {\n throw new Error(msg);\n }\n }\n}\n\n/**\n * @private\n *\n * @param value\n * @param parameterName\n * @returns {*}\n */\nexport function requireNonNull(value, parameterName) {\n if (value == null) {\n throw new NullPointerException(`${parameterName} must not be null`);\n }\n return value;\n}\n\n/**\n * @private\n *\n * @param value\n * @param _class\n * @param parameterName\n * @returns {_class}\n */\nexport function requireInstance(value, _class, parameterName) {\n if (!(value instanceof _class)) {\n throw new IllegalArgumentException(`${parameterName} must be an instance of ${_class.name ? _class.name : _class}${value && value.constructor && value.constructor.name ? `, but is ${value.constructor.name}` : ''}`);\n }\n return value;\n}\n\n/**\n * @private\n *\n * @param methodName\n */\nexport function abstractMethodFail(methodName) {\n throw new TypeError(`abstract method \"${methodName}\" is not implemented`);\n}\n","/*\n * @copyright (c) 2016, Philipp Thuerwaechter & Pattrick Hueper\n * @license BSD-3-Clause (see LICENSE.md in the root directory of this source tree)\n */\n\nimport { use } from '@js-joda/core';\n\nimport { Interval } from './Interval';\nimport plug from './plug';\n\nuse(plug);\n\nexport {\n Interval,\n};\n","/*\n * @copyright (c) 2016, Philipp Thuerwaechter & Pattrick Hueper\n * @license BSD-3-Clause (see LICENSE.md in the root directory of this source tree)\n */\n\n// import { Interval } from './Interval';\n\nimport './_init';\n\n/**\n * @private\n *\n * plugin Function, call using js-jodas use()\n */\nexport default function (/* jsJoda */) {\n // assign new prop to jsJoda context is useless, because it lives only in the local context\n // jsJoda.Interval = Interval;\n}\n","module.exports = __WEBPACK_EXTERNAL_MODULE__js_joda_core__;"],"sourceRoot":""}
1
+ {"version":3,"file":"js-joda-extra.js","sources":["../src/assert.js","../src/Interval.js","../src/_init.js","../src/plug.js","../src/js-joda-extra.js"],"sourcesContent":["/**\n * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper\n * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)\n */\nimport { NullPointerException, IllegalArgumentException } from '@js-joda/core';\n\n/**\n * @private\n *\n * @param assertion\n * @param msg\n * @param error\n */\nexport function assert(assertion, msg, error) {\n if (!assertion) {\n if (error) {\n // eslint-disable-next-line new-cap\n throw new error(msg);\n } else {\n throw new Error(msg);\n }\n }\n}\n\n/**\n * @private\n *\n * @param value\n * @param parameterName\n * @returns {*}\n */\nexport function requireNonNull(value, parameterName) {\n if (value == null) {\n throw new NullPointerException(`${parameterName} must not be null`);\n }\n return value;\n}\n\n/**\n * @private\n *\n * @param value\n * @param _class\n * @param parameterName\n * @returns {_class}\n */\nexport function requireInstance(value, _class, parameterName) {\n if (!(value instanceof _class)) {\n throw new IllegalArgumentException(`${parameterName} must be an instance of ${_class.name ? _class.name : _class}${value && value.constructor && value.constructor.name ? `, but is ${value.constructor.name}` : ''}`);\n }\n return value;\n}\n\n/**\n * @private\n *\n * @param methodName\n */\nexport function abstractMethodFail(methodName) {\n throw new TypeError(`abstract method \"${methodName}\" is not implemented`);\n}\n","/*\n * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper\n * @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos\n * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)\n */\n\nimport { DateTimeException, DateTimeParseException, Duration, IllegalArgumentException, Instant, ZonedDateTime } from '@js-joda/core';\n\n// TODO: hm... is this a good idea?? copied from joda currently, could we add a js-joda-utils module??\nimport { requireNonNull, requireInstance } from './assert';\n\n/**\n * An immutable interval of time between two instants.\n * <p>\n * An interval represents the time on the time-line between two {@link Instant}s.\n * The class stores the start and end instants, with the start inclusive and the end exclusive.\n * The end instant is always greater than or equal to the start instant.\n * <p>\n * The {@link Duration} of an interval can be obtained, but is a separate concept.\n * An interval is connected to the time-line, whereas a duration is not.\n * <p>\n * Intervals are not comparable. To compare the length of two intervals, it is\n * generally recommended to compare their durations.\n *\n */\nexport class Interval {\n //-----------------------------------------------------------------------\n /**\n * function overloading for {@link Interval.of}\n *\n * if called without arguments, then {@link Interval.ofInstantInstant} is executed.\n\n * if called with 1 arguments and first argument is an instance of ZoneId, then {@link Interval.ofInstantDuration} is executed.\n *\n * Otherwise {@link Interval.ofInstantDuration} is executed.\n *\n * @param {!(Instant)} startInstant\n * @param {!(Instant|Duration)} endInstantOrDuration\n * @returns {Interval}\n */\n static of(startInstant, endInstantOrDuration) {\n if (endInstantOrDuration instanceof Duration) {\n return Interval.ofInstantDuration(startInstant, endInstantOrDuration);\n } else {\n return Interval.ofInstantInstant(startInstant, endInstantOrDuration);\n }\n }\n\n /**\n * Obtains an instance of {@code Interval} from the start and end instant.\n * <p>\n * The end instant must not be before the start instant.\n *\n * @param {Instant} startInclusive the start instant, inclusive, MIN_DATE treated as unbounded, not null\n * @param {Instant} endExclusive the end instant, exclusive, MAX_DATE treated as unbounded, not null\n * @return {Interval} the half-open interval, not null\n * @throws DateTimeException if the end is before the start\n */\n static ofInstantInstant(startInclusive, endExclusive) {\n requireNonNull(startInclusive, 'startInclusive');\n requireNonNull(endExclusive, 'endExclusive');\n requireInstance(startInclusive, Instant, 'startInclusive');\n requireInstance(endExclusive, Instant, 'endExclusive');\n if (endExclusive.isBefore(startInclusive)) {\n throw new DateTimeException('End instant must on or after start instant');\n }\n return new Interval(startInclusive, endExclusive);\n }\n\n /**\n * Obtains an instance of {@code Interval} from the start and a duration.\n * <p>\n * The end instant is calculated as the start plus the duration.\n * The duration must not be negative.\n *\n * @param {Instant} startInclusive the start instant, inclusive, not null\n * @param {Duration} duration the duration from the start to the end, not null\n * @return {Interval} the interval, not null\n * @throws DateTimeException if the end is before the start,\n * or if the duration addition cannot be made\n * @throws ArithmeticException if numeric overflow occurs when adding the duration\n */\n static ofInstantDuration(startInclusive, duration) {\n requireNonNull(startInclusive, 'startInclusive');\n requireNonNull(duration, 'duration');\n requireInstance(startInclusive, Instant, 'startInclusive');\n requireInstance(duration, Duration, 'duration');\n if (duration.isNegative()) {\n throw new DateTimeException('Duration must not be zero or negative');\n }\n return new Interval(startInclusive, startInclusive.plus(duration));\n }\n\n //-----------------------------------------------------------------------\n\n /**\n * Obtains an instance of {@code Interval} from a text string such as\n * {@code 2007-12-03T10:15:30Z/2007-12-04T10:15:30Z}, where the end instant is exclusive.\n * <p>\n * The string must consist of one of the following three formats:\n * <ul>\n * <li>a representations of an {@link ZonedDateTime}, followed by a forward slash,\n * followed by a representation of a {@link ZonedDateTime}\n * <li>a representation of an {@link ZonedDateTime}, followed by a forward slash,\n * followed by a representation of a {@link Duration}\n * <li>a representation of a {@link Duration}, followed by a forward slash,\n * followed by a representation of an {@link ZonedDateTime}\n * </ul>\n *\n * NOTE: in contrast to the threeten-extra base we are not using `OffsetDateTime` but `ZonedDateTime` to parse\n * the string, this does not change the format but adds the possibility to optionally specify a zone\n *\n * @param {string} text the text to parse, not null\n * @return {Interval} the parsed interval, not null\n * @throws DateTimeParseException if the text cannot be parsed\n */\n static parse(text) {\n requireNonNull(text, 'text');\n if (!(typeof text === 'string')) {\n throw new IllegalArgumentException(`text must be a string, but is ${text.constructor.name}`);\n }\n for (let i = 0; i < text.length; i += 1) {\n if (text.charAt(i) === '/') {\n const firstChar = text.charAt(0);\n if (firstChar === 'P' || firstChar === 'p') {\n // duration followed by instant\n const duration = Duration.parse(text.substring(0, i));\n const end = ZonedDateTime.parse(text.substring(i + 1, text.length)).toInstant();\n return Interval.of(end.minus(duration), end);\n } else {\n // instant followed by instant or duration\n const start = ZonedDateTime.parse(text.substring(0, i)).toInstant();\n if (i + 1 < text.length) {\n const c = text.charAt(i + 1);\n if (c === 'P' || c === 'p') {\n const duration = Duration.parse(text.substring(i + 1, text.length));\n return Interval.of(start, start.plus(duration));\n }\n }\n const end = ZonedDateTime.parse(text.substring(i + 1, text.length)).toInstant();\n return Interval.of(start, end);\n }\n }\n }\n throw new DateTimeParseException('Interval cannot be parsed, no forward slash found', text, 0);\n }\n //-----------------------------------------------------------------------\n /**\n * Constructor.\n *\n * @param {Instant} startInclusive the start instant, inclusive, validated not null\n * @param {Instant} endExclusive the end instant, exclusive, validated not null\n */\n constructor(startInclusive, endExclusive) {\n this._start = startInclusive;\n this._end = endExclusive;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Gets the start of this time interval, inclusive.\n * <p>\n * This will return {@link Instant#MIN} if the range is unbounded at the start.\n * In this case, the range includes all dates into the far-past.\n *\n * @return {Instant} the start of the time interval\n */\n start() {\n return this._start;\n }\n\n /**\n * Gets the end of this time interval, exclusive.\n * <p>\n * This will return {@link Instant#MAX} if the range is unbounded at the end.\n * In this case, the range includes all dates into the far-future.\n *\n * @return {Instant} the end of the time interval, exclusive\n */\n end() {\n return this._end;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Checks if the range is empty.\n * <p>\n * An empty range occurs when the start date equals the inclusive end date.\n *\n * @return {boolean} true if the range is empty\n */\n isEmpty() {\n return this._start.equals(this._end);\n }\n\n /**\n * Checks if the start of the interval is unbounded.\n *\n * @return {boolean} true if start is unbounded\n */\n isUnboundedStart() {\n return this._start.equals(Instant.MIN);\n }\n\n /**\n * Checks if the end of the interval is unbounded.\n *\n * @return {boolean} true if end is unbounded\n */\n isUnboundedEnd() {\n return this._end.equals(Instant.MAX);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Returns a copy of this range with the specified start instant.\n *\n * @param {Instant} start the start instant for the new interval, not null\n * @return {Interval} an interval with the end from this interval and the specified start\n * @throws DateTimeException if the resulting interval has end before start\n */\n withStart(start) {\n return Interval.of(start, this._end);\n }\n\n /**\n * Returns a copy of this range with the specified end instant.\n *\n * @param {Instant} end the end instant for the new interval, not null\n * @return {Interval} an interval with the start from this interval and the specified end\n * @throws DateTimeException if the resulting interval has end before start\n */\n withEnd(end) {\n return Interval.of(this._start, end);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Checks if this interval contains the specified instant.\n * <p>\n * This checks if the specified instant is within the bounds of this interval.\n * If this range has an unbounded start then {@code contains(Instant#MIN)} returns true.\n * If this range has an unbounded end then {@code contains(Instant#MAX)} returns true.\n * If this range is empty then this method always returns false.\n *\n * @param {Instant} instant the instant, not null\n * @return {boolean} true if this interval contains the instant\n */\n contains(instant) {\n requireNonNull(instant, 'instant');\n requireInstance(instant, Instant, 'instant');\n return this._start.compareTo(instant) <= 0 && (instant.compareTo(this._end) < 0 || this.isUnboundedEnd());\n }\n\n /**\n * Checks if this interval encloses the specified interval.\n * <p>\n * This checks if the bounds of the specified interval are within the bounds of this interval.\n * An empty interval encloses itself.\n *\n * @param {Interval} other the other interval, not null\n * @return {boolean} true if this interval contains the other interval\n */\n encloses(other) {\n requireNonNull(other, 'other');\n requireInstance(other, Interval, 'other');\n return this._start.compareTo(other.start()) <= 0 && other.end().compareTo(this._end) <= 0;\n }\n\n /**\n * Checks if this interval abuts the specified interval.\n * <p>\n * The result is true if the end of this interval is the start of the other, or vice versa.\n * An empty interval does not abut itself.\n *\n * @param {Interval} other the other interval, not null\n * @return {boolean} true if this interval abuts the other interval\n */\n abuts(other) {\n requireNonNull(other, 'other');\n requireInstance(other, Interval, 'other');\n return !this._end.equals(other.start()) !== !this._start.equals(other.end());\n }\n\n /**\n * Checks if this interval is connected to the specified interval.\n * <p>\n * The result is true if the two intervals have an enclosed interval in common, even if that interval is empty.\n * An empty interval is connected to itself.\n * <p>\n * This is equivalent to {@code (overlaps(other) || abuts(other))}.\n *\n * @param {Interval} other the other interval, not null\n * @return {boolean} true if this interval is connected to the other interval\n */\n isConnected(other) {\n requireNonNull(other, 'other');\n requireInstance(other, Interval, 'other');\n return this.equals(other) || (this._start.compareTo(other.end()) <= 0 && other.start().compareTo(this._end) <= 0);\n }\n\n /**\n * Checks if this interval overlaps the specified interval.\n * <p>\n * The result is true if the the two intervals share some part of the time-line.\n * An empty interval overlaps itself.\n * <p>\n * This is equivalent to {@code (isConnected(other) && !abuts(other))}.\n *\n * @param {Interval} other the time interval to compare to, null means a zero length interval now\n * @return {boolean} true if the time intervals overlap\n */\n overlaps(other) {\n requireNonNull(other, 'other');\n requireInstance(other, Interval, 'other');\n return other.equals(this) || (this._start.compareTo(other.end()) < 0 && other.start().compareTo(this._end) < 0);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Calculates the interval that is the intersection of this interval and the specified interval.\n * <p>\n * This finds the intersection of two intervals.\n * This throws an exception if the two intervals are not {@linkplain #isConnected(Interval) connected}.\n *\n * @param {Interval} other the other interval to check for, not null\n * @return {Interval} the interval that is the intersection of the two intervals\n * @throws DateTimeException if the intervals do not connect\n */\n intersection(other) {\n requireNonNull(other, 'other');\n requireInstance(other, Interval, 'other');\n if (this.isConnected(other) === false) {\n throw new DateTimeException(`Intervals do not connect: ${this} and ${other}`);\n }\n const cmpStart = this._start.compareTo(other.start());\n const cmpEnd = this._end.compareTo(other.end());\n if (cmpStart >= 0 && cmpEnd <= 0) {\n return this;\n } else if (cmpStart <= 0 && cmpEnd >= 0) {\n return other;\n } else {\n const newStart = (cmpStart >= 0 ? this._start : other.start());\n const newEnd = (cmpEnd <= 0 ? this._end : other.end());\n return Interval.of(newStart, newEnd);\n }\n }\n\n /**\n * Calculates the interval that is the union of this interval and the specified interval.\n * <p>\n * This finds the union of two intervals.\n * This throws an exception if the two intervals are not {@linkplain #isConnected(Interval) connected}.\n *\n * @param {Interval} other the other interval to check for, not null\n * @return {Interval} the interval that is the union of the two intervals\n * @throws DateTimeException if the intervals do not connect\n */\n union(other) {\n requireNonNull(other, 'other');\n requireInstance(other, Interval, 'other');\n if (this.isConnected(other) === false) {\n throw new DateTimeException(`Intervals do not connect: ${this} and ${other}`);\n }\n const cmpStart = this._start.compareTo(other.start());\n const cmpEnd = this._end.compareTo(other.end());\n if (cmpStart >= 0 && cmpEnd <= 0) {\n return other;\n } else if (cmpStart <= 0 && cmpEnd >= 0) {\n return this;\n } else {\n const newStart = (cmpStart >= 0 ? other.start() : this._start);\n const newEnd = (cmpEnd <= 0 ? other.end() : this._end);\n return Interval.of(newStart, newEnd);\n }\n }\n\n /**\n * Calculates the smallest interval that encloses this interval and the specified interval.\n * <p>\n * The result of this method will {@linkplain #encloses(Interval) enclose}\n * this interval and the specified interval.\n *\n * @param {Interval} other the other interval to check for, not null\n * @return {Interval} the interval that spans the two intervals\n */\n span(other) {\n requireNonNull(other, 'other');\n requireInstance(other, Interval, 'other');\n const cmpStart = this._start.compareTo(other.start());\n const cmpEnd = this._end.compareTo(other.end());\n const newStart = (cmpStart >= 0 ? other.start() : this._start);\n const newEnd = (cmpEnd <= 0 ? other.end() : this._end);\n return Interval.of(newStart, newEnd);\n }\n\n //-------------------------------------------------------------------------\n /**\n * function overloading for {@link Interval#isAfter}\n *\n * if called with an Instant, then {@link Interval#isAfterInstant} is executed.\n *\n * Otherwise {@link Interval#isAfterInterval} is executed.\n *\n * @param {!(Instant|Interval)} instantOrInterval\n * @returns {boolean}\n */\n isAfter(instantOrInterval) {\n if (instantOrInterval instanceof Instant) {\n return this.isAfterInstant(instantOrInterval);\n } else {\n return this.isAfterInterval(instantOrInterval);\n }\n }\n\n /**\n * function overloading for {@link Interval#isBefore}\n *\n * if called with an Instant, then {@link Interval#isBeforeInstant} is executed.\n *\n * Otherwise {@link Interval#isBeforeInterval} is executed.\n *\n * @param {!(Instant|Interval)} instantOrInterval\n * @returns {boolean}\n */\n isBefore(instantOrInterval) {\n if (instantOrInterval instanceof Instant) {\n return this.isBeforeInstant(instantOrInterval);\n } else {\n return this.isBeforeInterval(instantOrInterval);\n }\n }\n\n /**\n * Checks if this interval is after the specified instant.\n * <p>\n * The result is true if the this instant starts after the specified instant.\n * An empty interval behaves as though it is an instant for comparison purposes.\n *\n * @param {Instant} instant the other instant to compare to, not null\n * @return {boolean} true if the start of this interval is after the specified instant\n */\n isAfterInstant(instant) {\n return this._start.compareTo(instant) > 0;\n }\n\n /**\n * Checks if this interval is before the specified instant.\n * <p>\n * The result is true if the this instant ends before the specified instant.\n * Since intervals do not include their end points, this will return true if the\n * instant equals the end of the interval.\n * An empty interval behaves as though it is an instant for comparison purposes.\n *\n * @param {Instant} instant the other instant to compare to, not null\n * @return {boolean} true if the start of this interval is before the specified instant\n */\n isBeforeInstant(instant) {\n return this._end.compareTo(instant) <= 0 && this._start.compareTo(instant) < 0;\n }\n\n //-------------------------------------------------------------------------\n /**\n * Checks if this interval is after the specified interval.\n * <p>\n * The result is true if the this instant starts after the end of the specified interval.\n * Since intervals do not include their end points, this will return true if the\n * instant equals the end of the interval.\n * An empty interval behaves as though it is an instant for comparison purposes.\n *\n * @param {Interval} interval the other interval to compare to, not null\n * @return {boolean} true if this instant is after the specified instant\n */\n isAfterInterval(interval) {\n return this._start.compareTo(interval.end()) >= 0 && !interval.equals(this);\n }\n\n /**\n * Checks if this interval is before the specified interval.\n * <p>\n * The result is true if the this instant ends before the start of the specified interval.\n * Since intervals do not include their end points, this will return true if the\n * two intervals abut.\n * An empty interval behaves as though it is an instant for comparison purposes.\n *\n * @param {Interval} interval the other interval to compare to, not null\n * @return {boolean} true if this instant is before the specified instant\n */\n isBeforeInterval(interval) {\n return this._end.compareTo(interval.start()) <= 0 && !interval.equals(this);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Obtains the duration of this interval.\n * <p>\n * An {@code Interval} is associated with two specific instants on the time-line.\n * A {@code Duration} is simply an amount of time, separate from the time-line.\n *\n * @return {Duration} the duration of the time interval\n * @throws ArithmeticException if the calculation exceeds the capacity of {@code Duration}\n */\n toDuration() {\n return Duration.between(this._start, this._end);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Checks if this interval is equal to another interval.\n * <p>\n * Compares this {@code Interval} with another ensuring that the two instants are the same.\n * Only objects of type {@code Interval} are compared, other types return false.\n *\n * @param {*} obj the object to check, null returns false\n * @return {boolean} true if this is equal to the other interval\n */\n equals(obj) {\n if (this === obj) {\n return true;\n }\n if (obj instanceof Interval) {\n return this._start.equals(obj.start()) && this._end.equals(obj.end());\n }\n return false;\n }\n\n /**\n * A hash code for this interval.\n *\n * @return {number} a suitable hash code\n */\n hashCode() {\n // eslint-disable-next-line no-bitwise\n return this._start.hashCode() ^ this._end.hashCode();\n }\n\n //-----------------------------------------------------------------------\n /**\n * Outputs this interval as a {@code String}, such as {@code 2007-12-03T10:15:30/2007-12-04T10:15:30}.\n * <p>\n * The output will be the ISO-8601 format formed by combining the\n * {@code toString()} methods of the two instants, separated by a forward slash.\n *\n * @return {string} a string representation of this instant, not null\n */\n toString() {\n return `${this._start.toString()}/${this._end.toString()}`;\n }\n}\n\nexport function _init() {\n Interval.ALL = Interval.of(Instant.MIN, Instant.MAX);\n}\n","/*\n * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper\n * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)\n */\n\nimport { _init as intervalInit } from './Interval';\n\nlet isInit = false;\n\nfunction init() {\n if (isInit) {\n return;\n }\n\n isInit = true;\n\n intervalInit();\n}\n\ninit();\n","/*\n * @copyright (c) 2016, Philipp Thuerwaechter & Pattrick Hueper\n * @license BSD-3-Clause (see LICENSE.md in the root directory of this source tree)\n */\n\n// import { Interval } from './Interval';\n\nimport './_init';\n\n/**\n * @private\n *\n * plugin Function, call using js-jodas use()\n */\nexport default function (/* jsJoda */) {\n // assign new prop to jsJoda context is useless, because it lives only in the local context\n // jsJoda.Interval = Interval;\n}\n","/*\n * @copyright (c) 2016, Philipp Thuerwaechter & Pattrick Hueper\n * @license BSD-3-Clause (see LICENSE.md in the root directory of this source tree)\n */\n\nimport { use } from '@js-joda/core';\n\nimport { Interval } from './Interval';\nimport plug from './plug';\n\nuse(plug);\n\nexport {\n Interval,\n};\n"],"names":["requireNonNull","value","parameterName","NullPointerException","requireInstance","_class","IllegalArgumentException","name","constructor","Interval","of","startInstant","endInstantOrDuration","Duration","ofInstantDuration","ofInstantInstant","startInclusive","endExclusive","Instant","isBefore","DateTimeException","duration","isNegative","plus","parse","text","i","length","charAt","firstChar","substring","end","ZonedDateTime","toInstant","minus","start","c","DateTimeParseException","_start","_end","isEmpty","equals","isUnboundedStart","MIN","isUnboundedEnd","MAX","withStart","withEnd","contains","instant","compareTo","encloses","other","abuts","isConnected","overlaps","intersection","cmpStart","cmpEnd","newStart","newEnd","union","span","isAfter","instantOrInterval","isAfterInstant","isAfterInterval","isBeforeInstant","isBeforeInterval","interval","toDuration","between","obj","hashCode","toString","_init","AL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,CAAYmC,QAAZ,KAAyB,KAAKlC,IAAL,CAAUkC,QAAV,EAAhC;IACH,GA7fL;;IAAA,SAwgBIC,QAxgBJ,GAwgBI,oBAAW;IACP,WAAU,KAAKpC,MAAL,CAAYoC,QAAZ,EAAV,SAAoC,KAAKnC,IAAL,CAAUmC,QAAV,EAApC;IACH,GA1gBL;;IAAA;IAAA;IA6gBO,SAASC,KAAT,GAAiB;IACpBlE,EAAAA,QAAQ,CAACmE,GAAT,GAAenE,QAAQ,CAACC,EAAT,CAAYQ,YAAO,CAACyB,GAApB,EAAyBzB,YAAO,CAAC2B,GAAjC,CAAf;IACH;;ICxiBD;IACA;IACA;IACA;IAIA,IAAIgC,MAAM,GAAG,KAAb;;IAEA,SAASC,IAAT,GAAgB;IACZ,MAAID,MAAJ,EAAY;IACR;IACH;;IAEDA,EAAAA,MAAM,GAAG,IAAT;IAEAE,EAAAA,KAAY;IACf;;IAEDD,IAAI;;ICnBJ;IACA;IACA;IACA;IAWe,iBAAwB;;ICdvC;IACA;IACA;IACA;AAOAE,YAAG,CAACC,IAAD,CAAH;;;;;;;;;;"}
@@ -1,5 +1,5 @@
1
- //! @version @js-joda/extra - 0.7.1
2
- //! @copyright (c) 2015-2016, Philipp Thürwächter, Pattrick Hüper & js-joda contributors
1
+ //! @version @js-joda/extra - 0.8.0
2
+ //! @copyright (c) 2015-present, Philipp Thürwächter, Pattrick Hüper & js-joda contributors
3
3
  //! @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos
4
4
  //! @license BSD-3-Clause (see LICENSE in the root directory of this source tree)
5
- !function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n(require("@js-joda/core")):"function"==typeof define&&define.amd?define(["@js-joda/core"],n):"object"==typeof exports?exports.JSJodaExtra=n(require("@js-joda/core")):t.JSJodaExtra=n(t.JSJoda)}(this,function(e){return s={},o.m=r=[function(t,n){t.exports=e},function(t,n,e){"use strict";e.r(n);var f=e(0);function h(t,n){if(null==t)throw new f.NullPointerException(n+" must not be null");return t}function s(t,n,e){if(!(t instanceof n))throw new f.IllegalArgumentException(e+" must be an instance of "+(n.name?n.name:n)+(t&&t.constructor&&t.constructor.name?", but is "+t.constructor.name:""));return t}var r=function(){function c(t,n){this._start=t,this._end=n}c.of=function(t,n){return n instanceof f.Duration?c.ofInstantDuration(t,n):c.ofInstantInstant(t,n)},c.ofInstantInstant=function(t,n){if(h(t,"startInclusive"),h(n,"endExclusive"),s(t,f.Instant,"startInclusive"),s(n,f.Instant,"endExclusive"),n.isBefore(t))throw new f.DateTimeException("End instant must on or after start instant");return new c(t,n)},c.ofInstantDuration=function(t,n){if(h(t,"startInclusive"),h(n,"duration"),s(t,f.Instant,"startInclusive"),s(n,f.Duration,"duration"),n.isNegative())throw new f.DateTimeException("Duration must not be zero or negative");return new c(t,t.plus(n))},c.parse=function(t){if(h(t,"text"),"string"!=typeof t)throw new f.IllegalArgumentException("text must be a string, but is "+t.constructor.name);for(var n=0;n<t.length;n+=1)if("/"===t.charAt(n)){var e=t.charAt(0);if("P"===e||"p"===e){var r=f.Duration.parse(t.substring(0,n)),o=f.ZonedDateTime.parse(t.substring(n+1,t.length)).toInstant();return c.of(o.minus(r),o)}var s=f.ZonedDateTime.parse(t.substring(0,n)).toInstant();if(n+1<t.length){var i=t.charAt(n+1);if("P"===i||"p"===i){var a=f.Duration.parse(t.substring(n+1,t.length));return c.of(s,s.plus(a))}}var u=f.ZonedDateTime.parse(t.substring(n+1,t.length)).toInstant();return c.of(s,u)}throw new f.DateTimeParseException("Interval cannot be parsed, no forward slash found",t,0)};var t=c.prototype;return t.start=function(){return this._start},t.end=function(){return this._end},t.isEmpty=function(){return this._start.equals(this._end)},t.isUnboundedStart=function(){return this._start.equals(f.Instant.MIN)},t.isUnboundedEnd=function(){return this._end.equals(f.Instant.MAX)},t.withStart=function(t){return c.of(t,this._end)},t.withEnd=function(t){return c.of(this._start,t)},t.contains=function(t){return h(t,"instant"),s(t,f.Instant,"instant"),this._start.compareTo(t)<=0&&(t.compareTo(this._end)<0||this.isUnboundedEnd())},t.encloses=function(t){return h(t,"other"),s(t,c,"other"),this._start.compareTo(t.start())<=0&&t.end().compareTo(this._end)<=0},t.abuts=function(t){return h(t,"other"),s(t,c,"other"),!this._end.equals(t.start())!=!this._start.equals(t.end())},t.isConnected=function(t){return h(t,"other"),s(t,c,"other"),this.equals(t)||this._start.compareTo(t.end())<=0&&t.start().compareTo(this._end)<=0},t.overlaps=function(t){return h(t,"other"),s(t,c,"other"),t.equals(this)||this._start.compareTo(t.end())<0&&t.start().compareTo(this._end)<0},t.intersection=function(t){if(h(t,"other"),s(t,c,"other"),!1===this.isConnected(t))throw new f.DateTimeException("Intervals do not connect: "+this+" and "+t);var n=this._start.compareTo(t.start()),e=this._end.compareTo(t.end());if(0<=n&&e<=0)return this;if(n<=0&&0<=e)return t;var r=0<=n?this._start:t.start(),o=e<=0?this._end:t.end();return c.of(r,o)},t.union=function(t){if(h(t,"other"),s(t,c,"other"),!1===this.isConnected(t))throw new f.DateTimeException("Intervals do not connect: "+this+" and "+t);var n=this._start.compareTo(t.start()),e=this._end.compareTo(t.end());if(0<=n&&e<=0)return t;if(n<=0&&0<=e)return this;var r=0<=n?t.start():this._start,o=e<=0?t.end():this._end;return c.of(r,o)},t.span=function(t){h(t,"other"),s(t,c,"other");var n=this._start.compareTo(t.start()),e=this._end.compareTo(t.end()),r=0<=n?t.start():this._start,o=e<=0?t.end():this._end;return c.of(r,o)},t.isAfter=function(t){return t instanceof f.Instant?this.isAfterInstant(t):this.isAfterInterval(t)},t.isBefore=function(t){return t instanceof f.Instant?this.isBeforeInstant(t):this.isBeforeInterval(t)},t.isAfterInstant=function(t){return 0<this._start.compareTo(t)},t.isBeforeInstant=function(t){return this._end.compareTo(t)<=0&&this._start.compareTo(t)<0},t.isAfterInterval=function(t){return 0<=this._start.compareTo(t.end())&&!t.equals(this)},t.isBeforeInterval=function(t){return this._end.compareTo(t.start())<=0&&!t.equals(this)},t.toDuration=function(){return f.Duration.between(this._start,this._end)},t.equals=function(t){return this===t||t instanceof c&&(this._start.equals(t.start())&&this._end.equals(t.end()))},t.hashCode=function(){return this._start.hashCode()^this._end.hashCode()},t.toString=function(){return this._start.toString()+"/"+this._end.toString()},c}();var o=!1;o||(o=!0,r.ALL=r.of(f.Instant.MIN,f.Instant.MAX));e.d(n,"Interval",function(){return r}),Object(f.use)(function(){})}],o.c=s,o.d=function(t,n,e){o.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:e})},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(n,t){if(1&t&&(n=o(n)),8&t)return n;if(4&t&&"object"==typeof n&&n&&n.__esModule)return n;var e=Object.create(null);if(o.r(e),Object.defineProperty(e,"default",{enumerable:!0,value:n}),2&t&&"string"!=typeof n)for(var r in n)o.d(e,r,function(t){return n[t]}.bind(null,r));return e},o.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(n,"a",n),n},o.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},o.p="",o(o.s=1);function o(t){if(s[t])return s[t].exports;var n=s[t]={i:t,l:!1,exports:{}};return r[t].call(n.exports,n,n.exports,o),n.l=!0,n.exports}var r,s});
5
+ var JSJodaExtra=function(t,n){"use strict";function e(t,e){if(null==t)throw new n.NullPointerException(e+" must not be null");return t}function r(t,e,r){if(!(t instanceof e))throw new n.IllegalArgumentException(r+" must be an instance of "+(e.name?e.name:e)+(t&&t.constructor&&t.constructor.name?", but is "+t.constructor.name:""));return t}var s=function(){function t(t,n){this._start=t,this._end=n}t.of=function(e,r){return r instanceof n.Duration?t.ofInstantDuration(e,r):t.ofInstantInstant(e,r)},t.ofInstantInstant=function(s,i){if(e(s,"startInclusive"),e(i,"endExclusive"),r(s,n.Instant,"startInclusive"),r(i,n.Instant,"endExclusive"),i.isBefore(s))throw new n.DateTimeException("End instant must on or after start instant");return new t(s,i)},t.ofInstantDuration=function(s,i){if(e(s,"startInclusive"),e(i,"duration"),r(s,n.Instant,"startInclusive"),r(i,n.Duration,"duration"),i.isNegative())throw new n.DateTimeException("Duration must not be zero or negative");return new t(s,s.plus(i))},t.parse=function(r){if(e(r,"text"),"string"!=typeof r)throw new n.IllegalArgumentException("text must be a string, but is "+r.constructor.name);for(var s=0;s<r.length;s+=1)if("/"===r.charAt(s)){var i=r.charAt(0);if("P"===i||"p"===i){var o=n.Duration.parse(r.substring(0,s)),a=n.ZonedDateTime.parse(r.substring(s+1,r.length)).toInstant();return t.of(a.minus(o),a)}var u=n.ZonedDateTime.parse(r.substring(0,s)).toInstant();if(s+1<r.length){var h=r.charAt(s+1);if("P"===h||"p"===h){var c=n.Duration.parse(r.substring(s+1,r.length));return t.of(u,u.plus(c))}}var f=n.ZonedDateTime.parse(r.substring(s+1,r.length)).toInstant();return t.of(u,f)}throw new n.DateTimeParseException("Interval cannot be parsed, no forward slash found",r,0)};var s=t.prototype;return s.start=function(){return this._start},s.end=function(){return this._end},s.isEmpty=function(){return this._start.equals(this._end)},s.isUnboundedStart=function(){return this._start.equals(n.Instant.MIN)},s.isUnboundedEnd=function(){return this._end.equals(n.Instant.MAX)},s.withStart=function(n){return t.of(n,this._end)},s.withEnd=function(n){return t.of(this._start,n)},s.contains=function(t){return e(t,"instant"),r(t,n.Instant,"instant"),this._start.compareTo(t)<=0&&(t.compareTo(this._end)<0||this.isUnboundedEnd())},s.encloses=function(n){return e(n,"other"),r(n,t,"other"),this._start.compareTo(n.start())<=0&&n.end().compareTo(this._end)<=0},s.abuts=function(n){return e(n,"other"),r(n,t,"other"),!this._end.equals(n.start())!=!this._start.equals(n.end())},s.isConnected=function(n){return e(n,"other"),r(n,t,"other"),this.equals(n)||this._start.compareTo(n.end())<=0&&n.start().compareTo(this._end)<=0},s.overlaps=function(n){return e(n,"other"),r(n,t,"other"),n.equals(this)||this._start.compareTo(n.end())<0&&n.start().compareTo(this._end)<0},s.intersection=function(s){if(e(s,"other"),r(s,t,"other"),!1===this.isConnected(s))throw new n.DateTimeException("Intervals do not connect: "+this+" and "+s);var i=this._start.compareTo(s.start()),o=this._end.compareTo(s.end());if(i>=0&&o<=0)return this;if(i<=0&&o>=0)return s;var a=i>=0?this._start:s.start(),u=o<=0?this._end:s.end();return t.of(a,u)},s.union=function(s){if(e(s,"other"),r(s,t,"other"),!1===this.isConnected(s))throw new n.DateTimeException("Intervals do not connect: "+this+" and "+s);var i=this._start.compareTo(s.start()),o=this._end.compareTo(s.end());if(i>=0&&o<=0)return s;if(i<=0&&o>=0)return this;var a=i>=0?s.start():this._start,u=o<=0?s.end():this._end;return t.of(a,u)},s.span=function(n){e(n,"other"),r(n,t,"other");var s=this._start.compareTo(n.start()),i=this._end.compareTo(n.end()),o=s>=0?n.start():this._start,a=i<=0?n.end():this._end;return t.of(o,a)},s.isAfter=function(t){return t instanceof n.Instant?this.isAfterInstant(t):this.isAfterInterval(t)},s.isBefore=function(t){return t instanceof n.Instant?this.isBeforeInstant(t):this.isBeforeInterval(t)},s.isAfterInstant=function(t){return this._start.compareTo(t)>0},s.isBeforeInstant=function(t){return this._end.compareTo(t)<=0&&this._start.compareTo(t)<0},s.isAfterInterval=function(t){return this._start.compareTo(t.end())>=0&&!t.equals(this)},s.isBeforeInterval=function(t){return this._end.compareTo(t.start())<=0&&!t.equals(this)},s.toDuration=function(){return n.Duration.between(this._start,this._end)},s.equals=function(n){return this===n||n instanceof t&&(this._start.equals(n.start())&&this._end.equals(n.end()))},s.hashCode=function(){return this._start.hashCode()^this._end.hashCode()},s.toString=function(){return this._start.toString()+"/"+this._end.toString()},t}();var i=!1;return i||(i=!0,s.ALL=s.of(n.Instant.MIN,n.Instant.MAX)),n.use((function(){})),t.Interval=s,Object.defineProperty(t,"__esModule",{value:!0}),t}({},JSJoda);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@js-joda/extra",
3
- "version": "0.7.1",
3
+ "version": "0.8.0",
4
4
  "description": "additional date-time classes that complement those in js-joda",
5
5
  "repository": {
6
6
  "type": "git",
@@ -32,9 +32,8 @@
32
32
  "test-browser": "npx karma start --reporters=dots --single-run",
33
33
  "test-saucelabs": "npx karma start --reporters=\"dots,saucelabs\" --browsers=\"sl_chrome,sl_ie,sl_firefox\" --single-run=true",
34
34
  "test-ci": "npm run build-dist && npm run test && npm run test-browser && npm run test-coverage && npm run test-ts-definitions",
35
- "test-ts-definitions": "tsc --noImplicitAny --strict --noEmit --pretty --lib ES6 test/typescript_definitions/js-joda-extra-tests.ts",
36
- "build-dist-es5": "npx babel src -d build/es5",
37
- "build-dist": "npx webpack --progress --colors --bail && DIST_MIN=1 npx webpack --progress --colors --bail",
35
+ "test-ts-definitions": "npx tsc --noImplicitAny --strict --noEmit --pretty test/typescript_definitions/js-joda-extra-tests.ts",
36
+ "build-dist": "npx rollup -c rollup.config.js",
38
37
  "lint": "npx eslint ."
39
38
  },
40
39
  "keywords": [
@@ -50,7 +49,7 @@
50
49
  "@js-joda/core": ">=1.11.0"
51
50
  },
52
51
  "devDependencies": {
53
- "@js-joda/core": "^5.1.0"
52
+ "@js-joda/core": "^5.2.0"
54
53
  },
55
- "gitHead": "dda0bbb3894919782d859060bbabbaa3859775a8"
54
+ "gitHead": "d07153c38a3d0b2b29b8185e3daaac69c624d4a9"
56
55
  }
package/src/Interval.js CHANGED
@@ -4,7 +4,6 @@
4
4
  * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)
5
5
  */
6
6
 
7
- /* eslint-disable no-else-return */
8
7
  import { DateTimeException, DateTimeParseException, Duration, IllegalArgumentException, Instant, ZonedDateTime } from '@js-joda/core';
9
8
 
10
9
  // TODO: hm... is this a good idea?? copied from joda currently, could we add a js-joda-utils module??
@@ -1,3 +0,0 @@
1
- //! @copyright (c) 2015-2016, Philipp Thürwächter, Pattrick Hüper & js-joda contributors
2
- //! @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos
3
- //! @license BSD-3-Clause (see LICENSE in the root directory of this source tree)