@parischap/conversions 0.1.0 → 0.3.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.
Files changed (125) hide show
  1. package/README.md +50 -49
  2. package/cjs/BigDecimal.js +2 -2
  3. package/cjs/BigInt.js +7 -5
  4. package/cjs/BigInt.js.map +1 -1
  5. package/cjs/DateTime.js +144 -136
  6. package/cjs/DateTime.js.map +1 -1
  7. package/cjs/DateTimeFormat.js +7 -2
  8. package/cjs/DateTimeFormat.js.map +1 -1
  9. package/cjs/DateTimeFormatContext.js +11 -6
  10. package/cjs/DateTimeFormatContext.js.map +1 -1
  11. package/cjs/Email.js +11 -15
  12. package/cjs/Email.js.map +1 -1
  13. package/cjs/Integer.js +33 -23
  14. package/cjs/Integer.js.map +1 -1
  15. package/cjs/NumberBase10Format.js +65 -65
  16. package/cjs/PositiveInteger.js +44 -29
  17. package/cjs/PositiveInteger.js.map +1 -1
  18. package/cjs/PositiveReal.js +34 -24
  19. package/cjs/PositiveReal.js.map +1 -1
  20. package/cjs/Real.js +29 -18
  21. package/cjs/Real.js.map +1 -1
  22. package/cjs/RoundingMode.js +7 -4
  23. package/cjs/RoundingMode.js.map +1 -1
  24. package/cjs/RoundingOption.js +6 -6
  25. package/cjs/RoundingOption.js.map +1 -1
  26. package/cjs/Schema.js +29 -28
  27. package/cjs/Schema.js.map +1 -1
  28. package/cjs/SemVer.js +19 -20
  29. package/cjs/SemVer.js.map +1 -1
  30. package/cjs/Template.js +36 -31
  31. package/cjs/Template.js.map +1 -1
  32. package/cjs/TemplatePart.js +4 -4
  33. package/cjs/TemplateParts.js +3 -2
  34. package/cjs/TemplateParts.js.map +1 -1
  35. package/cjs/TemplatePlaceholder.js +56 -45
  36. package/cjs/TemplatePlaceholder.js.map +1 -1
  37. package/cjs/TemplateSeparator.js +17 -24
  38. package/cjs/TemplateSeparator.js.map +1 -1
  39. package/cjs/internal/Int.js +5 -8
  40. package/cjs/internal/Int.js.map +1 -1
  41. package/cjs/internal/Positive.js +5 -8
  42. package/cjs/internal/Positive.js.map +1 -1
  43. package/dts/BigDecimal.d.ts +2 -2
  44. package/dts/BigDecimal.d.ts.map +1 -1
  45. package/dts/BigInt.d.ts +7 -5
  46. package/dts/BigInt.d.ts.map +1 -1
  47. package/dts/DateTime.d.ts +145 -137
  48. package/dts/DateTime.d.ts.map +1 -1
  49. package/dts/DateTimeFormat.d.ts +7 -2
  50. package/dts/DateTimeFormat.d.ts.map +1 -1
  51. package/dts/DateTimeFormatContext.d.ts +17 -12
  52. package/dts/DateTimeFormatContext.d.ts.map +1 -1
  53. package/dts/Email.d.ts +16 -13
  54. package/dts/Email.d.ts.map +1 -1
  55. package/dts/Integer.d.ts +43 -21
  56. package/dts/Integer.d.ts.map +1 -1
  57. package/dts/NumberBase10Format.d.ts +68 -68
  58. package/dts/PositiveInteger.d.ts +54 -27
  59. package/dts/PositiveInteger.d.ts.map +1 -1
  60. package/dts/PositiveReal.d.ts +44 -22
  61. package/dts/PositiveReal.d.ts.map +1 -1
  62. package/dts/Real.d.ts +39 -16
  63. package/dts/Real.d.ts.map +1 -1
  64. package/dts/RoundingMode.d.ts +6 -3
  65. package/dts/RoundingMode.d.ts.map +1 -1
  66. package/dts/RoundingOption.d.ts +6 -6
  67. package/dts/Schema.d.ts +32 -33
  68. package/dts/Schema.d.ts.map +1 -1
  69. package/dts/SemVer.d.ts +25 -13
  70. package/dts/SemVer.d.ts.map +1 -1
  71. package/dts/Template.d.ts +30 -29
  72. package/dts/Template.d.ts.map +1 -1
  73. package/dts/TemplatePart.d.ts +4 -4
  74. package/dts/TemplateParts.d.ts +4 -3
  75. package/dts/TemplateParts.d.ts.map +1 -1
  76. package/dts/TemplatePlaceholder.d.ts +56 -44
  77. package/dts/TemplatePlaceholder.d.ts.map +1 -1
  78. package/dts/TemplateSeparator.d.ts +9 -51
  79. package/dts/TemplateSeparator.d.ts.map +1 -1
  80. package/dts/internal/Int.d.ts +0 -4
  81. package/dts/internal/Int.d.ts.map +1 -1
  82. package/dts/internal/Positive.d.ts +0 -4
  83. package/dts/internal/Positive.d.ts.map +1 -1
  84. package/esm/BigDecimal.js +2 -2
  85. package/esm/BigInt.js +7 -5
  86. package/esm/BigInt.js.map +1 -1
  87. package/esm/DateTime.js +144 -136
  88. package/esm/DateTime.js.map +1 -1
  89. package/esm/DateTimeFormat.js +7 -2
  90. package/esm/DateTimeFormat.js.map +1 -1
  91. package/esm/DateTimeFormatContext.js +11 -6
  92. package/esm/DateTimeFormatContext.js.map +1 -1
  93. package/esm/Email.js +10 -13
  94. package/esm/Email.js.map +1 -1
  95. package/esm/Integer.js +33 -23
  96. package/esm/Integer.js.map +1 -1
  97. package/esm/NumberBase10Format.js +65 -65
  98. package/esm/PositiveInteger.js +44 -29
  99. package/esm/PositiveInteger.js.map +1 -1
  100. package/esm/PositiveReal.js +34 -24
  101. package/esm/PositiveReal.js.map +1 -1
  102. package/esm/Real.js +29 -18
  103. package/esm/Real.js.map +1 -1
  104. package/esm/RoundingMode.js +6 -3
  105. package/esm/RoundingMode.js.map +1 -1
  106. package/esm/RoundingOption.js +6 -6
  107. package/esm/RoundingOption.js.map +1 -1
  108. package/esm/Schema.js +33 -34
  109. package/esm/Schema.js.map +1 -1
  110. package/esm/SemVer.js +18 -18
  111. package/esm/SemVer.js.map +1 -1
  112. package/esm/Template.js +36 -31
  113. package/esm/Template.js.map +1 -1
  114. package/esm/TemplatePart.js +4 -4
  115. package/esm/TemplateParts.js +3 -2
  116. package/esm/TemplateParts.js.map +1 -1
  117. package/esm/TemplatePlaceholder.js +55 -44
  118. package/esm/TemplatePlaceholder.js.map +1 -1
  119. package/esm/TemplateSeparator.js +16 -24
  120. package/esm/TemplateSeparator.js.map +1 -1
  121. package/esm/internal/Int.js +5 -7
  122. package/esm/internal/Int.js.map +1 -1
  123. package/esm/internal/Positive.js +5 -7
  124. package/esm/internal/Positive.js.map +1 -1
  125. package/package.json +2 -2
