@js-joda/extra 0.7.0 → 0.7.1

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.
@@ -0,0 +1,321 @@
1
+ //! @version @js-joda/extra - 0.7.0
2
+ //! @copyright (c) 2015-present, Philipp Thürwächter, Pattrick Hüper & js-joda contributors
3
+ //! @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos
4
+ //! @license BSD-3-Clause (see LICENSE in the root directory of this source tree)
5
+
6
+ import { NullPointerException, IllegalArgumentException, Instant, DateTimeException, Duration, ZonedDateTime, DateTimeParseException, use } from '@js-joda/core';
7
+
8
+ /**
9
+ * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper
10
+ * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)
11
+ */
12
+ function requireNonNull(value, parameterName) {
13
+ if (value == null) {
14
+ throw new NullPointerException(parameterName + " must not be null");
15
+ }
16
+
17
+ return value;
18
+ }
19
+ function requireInstance(value, _class, parameterName) {
20
+ if (!(value instanceof _class)) {
21
+ 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 : ''));
22
+ }
23
+
24
+ return value;
25
+ }
26
+
27
+ /*
28
+ * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper
29
+ * @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos
30
+ * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)
31
+ */
32
+ var Interval = function () {
33
+ Interval.of = function of(startInstant, endInstantOrDuration) {
34
+ if (endInstantOrDuration instanceof Duration) {
35
+ return Interval.ofInstantDuration(startInstant, endInstantOrDuration);
36
+ } else {
37
+ return Interval.ofInstantInstant(startInstant, endInstantOrDuration);
38
+ }
39
+ };
40
+
41
+ Interval.ofInstantInstant = function ofInstantInstant(startInclusive, endExclusive) {
42
+ requireNonNull(startInclusive, 'startInclusive');
43
+ requireNonNull(endExclusive, 'endExclusive');
44
+ requireInstance(startInclusive, Instant, 'startInclusive');
45
+ requireInstance(endExclusive, Instant, 'endExclusive');
46
+
47
+ if (endExclusive.isBefore(startInclusive)) {
48
+ throw new DateTimeException('End instant must on or after start instant');
49
+ }
50
+
51
+ return new Interval(startInclusive, endExclusive);
52
+ };
53
+
54
+ Interval.ofInstantDuration = function ofInstantDuration(startInclusive, duration) {
55
+ requireNonNull(startInclusive, 'startInclusive');
56
+ requireNonNull(duration, 'duration');
57
+ requireInstance(startInclusive, Instant, 'startInclusive');
58
+ requireInstance(duration, Duration, 'duration');
59
+
60
+ if (duration.isNegative()) {
61
+ throw new DateTimeException('Duration must not be zero or negative');
62
+ }
63
+
64
+ return new Interval(startInclusive, startInclusive.plus(duration));
65
+ };
66
+
67
+ Interval.parse = function parse(text) {
68
+ requireNonNull(text, 'text');
69
+
70
+ if (!(typeof text === 'string')) {
71
+ throw new IllegalArgumentException("text must be a string, but is " + text.constructor.name);
72
+ }
73
+
74
+ for (var i = 0; i < text.length; i += 1) {
75
+ if (text.charAt(i) === '/') {
76
+ var firstChar = text.charAt(0);
77
+
78
+ if (firstChar === 'P' || firstChar === 'p') {
79
+ var duration = Duration.parse(text.substring(0, i));
80
+ var end = ZonedDateTime.parse(text.substring(i + 1, text.length)).toInstant();
81
+ return Interval.of(end.minus(duration), end);
82
+ } else {
83
+ var start = ZonedDateTime.parse(text.substring(0, i)).toInstant();
84
+
85
+ if (i + 1 < text.length) {
86
+ var c = text.charAt(i + 1);
87
+
88
+ if (c === 'P' || c === 'p') {
89
+ var _duration = Duration.parse(text.substring(i + 1, text.length));
90
+
91
+ return Interval.of(start, start.plus(_duration));
92
+ }
93
+ }
94
+
95
+ var _end = ZonedDateTime.parse(text.substring(i + 1, text.length)).toInstant();
96
+
97
+ return Interval.of(start, _end);
98
+ }
99
+ }
100
+ }
101
+
102
+ throw new DateTimeParseException('Interval cannot be parsed, no forward slash found', text, 0);
103
+ };
104
+
105
+ function Interval(startInclusive, endExclusive) {
106
+ this._start = startInclusive;
107
+ this._end = endExclusive;
108
+ }
109
+
110
+ var _proto = Interval.prototype;
111
+
112
+ _proto.start = function start() {
113
+ return this._start;
114
+ };
115
+
116
+ _proto.end = function end() {
117
+ return this._end;
118
+ };
119
+
120
+ _proto.isEmpty = function isEmpty() {
121
+ return this._start.equals(this._end);
122
+ };
123
+
124
+ _proto.isUnboundedStart = function isUnboundedStart() {
125
+ return this._start.equals(Instant.MIN);
126
+ };
127
+
128
+ _proto.isUnboundedEnd = function isUnboundedEnd() {
129
+ return this._end.equals(Instant.MAX);
130
+ };
131
+
132
+ _proto.withStart = function withStart(start) {
133
+ return Interval.of(start, this._end);
134
+ };
135
+
136
+ _proto.withEnd = function withEnd(end) {
137
+ return Interval.of(this._start, end);
138
+ };
139
+
140
+ _proto.contains = function contains(instant) {
141
+ requireNonNull(instant, 'instant');
142
+ requireInstance(instant, Instant, 'instant');
143
+ return this._start.compareTo(instant) <= 0 && (instant.compareTo(this._end) < 0 || this.isUnboundedEnd());
144
+ };
145
+
146
+ _proto.encloses = function encloses(other) {
147
+ requireNonNull(other, 'other');
148
+ requireInstance(other, Interval, 'other');
149
+ return this._start.compareTo(other.start()) <= 0 && other.end().compareTo(this._end) <= 0;
150
+ };
151
+
152
+ _proto.abuts = function abuts(other) {
153
+ requireNonNull(other, 'other');
154
+ requireInstance(other, Interval, 'other');
155
+ return !this._end.equals(other.start()) !== !this._start.equals(other.end());
156
+ };
157
+
158
+ _proto.isConnected = function isConnected(other) {
159
+ requireNonNull(other, 'other');
160
+ requireInstance(other, Interval, 'other');
161
+ return this.equals(other) || this._start.compareTo(other.end()) <= 0 && other.start().compareTo(this._end) <= 0;
162
+ };
163
+
164
+ _proto.overlaps = function overlaps(other) {
165
+ requireNonNull(other, 'other');
166
+ requireInstance(other, Interval, 'other');
167
+ return other.equals(this) || this._start.compareTo(other.end()) < 0 && other.start().compareTo(this._end) < 0;
168
+ };
169
+
170
+ _proto.intersection = function intersection(other) {
171
+ requireNonNull(other, 'other');
172
+ requireInstance(other, Interval, 'other');
173
+
174
+ if (this.isConnected(other) === false) {
175
+ throw new DateTimeException("Intervals do not connect: " + this + " and " + other);
176
+ }
177
+
178
+ var cmpStart = this._start.compareTo(other.start());
179
+
180
+ var cmpEnd = this._end.compareTo(other.end());
181
+
182
+ if (cmpStart >= 0 && cmpEnd <= 0) {
183
+ return this;
184
+ } else if (cmpStart <= 0 && cmpEnd >= 0) {
185
+ return other;
186
+ } else {
187
+ var newStart = cmpStart >= 0 ? this._start : other.start();
188
+ var newEnd = cmpEnd <= 0 ? this._end : other.end();
189
+ return Interval.of(newStart, newEnd);
190
+ }
191
+ };
192
+
193
+ _proto.union = function union(other) {
194
+ requireNonNull(other, 'other');
195
+ requireInstance(other, Interval, 'other');
196
+
197
+ if (this.isConnected(other) === false) {
198
+ throw new DateTimeException("Intervals do not connect: " + this + " and " + other);
199
+ }
200
+
201
+ var cmpStart = this._start.compareTo(other.start());
202
+
203
+ var cmpEnd = this._end.compareTo(other.end());
204
+
205
+ if (cmpStart >= 0 && cmpEnd <= 0) {
206
+ return other;
207
+ } else if (cmpStart <= 0 && cmpEnd >= 0) {
208
+ return this;
209
+ } else {
210
+ var newStart = cmpStart >= 0 ? other.start() : this._start;
211
+ var newEnd = cmpEnd <= 0 ? other.end() : this._end;
212
+ return Interval.of(newStart, newEnd);
213
+ }
214
+ };
215
+
216
+ _proto.span = function span(other) {
217
+ requireNonNull(other, 'other');
218
+ requireInstance(other, Interval, 'other');
219
+
220
+ var cmpStart = this._start.compareTo(other.start());
221
+
222
+ var cmpEnd = this._end.compareTo(other.end());
223
+
224
+ var newStart = cmpStart >= 0 ? other.start() : this._start;
225
+ var newEnd = cmpEnd <= 0 ? other.end() : this._end;
226
+ return Interval.of(newStart, newEnd);
227
+ };
228
+
229
+ _proto.isAfter = function isAfter(instantOrInterval) {
230
+ if (instantOrInterval instanceof Instant) {
231
+ return this.isAfterInstant(instantOrInterval);
232
+ } else {
233
+ return this.isAfterInterval(instantOrInterval);
234
+ }
235
+ };
236
+
237
+ _proto.isBefore = function isBefore(instantOrInterval) {
238
+ if (instantOrInterval instanceof Instant) {
239
+ return this.isBeforeInstant(instantOrInterval);
240
+ } else {
241
+ return this.isBeforeInterval(instantOrInterval);
242
+ }
243
+ };
244
+
245
+ _proto.isAfterInstant = function isAfterInstant(instant) {
246
+ return this._start.compareTo(instant) > 0;
247
+ };
248
+
249
+ _proto.isBeforeInstant = function isBeforeInstant(instant) {
250
+ return this._end.compareTo(instant) <= 0 && this._start.compareTo(instant) < 0;
251
+ };
252
+
253
+ _proto.isAfterInterval = function isAfterInterval(interval) {
254
+ return this._start.compareTo(interval.end()) >= 0 && !interval.equals(this);
255
+ };
256
+
257
+ _proto.isBeforeInterval = function isBeforeInterval(interval) {
258
+ return this._end.compareTo(interval.start()) <= 0 && !interval.equals(this);
259
+ };
260
+
261
+ _proto.toDuration = function toDuration() {
262
+ return Duration.between(this._start, this._end);
263
+ };
264
+
265
+ _proto.equals = function equals(obj) {
266
+ if (this === obj) {
267
+ return true;
268
+ }
269
+
270
+ if (obj instanceof Interval) {
271
+ return this._start.equals(obj.start()) && this._end.equals(obj.end());
272
+ }
273
+
274
+ return false;
275
+ };
276
+
277
+ _proto.hashCode = function hashCode() {
278
+ return this._start.hashCode() ^ this._end.hashCode();
279
+ };
280
+
281
+ _proto.toString = function toString() {
282
+ return this._start.toString() + "/" + this._end.toString();
283
+ };
284
+
285
+ return Interval;
286
+ }();
287
+ function _init() {
288
+ Interval.ALL = Interval.of(Instant.MIN, Instant.MAX);
289
+ }
290
+
291
+ /*
292
+ * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper
293
+ * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)
294
+ */
295
+ var isInit = false;
296
+
297
+ function init() {
298
+ if (isInit) {
299
+ return;
300
+ }
301
+
302
+ isInit = true;
303
+ _init();
304
+ }
305
+
306
+ init();
307
+
308
+ /*
309
+ * @copyright (c) 2016, Philipp Thuerwaechter & Pattrick Hueper
310
+ * @license BSD-3-Clause (see LICENSE.md in the root directory of this source tree)
311
+ */
312
+ function plug () {}
313
+
314
+ /*
315
+ * @copyright (c) 2016, Philipp Thuerwaechter & Pattrick Hueper
316
+ * @license BSD-3-Clause (see LICENSE.md in the root directory of this source tree)
317
+ */
318
+ use(plug);
319
+
320
+ export { Interval };
321
+ //# sourceMappingURL=js-joda-extra.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"js-joda-extra.esm.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","ALL","isInit","init","intervalInit","use","plug"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AA4BO,SAASA,cAAT,CAAwBC,KAAxB,EAA+BC,aAA/B,EAA8C;AACjD,MAAID,KAAK,IAAI,IAAb,EAAmB;AACf,UAAM,IAAIE,oBAAJ,CAA4BD,aAA5B,uBAAN;AACH;;AACD,SAAOD,KAAP;AACH;AAUM,SAASG,eAAT,CAAyBH,KAAzB,EAAgCI,MAAhC,EAAwCH,aAAxC,EAAuD;AAC1D,MAAI,EAAED,KAAK,YAAYI,MAAnB,CAAJ,EAAgC;AAC5B,UAAM,IAAIC,wBAAJ,CAAgCJ,aAAhC,iCAAwEG,MAAM,CAACE,IAAP,GAAcF,MAAM,CAACE,IAArB,GAA4BF,MAApG,KAA6GJ,KAAK,IAAIA,KAAK,CAACO,WAAf,IAA8BP,KAAK,CAACO,WAAN,CAAkBD,IAAhD,iBAAmEN,KAAK,CAACO,WAAN,CAAkBD,IAArF,GAA8F,EAA3M,EAAN;AACH;;AACD,SAAON,KAAP;AACH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AG,CAACC,IAAD,CAAH;;;;"}
@@ -1,4 +1,4 @@
1
- //! @version @js-joda/extra - 0.7.0
1
+ //! @version @js-joda/extra - 0.7.1
2
2
  //! @copyright (c) 2015-2016, 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,4 +1,4 @@
1
- //! @version @js-joda/extra - 0.7.0
1
+ //! @version @js-joda/extra - 0.7.1
2
2
  //! @copyright (c) 2015-2016, 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)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@js-joda/extra",
3
- "version": "0.7.0",
3
+ "version": "0.7.1",
4
4
  "description": "additional date-time classes that complement those in js-joda",
5
5
  "repository": {
6
6
  "type": "git",
@@ -50,7 +50,7 @@
50
50
  "@js-joda/core": ">=1.11.0"
51
51
  },
52
52
  "devDependencies": {
53
- "@js-joda/core": "^5.0.0"
53
+ "@js-joda/core": "^5.1.0"
54
54
  },
55
- "gitHead": "03943ccba7dab0178e3a112bce8a251410f89fe7"
55
+ "gitHead": "dda0bbb3894919782d859060bbabbaa3859775a8"
56
56
  }