package/esm/DateTime.js CHANGED
@@ -1,21 +1,22 @@
1
1
  /**
2
- * This module implements an immutable DateTime object.
2
+ * This module implements an immutable `CVDateTime` object.
3
3
  *
4
- * DateTime objects keep an internal state. But all provided functions look pure insofar as they
5
- * will always yield the same result whatever the state the object is in. The state is only used to
4
+ * `CVDateTime` objects keep an internal state. But all provided functions are pure insofar as they
5
+ * always yield the same result whatever the state the object is in. The state is only used to
6
6
  * improve performance but does not alter the results.
7
7
  *
8
- * Unlike the Javascript Date objects and the Effect DateTime objects, DateTime objects handle both
9
- * the Gregorian and Iso calendars. So you can easily get/set the iso year and iso week of a
10
- * DateTime object.
8
+ * Unlike the Javascript `Date` objects and the Effect `DateTime` objects, `CVDateTime` objects
9
+ * handle both the Gregorian and Iso calendars. So you can easily get/set the iso year and iso week
10
+ * of a `CVDateTime` object.
11
11
  *
12
- * A DateTime object has a `zoneOffset` which is the difference in hours between the time in the
13
- * local zone and UTC time (e.g zoneOffset=1 for timezone +1:00). All the data in a DateTime object
14
- * is `zoneOffset-dependent`, except `timestamp`. An important thing to note is that a DateTime
15
- * object with a timestamp t and a zoneOffset zo has exactly the same date parts (year, ordinalDay,
16
- * month, monthDay, isoYear...) as a DateTime object with a timestamp t+zox3600 and a 0 zoneOffset.
17
- * That's the reason for the _zonedTimestamp field which is equal to t+zox3600. All calculations are
18
- * performed UTC using _zonedTimestamp instead of timestamp.
12
+ * A `CVDateTime` object has a `zoneOffset` which is the difference in hours between the time in the
13
+ * local zone and UTC time (e.g `zoneOffset=1` for timezone +1:00). All the data in a `CVDateTime`
14
+ * object is `zoneOffset-dependent`, except `timestamp`. An important thing to note is that a
15
+ * `CVDateTime` object with a timestamp `t` and a zoneOffset `zo` has exactly the same date parts
16
+ * (`year`, `ordinalDay`, `month`, `monthDay`, `isoYear`...) as a `CVDateTime` object with
17
+ * `timestamp = t+zox3600` and `zoneOffset = 0`. That's the reason for the _zonedTimestamp field
18
+ * which is equal to `t+zox3600`. All calculations are performed UTC using _zonedTimestamp instead
19
+ * of timestamp.
19
20
  */
20
21
  import { MArray, MFunction, MInputError, MInspectable, MNumber, MPipeable, MStruct, MTypes } from '@parischap/effect-lib';
21
22
  import { DateTime, Either, Equal, Function, Hash, Number, Option, Predicate, Struct, flow, pipe } from 'effect';
@@ -358,7 +359,7 @@ var GregorianDate;
358
359
  /**
359
360
  * Returns the `yearIsLeap` property of `self`
360
361
  *
361
- * @category Destructors
362
+ * @category Predicates
362
363
  */
363
364
  GregorianDate.yearIsLeap = /*#__PURE__*/Struct.get('yearIsLeap');
364
365
  /**
@@ -710,7 +711,7 @@ var IsoDate;
710
711
  /**
711
712
  * Returns the `yearIsLong` property of `self`
712
713
  *
713
- * @category Destructors
714
+ * @category Predicates
714
715
  */
715
716
  IsoDate.yearIsLong = /*#__PURE__*/Struct.get('yearIsLong');
716
717
  /**
@@ -1206,9 +1207,9 @@ const _uncalculatedFromZonedTimestamp = (zonedTimestamp, zoneOffset) => _make({
1206
1207
  /** Instance of an uncalculated DateTime that represents 1/1/1970 00:00:00:000+0:00 */
1207
1208
  const _uncalculatedOrigin = /*#__PURE__*/_uncalculatedFromTimestamp(0, 0);
1208
1209
  /**
1209
- * Tries to build a DateTime from `timestamp`, the number of milliseconds since 1/1/1970
1210
+ * Tries to build a `CVDateTime` from `timestamp`, the number of milliseconds since 1/1/1970
1210
1211
  * 00:00:00:000+0:00, and `zoneOffset` which gives the offset between the local time and the UTC
1211
- * time. Returns a `right` of a DateTime if successful.
1212
+ * time. Returns a `Right` if successful, a `Left` otherwise.
1212
1213
  *
1213
1214
  * `timestamp` must be greater than or equal to MIN_TIMESTAMP and less than or equal to
1214
1215
  * MAX_TIMESTAMP.
@@ -1236,20 +1237,20 @@ const _uncalculatedOrigin = /*#__PURE__*/_uncalculatedFromTimestamp(0, 0);
1236
1237
  */
1237
1238
  export const fromTimestamp = (timestamp, zoneOffset) => pipe(_uncalculatedOrigin, _setTimestamp(timestamp), Either.flatMap(setZoneOffsetKeepTimestamp(zoneOffset)));
1238
1239
  /**
1239
- * Same as fromTimestamp but returns directly the DateTime or throws if it cannot be built
1240
+ * Same as `fromTimestamp` but returns directly a `CVDateTime` or throws if it cannot be built
1240
1241
  *
1241
1242
  * @category Constructors
1242
1243
  */
1243
1244
  export const fromTimestampOrThrow = /*#__PURE__*/flow(fromTimestamp, /*#__PURE__*/Either.getOrThrowWith(Function.identity));
1244
1245
  /**
1245
- * Builds a DateTime using Date.now() as timestamp. `zoneOffset` is set to 0.
1246
+ * Builds a `CVDateTime` using Date.now() as `timestamp`. `zoneOffset` is set to 0.
1246
1247
  *
1247
1248
  * @category Constructors
1248
1249
  */
1249
1250
  export const now = () => _uncalculatedFromTimestamp(Date.now(), 0);
1250
1251
  /**
1251
- * Tries to build a DateTime from the provided DateTime parts. Returns a `right` of this DateTime if
1252
- * successful. Returns a `left` of an error otherwise.
1252
+ * Tries to build a `CVDateTime` from the provided parts. Returns a `Right` if successful, a `Left`
1253
+ * otherwise.
1253
1254
  *
1254
1255
  * `year` must comprised in the range [MIN_FULL_YEAR, MAX_FULL_YEAR]. `ordinalDay` must be greater
1255
1256
  * than or equal to 1 and less than or equal to the number of days in the current year. `month` must
@@ -1443,31 +1444,31 @@ export const fromParts = ({
1443
1444
  return withWeekday;
1444
1445
  });
1445
1446
  /**
1446
- * Same as fromParts but returns directly the DateTime or throws if it cannot be built
1447
+ * Same as `fromParts` but returns directly a `CVDateTime` or throws if it cannot be built
1447
1448
  *
1448
1449
  * @category Constructors
1449
1450
  */
1450
1451
  export const fromPartsOrThrow = /*#__PURE__*/flow(fromParts, /*#__PURE__*/Either.getOrThrowWith(Function.identity));
1451
1452
  /**
1452
- * Builds a CVDateTime from a Javascript Date
1453
+ * Builds a `CVDateTime` from a Javascript `Date`
1453
1454
  *
1454
1455
  * @category Constructors
1455
1456
  */
1456
1457
  export const fromDate = date => fromTimestampOrThrow(date.getTime());
1457
1458
  /**
1458
- * Builds a CVDateTime from an Effect DateTime
1459
+ * Builds a `CVDateTime` from an `Effect.DateTime.Zoned`
1459
1460
  *
1460
1461
  * @category Constructors
1461
1462
  */
1462
1463
  export const fromEffectDateTime = date => fromTimestampOrThrow(DateTime.toEpochMillis(date), DateTime.zonedOffset(date));
1463
1464
  /**
1464
- * Builds a Javascript Date from a CVDateTime
1465
+ * Builds a Javascript `Date` from a `CVDateTime`
1465
1466
  *
1466
1467
  * @category Conversions
1467
1468
  */
1468
1469
  export const toDate = self => new Date(timestamp(self));
1469
1470
  /**
1470
- * Builds an Effect DateTime from a CVDateTime
1471
+ * Builds an `Effect.DateTime.Zoned` from a `CVDateTime`
1471
1472
  *
1472
1473
  * @category Conversions
1473
1474
  */
@@ -1480,7 +1481,7 @@ export const toEffectDateTime = self => DateTime.unsafeMakeZoned(timestamp(self)
1480
1481
  * @category Getters
1481
1482
  */
1482
1483
  export const timestamp = /*#__PURE__*/Struct.get('timestamp');
1483
- /** Returns the gregorianDate of `self` for the given time zone */
1484
+ /** Returns the `gregorianDate` of `self` for the given time zone */
1484
1485
  const _gregorianDate = self => pipe(self.gregorianDate, Option.getOrElse(() => {
1485
1486
  const result = GregorianDate.fromTimestamp(self._zonedTimestamp);
1486
1487
  /* eslint-disable-next-line functional/immutable-data, functional/no-expression-statements */
@@ -1493,13 +1494,6 @@ const _gregorianDate = self => pipe(self.gregorianDate, Option.getOrElse(() => {
1493
1494
  * @category Getters
1494
1495
  */
1495
1496
  export const getYear = /*#__PURE__*/flow(_gregorianDate, GregorianDate.year);
1496
- /**
1497
- * Returns true if the (Gregorian) year of `self` for the given time zone is a leap year. Returns
1498
- * false otherwise
1499
- *
1500
- * @category Getters
1501
- */
1502
- export const yearIsLeap = /*#__PURE__*/flow(_gregorianDate, GregorianDate.yearIsLeap);
1503
1497
  /**
1504
1498
  * Returns the ordinalDay of `self` for the given time zone
1505
1499
  *
@@ -1531,13 +1525,6 @@ const _isoDate = self => pipe(self.isoDate, Option.getOrElse(() => {
1531
1525
  * @category Getters
1532
1526
  */
1533
1527
  export const getIsoYear = /*#__PURE__*/flow(_isoDate, IsoDate.year);
1534
- /**
1535
- * Returns true if the isoYear of `self` for the given time zone is a long year. Returns false
1536
- * otherwise
1537
- *
1538
- * @category Getters
1539
- */
1540
- export const isoYearIsLong = /*#__PURE__*/flow(_isoDate, IsoDate.yearIsLong);
1541
1528
  /**
1542
1529
  * Returns the isoWeek of `self` for the given time zone
1543
1530
  *
@@ -1654,53 +1641,53 @@ const _timeSetter = self => {
1654
1641
  };
1655
1642
  };
1656
1643
  /**
1657
- * If possible, returns a right of a DateTime having year `year` and the same `month`, `monthDay`,
1658
- * `hour23`, `minute`, `second`, `millisecond` and `zoneOffset` as `self`. Returns a `left` of an
1659
- * error otherwise. `year` must be an integer comprised in the range [MIN_FULL_YEAR,
1644
+ * If possible, returns a `Right` of a `CVDateTime` having year `year` and the same `month`,
1645
+ * `monthDay`, `hour23`, `minute`, `second`, `millisecond` and `zoneOffset` as `self`. Returns a
1646
+ * `Left` otherwise. `year` must be an integer comprised in the range [MIN_FULL_YEAR,
1660
1647
  * MAX_FULL_YEAR].
1661
1648
  *
1662
1649
  * @category Setters
1663
1650
  */
1664
1651
  export const setYear = year => self => pipe(self, _gregorianDate, GregorianDate.setYear(year), Either.map(_gregorianDateSetter(self)));
1665
1652
  /**
1666
- * Same as setYear but returns directly a DateTime or throws in case of an error
1653
+ * Same as `setYear` but returns directly a `CVDateTime` or throws in case of an error
1667
1654
  *
1668
1655
  * @category Setters
1669
1656
  */
1670
1657
  export const setYearOrThrow = /*#__PURE__*/flow(setYear, /*#__PURE__*/Function.compose(/*#__PURE__*/Either.getOrThrowWith(Function.identity)));
1671
1658
  /**
1672
- * If possible, returns a right of a DateTime having ordinalDay `ordinalDay` and the same `year`,
1673
- * `hour23`, `minute`, `second`, `millisecond` and `zoneOffset` as `self`. Returns a `left` of an
1674
- * error otherwise. `ordinalDay` must be an integer greater than or equal to 1 and less than or
1675
- * equal to the number of days in the current year
1659
+ * If possible, returns a `Right` of a `CVDateTime` having ordinalDay `ordinalDay` and the same
1660
+ * `year`, `hour23`, `minute`, `second`, `millisecond` and `zoneOffset` as `self`. Returns a `Left`
1661
+ * of an error otherwise. `ordinalDay` must be an integer greater than or equal to 1 and less than
1662
+ * or equal to the number of days in the current year
1676
1663
  *
1677
1664
  * @category Setters
1678
1665
  */
1679
1666
  export const setOrdinalDay = ordinalDay => self => pipe(self, _gregorianDate, GregorianDate.setOrdinalDay(ordinalDay), Either.map(_gregorianDateSetter(self)));
1680
1667
  /**
1681
- * Same as setOrdinalDay but returns directly a DateTime or throws in case of an error
1668
+ * Same as `setOrdinalDay` but returns directly a `CVDateTime` or throws in case of an error
1682
1669
  *
1683
1670
  * @category Setters
1684
1671
  */
1685
1672
  export const setOrdinalDayOrThrow = /*#__PURE__*/flow(setOrdinalDay, /*#__PURE__*/Function.compose(/*#__PURE__*/Either.getOrThrowWith(Function.identity)));
1686
1673
  /**
1687
- * If possible, returns a right of a DateTime having month `month` and the same `year`, `monthDay`,
1688
- * `hour23`, `minute`, `second`, `millisecond` and `zoneOffset` as `self`. Returns a `left` of an
1689
- * error otherwise. `month` must be an integer greater than or equal to 1 (January) and less than or
1690
- * equal to 12 (December)
1674
+ * If possible, returns a `Right` of a `CVDateTime` having month `month` and the same `year`,
1675
+ * `monthDay`, `hour23`, `minute`, `second`, `millisecond` and `zoneOffset` as `self`. Returns a
1676
+ * `Left` of an error otherwise. `month` must be an integer greater than or equal to 1 (January) and
1677
+ * less than or equal to 12 (December)
1691
1678
  *
1692
1679
  * @category Setters
1693
1680
  */
1694
1681
  export const setMonth = month => self => pipe(self, _gregorianDate, GregorianDate.setMonth(month), Either.map(_gregorianDateSetter(self)));
1695
1682
  /**
1696
- * Same as setMonth but returns directly a DateTime or throws in case of an error
1683
+ * Same as `setMonth` but returns directly a `CVDateTime` or throws in case of an error
1697
1684
  *
1698
1685
  * @category Setters
1699
1686
  */
1700
1687
  export const setMonthOrThrow = /*#__PURE__*/flow(setMonth, /*#__PURE__*/Function.compose(/*#__PURE__*/Either.getOrThrowWith(Function.identity)));
1701
1688
  /**
1702
- * If possible, returns a right of a DateTime having monthDay `monthDay` and the same `year`,
1703
- * `month`, `hour23`, `minute`, `second`, `millisecond` and `zoneOffset` as `self`. Returns a `left`
1689
+ * If possible, returns a `Right` of a `CVDateTime` having monthDay `monthDay` and the same `year`,
1690
+ * `month`, `hour23`, `minute`, `second`, `millisecond` and `zoneOffset` as `self`. Returns a `Left`
1704
1691
  * of an error otherwise. `monthDay` must be an integer greater than or equal to 1 and less than or
1705
1692
  * equal to the number of days in the current month.
1706
1693
  *
@@ -1708,59 +1695,59 @@ export const setMonthOrThrow = /*#__PURE__*/flow(setMonth, /*#__PURE__*/Function
1708
1695
  */
1709
1696
  export const setMonthDay = monthDay => self => pipe(self, _gregorianDate, GregorianDate.setMonthDay(monthDay), Either.map(_gregorianDateSetter(self)));
1710
1697
  /**
1711
- * Same as setMonthDay but returns directly a DateTime or throws in case of an error
1698
+ * Same as `setMonthDay` but returns directly a `CVDateTime` or throws in case of an error
1712
1699
  *
1713
1700
  * @category Setters
1714
1701
  */
1715
1702
  export const setMonthDayOrThrow = /*#__PURE__*/flow(setMonthDay, /*#__PURE__*/Function.compose(/*#__PURE__*/Either.getOrThrowWith(Function.identity)));
1716
1703
  /**
1717
- * If possible, returns a right of a DateTime having isoYear `isoYear` and the same `isoWeek`,
1704
+ * If possible, returns a `Right` of a `CVDateTime` having isoYear `isoYear` and the same `isoWeek`,
1718
1705
  * `weekday`, `hour23`, `minute`, `second`, `millisecond` and `zoneOffset` as `self`. Returns a
1719
- * `left` of an error otherwise. `isoYear` must be an integer comprised in the range [MIN_FULL_YEAR,
1706
+ * `Left` of an error otherwise. `isoYear` must be an integer comprised in the range [MIN_FULL_YEAR,
1720
1707
  * MAX_FULL_YEAR].
1721
1708
  *
1722
1709
  * @category Setters
1723
1710
  */
1724
1711
  export const setIsoYear = isoYear => self => pipe(self, _isoDate, IsoDate.setYear(isoYear), Either.map(_isoDateSetter(self)));
1725
1712
  /**
1726
- * Same as setIsoYear but returns directly a DateTime or throws in case of an error
1713
+ * Same as `setIsoYear` but returns directly a `CVDateTime` or throws in case of an error
1727
1714
  *
1728
1715
  * @category Setters
1729
1716
  */
1730
1717
  export const setIsoYearOrThrow = /*#__PURE__*/flow(setIsoYear, /*#__PURE__*/Function.compose(/*#__PURE__*/Either.getOrThrowWith(Function.identity)));
1731
1718
  /**
1732
- * If possible, returns a right of a DateTime having isoWeek `isoWeek` and the same `isoYear`,
1719
+ * If possible, returns a Right of a `CVDateTime` having isoWeek `isoWeek` and the same `isoYear`,
1733
1720
  * `weekday`, `hour23`, `minute`, `second`, `millisecond` and `zoneOffset` as `self`. Returns a
1734
- * `left` of an error otherwise. `isoWeek` must be an integer greater than or equal to 1 and less
1721
+ * `Left` of an error otherwise. `isoWeek` must be an integer greater than or equal to 1 and less
1735
1722
  * than or equal to the number of iso weeks in the current year.
1736
1723
  *
1737
1724
  * @category Setters
1738
1725
  */
1739
1726
  export const setIsoWeek = isoWeek => self => pipe(self, _isoDate, IsoDate.setIsoWeek(isoWeek), Either.map(_isoDateSetter(self)));
1740
1727
  /**
1741
- * Same as setIsoWeek but returns directly a DateTime or throws in case of an error
1728
+ * Same as `setIsoWeek` but returns directly a `CVDateTime` or throws in case of an error
1742
1729
  *
1743
1730
  * @category Setters
1744
1731
  */
1745
1732
  export const setIsoWeekOrThrow = /*#__PURE__*/flow(setIsoWeek, /*#__PURE__*/Function.compose(/*#__PURE__*/Either.getOrThrowWith(Function.identity)));
1746
1733
  /**
1747
- * If possible, returns a right of a DateTime having weekday `weekday` and the same `isoYear`,
1734
+ * If possible, returns a `Right` of a `CVDateTime` having weekday `weekday` and the same `isoYear`,
1748
1735
  * `isoWeek`, `hour23`, `minute`, `second`, `millisecond` and `zoneOffset` as `self`. Returns a
1749
- * `left` of an error otherwise. `weekday` must be an integer greater than or equal to 1 (monday)
1736
+ * `Left` of an error otherwise. `weekday` must be an integer greater than or equal to 1 (monday)
1750
1737
  * and less than or equal to 7 (sunday).
1751
1738
  *
1752
1739
  * @category Setters
1753
1740
  */
1754
1741
  export const setWeekday = weekday => self => pipe(self, _isoDate, IsoDate.setWeekday(weekday), Either.map(_isoDateSetter(self)));
1755
1742
  /**
1756
- * Same as setWeekday but returns directly a DateTime or throws in case of an error
1743
+ * Same as `setWeekday` but returns directly a `CVDateTime` or throws in case of an error
1757
1744
  *
1758
1745
  * @category Setters
1759
1746
  */
1760
1747
  export const setWeekdayOrThrow = /*#__PURE__*/flow(setWeekday, /*#__PURE__*/Function.compose(/*#__PURE__*/Either.getOrThrowWith(Function.identity)));
1761
1748
  /**
1762
- * If possible, returns a right of a DateTime having hour23 `hour23` and the same `year`,
1763
- * `ordinalDay`, `minute`, `second`, `millisecond` and `zoneOffset` as `self`. Returns a `left` of
1749
+ * If possible, returns a `Right` of a `CVDateTime` having hour23 `hour23` and the same `year`,
1750
+ * `ordinalDay`, `minute`, `second`, `millisecond` and `zoneOffset` as `self`. Returns a `Left` of
1764
1751
  * an error otherwise. `hour23` must be an integer greater than or equal to 0 and less than or equal
1765
1752
  * to 23
1766
1753
  *
@@ -1768,36 +1755,36 @@ export const setWeekdayOrThrow = /*#__PURE__*/flow(setWeekday, /*#__PURE__*/Func
1768
1755
  */
1769
1756
  export const setHour23 = hour23 => self => pipe(self, _time, Time.setHour23(hour23), Either.map(_timeSetter(self)));
1770
1757
  /**
1771
- * Same as setHour23 but returns directly a DateTime or throws in case of an error
1758
+ * Same as `setHour23` but returns directly a `CVDateTime` or throws in case of an error
1772
1759
  *
1773
1760
  * @category Setters
1774
1761
  */
1775
1762
  export const setHour23OrThrow = /*#__PURE__*/flow(setHour23, /*#__PURE__*/Function.compose(/*#__PURE__*/Either.getOrThrowWith(Function.identity)));
1776
1763
  /**
1777
- * If possible, returns a right of a DateTime having hour11 `hour11` and the same `year`,
1764
+ * If possible, returns a Right of a `CVDateTime` having hour11 `hour11` and the same `year`,
1778
1765
  * `ordinalDay`, `meridiem`, `minute`, `second`, `millisecond` and `zoneOffset` as `self`. Returns a
1779
- * `left` of an error otherwise. `hour11` must be an integer greater than or equal to 0 and less
1766
+ * `Left` of an error otherwise. `hour11` must be an integer greater than or equal to 0 and less
1780
1767
  * than or equal to 11.
1781
1768
  *
1782
1769
  * @category Setters
1783
1770
  */
1784
1771
  export const setHour11 = hour11 => self => pipe(self, _time, Time.setHour11(hour11), Either.map(_timeSetter(self)));
1785
1772
  /**
1786
- * Same as setHour11 but returns directly a DateTime or throws in case of an error
1773
+ * Same as `setHour11` but returns directly a `CVDateTime` or throws in case of an error
1787
1774
  *
1788
1775
  * @category Setters
1789
1776
  */
1790
1777
  export const setHour11OrThrow = /*#__PURE__*/flow(setHour11, /*#__PURE__*/Function.compose(/*#__PURE__*/Either.getOrThrowWith(Function.identity)));
1791
1778
  /**
1792
- * Returns a DateTime having meridiem `meridiem` and the same `year`, `ordinalDay`, `hour11`,
1779
+ * Returns a `CVDateTime` having meridiem `meridiem` and the same `year`, `ordinalDay`, `hour11`,
1793
1780
  * `minute`, `second`, `millisecond` and `zoneOffset` as `self`
1794
1781
  *
1795
1782
  * @category Setters
1796
1783
  */
1797
1784
  export const setMeridiem = meridiem => self => pipe(self, _time, Time.setMeridiem(meridiem), _timeSetter(self));
1798
1785
  /**
1799
- * If possible, returns a right of a DateTime having minute `minute` and the same `year`,
1800
- * `ordinalDay`, `hour23`, `second`, `millisecond` and `zoneOffset` as `self`. Returns a `left` of
1786
+ * If possible, returns a `Right` of a `CVDateTime` having minute `minute` and the same `year`,
1787
+ * `ordinalDay`, `hour23`, `second`, `millisecond` and `zoneOffset` as `self`. Returns a `Left` of
1801
1788
  * an error otherwise. `minute` must be an integer greater than or equal to 0 and less than or equal
1802
1789
  * to 59
1803
1790
  *
@@ -1805,14 +1792,14 @@ export const setMeridiem = meridiem => self => pipe(self, _time, Time.setMeridie
1805
1792
  */
1806
1793
  export const setMinute = minute => self => pipe(self, _time, Time.setMinute(minute), Either.map(_timeSetter(self)));
1807
1794
  /**
1808
- * Same as setMinute but returns directly a DateTime or throws in case of an error
1795
+ * Same as `setMinute` but returns directly a `CVDateTime` or throws in case of an error
1809
1796
  *
1810
1797
  * @category Setters
1811
1798
  */
1812
1799
  export const setMinuteOrThrow = /*#__PURE__*/flow(setMinute, /*#__PURE__*/Function.compose(/*#__PURE__*/Either.getOrThrowWith(Function.identity)));
1813
1800
  /**
1814
- * If possible, returns a right of a DateTime having second `second` and the same `year`,
1815
- * `ordinalDay`, `hour23`, `minute`, `millisecond` and `zoneOffset` as `self`. Returns a `left` of
1801
+ * If possible, returns a Right of a `CVDateTime` having second `second` and the same `year`,
1802
+ * `ordinalDay`, `hour23`, `minute`, `millisecond` and `zoneOffset` as `self`. Returns a `Left` of
1816
1803
  * an error otherwise. `second` must be an integer greater than or equal to 0 and less than or equal
1817
1804
  * to 59
1818
1805
  *
@@ -1820,29 +1807,29 @@ export const setMinuteOrThrow = /*#__PURE__*/flow(setMinute, /*#__PURE__*/Functi
1820
1807
  */
1821
1808
  export const setSecond = second => self => pipe(self, _time, Time.setSecond(second), Either.map(_timeSetter(self)));
1822
1809
  /**
1823
- * Same as setSecond but returns directly a DateTime or throws in case of an error
1810
+ * Same as `setSecond` but returns directly a `CVDateTime` or throws in case of an error
1824
1811
  *
1825
1812
  * @category Setters
1826
1813
  */
1827
1814
  export const setSecondOrThrow = /*#__PURE__*/flow(setSecond, /*#__PURE__*/Function.compose(/*#__PURE__*/Either.getOrThrowWith(Function.identity)));
1828
1815
  /**
1829
- * If possible, returns a right of a DateTime having millisecond `millisecond` and the same `year`,
1830
- * `ordinalDay`, `hour23`, `minute`, `second` and `zoneOffset` as `self`. Returns a `left` of an
1831
- * error otherwise. `millisecond` must be an integer greater than or equal to 0 and less than or
1832
- * equal to 999.
1816
+ * If possible, returns a `Right` of a `CVDateTime` having millisecond `millisecond` and the same
1817
+ * `year`, `ordinalDay`, `hour23`, `minute`, `second` and `zoneOffset` as `self`. Returns a `Left`
1818
+ * of an error otherwise. `millisecond` must be an integer greater than or equal to 0 and less than
1819
+ * or equal to 999.
1833
1820
  *
1834
1821
  * @category Setters
1835
1822
  */
1836
1823
  export const setMillisecond = millisecond => self => pipe(self, _time, Time.setMillisecond(millisecond), Either.map(_timeSetter(self)));
1837
1824
  /**
1838
- * Same as setMillisecond but returns directly a DateTime or throws in case of an error
1825
+ * Same as `setMillisecond` but returns directly a `CVDateTime` or throws in case of an error
1839
1826
  *
1840
1827
  * @category Setters
1841
1828
  */
1842
1829
  export const setMillisecondOrThrow = /*#__PURE__*/flow(setMillisecond, /*#__PURE__*/Function.compose(/*#__PURE__*/Either.getOrThrowWith(Function.identity)));
1843
1830
  /**
1844
- * If possible, returns a right of a copy of `self` with timestamp set to `timestamp`. Returns a
1845
- * `left` of an error otherwise. `timestamp` must be an integer comprised in the range
1831
+ * If possible, returns a `Right` of a copy of `self` with timestamp set to `timestamp`. Returns a
1832
+ * `Left` of an error otherwise. `timestamp` must be an integer comprised in the range
1846
1833
  * [MIN_TIMESTAMP, MAX_TIMESTAMP] representing the number of milliseconds since 1/1/1970
1847
1834
  * 00:00:00:000+0:00.
1848
1835
  */
@@ -1877,8 +1864,8 @@ const _setZoneOffset = (keepTimestamp, zoneOffset = LOCAL_TIME_ZONE_OFFSET) => s
1877
1864
  return result;
1878
1865
  });
1879
1866
  /**
1880
- * If possible, returns a right of a copy of `self` with the same timestamp and zoneOffset set to
1881
- * `zoneOffset`.
1867
+ * If possible, returns a `Right` of a copy of `self` with the same `timestamp` and zoneOffset set
1868
+ * to `zoneOffset`.
1882
1869
  *
1883
1870
  * If `zoneOffset` is omitted, the local time zone offset of the machine this code is running on is
1884
1871
  * used.
@@ -1899,58 +1886,74 @@ const _setZoneOffset = (keepTimestamp, zoneOffset = LOCAL_TIME_ZONE_OFFSET) => s
1899
1886
  */
1900
1887
  export const setZoneOffsetKeepTimestamp = zoneOffset => _setZoneOffset(true, zoneOffset);
1901
1888
  /**
1902
- * Same as setZoneOffsetKeepTimestamp but returns directly a DateTime or throws in case of an error
1889
+ * Same as `setZoneOffsetKeepTimestamp` but returns directly a `CVDateTime` or throws in case of an
1890
+ * error
1903
1891
  *
1904
1892
  * @category Setters
1905
1893
  */
1906
1894
  export const setZoneOffsetKeepTimestampOrThrow = /*#__PURE__*/flow(setZoneOffsetKeepTimestamp, /*#__PURE__*/Function.compose(/*#__PURE__*/Either.getOrThrowWith(Function.identity)));
1907
1895
  /**
1908
- * If possible, returns a right of a copy of `self` with the same CVDateTime.Parts (except
1909
- * zoneOffset) and zoneOffset set to `zoneOffset`.
1896
+ * If possible, returns a `Right` of a copy of `self` with the same parts (except `zoneOffset`) and
1897
+ * zoneOffset set to `zoneOffset`.
1910
1898
  *
1911
- * See setZoneOffsetKeepTimestamp for more details
1899
+ * See `setZoneOffsetKeepTimestamp` for more details
1912
1900
  *
1913
1901
  * @category Setters
1914
1902
  */
1915
1903
  export const setZoneOffsetKeepParts = zoneOffset => _setZoneOffset(false, zoneOffset);
1916
1904
  /**
1917
- * Same as setZoneOffsetKeepTimestamp but returns directly a DateTime or throws in case of an error
1905
+ * Same as `setZoneOffsetKeepTimestamp` but returns directly a `CVDateTime` or throws in case of an
1906
+ * error
1918
1907
  *
1919
1908
  * @category Setters
1920
1909
  */
1921
1910
  export const setZoneOffsetKeepPartsOrThrow = /*#__PURE__*/flow(setZoneOffsetKeepParts, /*#__PURE__*/Function.compose(/*#__PURE__*/Either.getOrThrowWith(Function.identity)));
1922
1911
  /**
1923
- * Returns true if self is the first day of a month in the given timezone
1912
+ * Returns true if the (Gregorian) year of `self` for the given time zone is a leap year. Returns
1913
+ * false otherwise
1914
+ *
1915
+ * @category Predicates
1916
+ */
1917
+ export const yearIsLeap = /*#__PURE__*/flow(_gregorianDate, GregorianDate.yearIsLeap);
1918
+ /**
1919
+ * Returns true if the isoYear of `self` for the given time zone is a long year. Returns false
1920
+ * otherwise
1921
+ *
1922
+ * @category Predicates
1923
+ */
1924
+ export const isoYearIsLong = /*#__PURE__*/flow(_isoDate, IsoDate.yearIsLong);
1925
+ /**
1926
+ * Returns true if `self` is the first day of a month in the given timezone
1924
1927
  *
1925
1928
  * @category Predicates
1926
1929
  */
1927
1930
  export const isFirstMonthDay = self => getMonthDay(self) === 1;
1928
1931
  /**
1929
- * Returns true if self is the last day of a month in the given timezone
1932
+ * Returns true if `self` is the last day of a month in the given timezone
1930
1933
  *
1931
1934
  * @category Predicates
1932
1935
  */
1933
1936
  export const isLastMonthDay = self => getMonthDay(self) === pipe(self, _gregorianDate, GregorianDate.getNumberOfDaysInMonth(getMonth(self)));
1934
1937
  /**
1935
- * Returns true if self is the first day of a year in the given timezone
1938
+ * Returns true if `self` is the first day of a year in the given timezone
1936
1939
  *
1937
1940
  * @category Predicates
1938
1941
  */
1939
1942
  export const isFirstYearDay = self => getOrdinalDay(self) === 1;
1940
1943
  /**
1941
- * Returns true if self is the last day of a year in the given timezone
1944
+ * Returns true if `self` is the last day of a year in the given timezone
1942
1945
  *
1943
1946
  * @category Predicates
1944
1947
  */
1945
1948
  export const isLastYearDay = self => getOrdinalDay(self) === pipe(self, _gregorianDate, GregorianDate.getYearDurationInDays);
1946
1949
  /**
1947
- * Returns true if self is the first day of an iso year in the given timezone
1950
+ * Returns true if `self` is the first day of an iso year in the given timezone
1948
1951
  *
1949
1952
  * @category Predicates
1950
1953
  */
1951
1954
  export const isFirstIsoYearDay = self => getIsoWeek(self) === 1 && getWeekday(self) === 1;
1952
1955
  /**
1953
- * Returns true if self is the last day of an iso year in the given timezone
1956
+ * Returns true if `self` is the last day of an iso year in the given timezone
1954
1957
  *
1955
1958
  * @category Predicates
1956
1959
  */
@@ -2007,27 +2010,27 @@ export const toLastIsoYearWeek = self => pipe(self, setIsoWeekOrThrow(pipe(self,
2007
2010
  */
2008
2011
  export const toLastIsoYearDay = self => pipe(self, toLastIsoYearWeek, setWeekdayOrThrow(7));
2009
2012
  /**
2010
- * If possible, returns a copy of `self` offset by `offset` years and having the same `month`,
2011
- * `hour23`, `minute`, `second`, `millisecond` and `zoneOffset` as `self`. If `respectMonthEnd` is
2012
- * true and `self` is on the last day of a month, the new DateTime object's monthDay will be the
2013
- * last of the target month. Otherwise, it will be the same as `self`'s. Returns a `left` of an
2014
- * error otherwise.
2013
+ * If possible, returns a `Right` of a copy of `self` offset by `offset` years and having the same
2014
+ * `month`, `hour23`, `minute`, `second`, `millisecond` and `zoneOffset` as `self`. Returns a `Left`
2015
+ * of an error otherwise. If `respectMonthEnd` is true and `self` is on the last day of a month, the
2016
+ * new DateTime object's monthDay will be the last of the target month. Otherwise, it will be the
2017
+ * same as `self`
2015
2018
  *
2016
2019
  * @category Offsetters
2017
2020
  */
2018
2021
  export const offsetYears = (offset, respectMonthEnd) => offsetMonths(offset * 12, respectMonthEnd);
2019
2022
  /**
2020
- * Same as offsetYears but returns directly a DateTime or throws in case of an error
2023
+ * Same as `offsetYears` but returns directly a `CVDateTime` or throws in case of an error
2021
2024
  *
2022
- * @category Setters
2025
+ * @category Offsetters
2023
2026
  */
2024
2027
  export const offsetYearsOrThrow = /*#__PURE__*/flow(offsetYears, /*#__PURE__*/Function.compose(/*#__PURE__*/Either.getOrThrowWith(Function.identity)));
2025
2028
  /**
2026
- * If possible, returns a copy of `self` offset by `offset` months and having the same `hour23`,
2027
- * `minute`, `second`, `millisecond` and `zoneOffset` as `self`. If `respectMonthEnd` is true and
2028
- * `self` is on the last day of a month, the new DateTime object's monthDay will be the last of the
2029
- * target month. Otherwise, it will be the same as `self`'s. Returns a `left` of an error if the
2030
- * DateTime object can
2029
+ * If possible, returns a `Right` of a copy of `self` offset by `offset` months and having the same
2030
+ * `hour23`, `minute`, `second`, `millisecond` and `zoneOffset` as `self`. Returns a `Left` of an
2031
+ * error otherwise. If `respectMonthEnd` is true and `self` is on the last day of a month, the new
2032
+ * DateTime object's monthDay will be the last of the target month. Otherwise, it will be the same
2033
+ * as `self`'s
2031
2034
  *
2032
2035
  * @category Offsetters
2033
2036
  */
@@ -2040,29 +2043,30 @@ export const offsetMonths = (offset, respectMonthEnd) => self => {
2040
2043
  })));
2041
2044
  };
2042
2045
  /**
2043
- * Same as offsetMonths but returns directly a DateTime or throws in case of an error
2046
+ * Same as `offsetMonths` but returns directly a `CVDateTime` or throws in case of an error
2044
2047
  *
2045
- * @category Setters
2048
+ * @category Offsetters
2046
2049
  */
2047
2050
  export const offsetMonthsOrThrow = /*#__PURE__*/flow(offsetMonths, /*#__PURE__*/Function.compose(/*#__PURE__*/Either.getOrThrowWith(Function.identity)));
2048
2051
  /**
2049
- * Returns a copy of `self` offset by `offset` days
2052
+ * If possible, returns a `Right` of a copy of `self` offset by `offset` days. Returns a `Left` of
2053
+ * an error otherwise.
2050
2054
  *
2051
2055
  * @category Offsetters
2052
2056
  */
2053
2057
  export const offsetDays = offset => offsetMilliseconds(offset * DAY_MS);
2054
2058
  /**
2055
- * Same as offsetDays but returns directly a DateTime or throws in case of an error
2059
+ * Same as `offsetDays` but returns directly a `CVDateTime` or throws in case of an error
2056
2060
  *
2057
- * @category Setters
2061
+ * @category Offsetters
2058
2062
  */
2059
2063
  export const offsetDaysOrThrow = /*#__PURE__*/flow(offsetDays, /*#__PURE__*/Function.compose(/*#__PURE__*/Either.getOrThrowWith(Function.identity)));
2060
2064
  /**
2061
- * If possible, returns a copy of `self` offset by `offset` iso years and having the same `weekday`,
2062
- * `hour23`, `minute`, `second`, `millisecond` and `zoneOffset` as `self`. If `respectYearEnd` is
2063
- * true and `self` is on the last day of an iso year, the new DateTime object's isoWeek will be the
2064
- * last of the target iso year. Otherwise, it will be the same as `self`'s. Returns a `left` of an
2065
- * error otherwise.
2065
+ * If possible, returns a `Right` of a copy of `self` offset by `offset` iso years and having the
2066
+ * same `weekday`, `hour23`, `minute`, `second`, `millisecond` and `zoneOffset` as `self`. Returns a
2067
+ * `Left` of an error otherwise. If `respectYearEnd` is true and `self` is on the last day of an iso
2068
+ * year, the new DateTime object's isoWeek will be the last of the target iso year. Otherwise, it
2069
+ * will be the same as `self`'s.
2066
2070
  *
2067
2071
  * @category Offsetters
2068
2072
  */
@@ -2074,57 +2078,61 @@ export const offsetIsoYears = (offset, respectYearEnd) => self => {
2074
2078
  })));
2075
2079
  };
2076
2080
  /**
2077
- * Same as offsetIsoYears but returns directly a DateTime or throws in case of an error
2081
+ * Same as `offsetIsoYears` but returns directly a `CVDateTime` or throws in case of an error
2078
2082
  *
2079
- * @category Setters
2083
+ * @category Offsetters
2080
2084
  */
2081
2085
  export const offsetIsoYearsOrThrow = /*#__PURE__*/flow(offsetIsoYears, /*#__PURE__*/Function.compose(/*#__PURE__*/Either.getOrThrowWith(Function.identity)));
2082
2086
  /**
2083
- * Returns a copy of `self` offset by `offset` hours
2087
+ * If possible, returns a `Right` of a copy of `self` offset by `offset` hours. Returns a `Left` of
2088
+ * an error otherwise.
2084
2089
  *
2085
2090
  * @category Offsetters
2086
2091
  */
2087
2092
  export const offsetHours = offset => offsetMilliseconds(offset * HOUR_MS);
2088
2093
  /**
2089
- * Same as offsetHours but returns directly a DateTime or throws in case of an error
2094
+ * Same as `offsetHours` but returns directly a `CVDateTime` or throws in case of an error
2090
2095
  *
2091
- * @category Setters
2096
+ * @category Offsetters
2092
2097
  */
2093
2098
  export const offsetHoursOrThrow = /*#__PURE__*/flow(offsetHours, /*#__PURE__*/Function.compose(/*#__PURE__*/Either.getOrThrowWith(Function.identity)));
2094
2099
  /**
2095
- * Returns a copy of `self` offset by `offset` minutes
2100
+ * If possible, returns a `Right` of a copy of `self` offset by `offset` minutes. Returns a `Left`
2101
+ * of an error otherwise.
2096
2102
  *
2097
2103
  * @category Offsetters
2098
2104
  */
2099
2105
  export const offsetMinutes = offset => offsetMilliseconds(offset * MINUTE_MS);
2100
2106
  /**
2101
- * Same as offsetMinutes but returns directly a DateTime or throws in case of an error
2107
+ * Same as `offsetMinutes` but returns directly a `CVDateTime` or throws in case of an error
2102
2108
  *
2103
- * @category Setters
2109
+ * @category Offsetters
2104
2110
  */
2105
2111
  export const offsetMinutesOrThrow = /*#__PURE__*/flow(offsetMinutes, /*#__PURE__*/Function.compose(/*#__PURE__*/Either.getOrThrowWith(Function.identity)));
2106
2112
  /**
2107
- * Returns a copy of `self` offset by `offset` seconds
2113
+ * If possible, returns a `Right` of a copy of `self` offset by `offset` seconds. Returns a `Left`
2114
+ * of an error otherwise.
2108
2115
  *
2109
2116
  * @category Offsetters
2110
2117
  */
2111
2118
  export const offsetSeconds = offset => offsetMilliseconds(offset * SECOND_MS);
2112
2119
  /**
2113
- * Same as offsetSeconds but returns directly a DateTime or throws in case of an error
2120
+ * Same as `offsetSeconds` but returns directly a `CVDateTime` or throws in case of an error
2114
2121
  *
2115
- * @category Setters
2122
+ * @category Offsetters
2116
2123
  */
2117
2124
  export const offsetSecondsOrThrow = /*#__PURE__*/flow(offsetSeconds, /*#__PURE__*/Function.compose(/*#__PURE__*/Either.getOrThrowWith(Function.identity)));
2118
2125
  /**
2119
- * Returns a copy of `self` offset by `offset` milliseconds
2126
+ * If possible, returns a `Right` of a copy of `self` offset by `offset` milliseconds. Returns a
2127
+ * `Left` of an error otherwise.
2120
2128
  *
2121
2129
  * @category Offsetters
2122
2130
  */
2123
2131
  export const offsetMilliseconds = offset => self => _setTimestamp(timestamp(self) + offset)(self);
2124
2132
  /**
2125
- * Same as offsetMilliseconds but returns directly a DateTime or throws in case of an error
2133
+ * Same as `offsetMilliseconds` but returns directly a `CVDateTime` or throws in case of an error
2126
2134
  *
2127
- * @category Setters
2135
+ * @category Offsetters
2128
2136
  */
2129
2137
  export const offsetMillisecondsOrThrow = /*#__PURE__*/flow(offsetMilliseconds, /*#__PURE__*/Function.compose(/*#__PURE__*/Either.getOrThrowWith(Function.identity)));
2130
2138
  //# sourceMappingURL=DateTime.js.map