neo4j-driver 4.4.9 → 4.4.11

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.
@@ -6764,6 +6764,9 @@ function getTimeInZoneId(timeZoneId, epochSecond, nano) {
6764
6764
  ? function (year) { return year.subtract(1).negate(); } // 1BC equals to year 0 in astronomical year numbering
6765
6765
  : function (year) { return year; };
6766
6766
  }
6767
+ else if (currentValue.type === 'hour') {
6768
+ obj.hour = (0, neo4j_driver_core_1.int)(currentValue.value).modulo(24);
6769
+ }
6767
6770
  else if (currentValue.type !== 'literal') {
6768
6771
  obj[currentValue.type] = (0, neo4j_driver_core_1.int)(currentValue.value);
6769
6772
  }
@@ -12406,7 +12409,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
12406
12409
  return result;
12407
12410
  };
12408
12411
  Object.defineProperty(exports, "__esModule", { value: true });
12409
- exports.floorMod = exports.floorDiv = exports.assertValidZoneId = exports.assertValidNanosecond = exports.assertValidSecond = exports.assertValidMinute = exports.assertValidHour = exports.assertValidDay = exports.assertValidMonth = exports.assertValidYear = exports.timeZoneOffsetInSeconds = exports.totalNanoseconds = exports.dateToIsoString = exports.timeZoneOffsetToIsoString = exports.timeToIsoString = exports.durationToIsoString = exports.dateToEpochDay = exports.localDateTimeToEpochSecond = exports.localTimeToNanoOfDay = exports.normalizeNanosecondsForDuration = exports.normalizeSecondsForDuration = exports.SECONDS_PER_DAY = exports.DAYS_PER_400_YEAR_CYCLE = exports.DAYS_0000_TO_1970 = exports.NANOS_PER_HOUR = exports.NANOS_PER_MINUTE = exports.NANOS_PER_MILLISECOND = exports.NANOS_PER_SECOND = exports.SECONDS_PER_HOUR = exports.SECONDS_PER_MINUTE = exports.MINUTES_PER_HOUR = exports.NANOSECOND_OF_SECOND_RANGE = exports.SECOND_OF_MINUTE_RANGE = exports.MINUTE_OF_HOUR_RANGE = exports.HOUR_OF_DAY_RANGE = exports.DAY_OF_MONTH_RANGE = exports.MONTH_OF_YEAR_RANGE = exports.YEAR_RANGE = void 0;
12412
+ exports.floorMod = exports.floorDiv = exports.assertValidZoneId = exports.assertValidNanosecond = exports.assertValidSecond = exports.assertValidMinute = exports.assertValidHour = exports.assertValidDay = exports.assertValidMonth = exports.assertValidYear = exports.timeZoneOffsetInSeconds = exports.totalNanoseconds = exports.newDate = exports.toStandardDate = exports.isoStringToStandardDate = exports.dateToIsoString = exports.timeZoneOffsetToIsoString = exports.timeToIsoString = exports.durationToIsoString = exports.dateToEpochDay = exports.localDateTimeToEpochSecond = exports.localTimeToNanoOfDay = exports.normalizeNanosecondsForDuration = exports.normalizeSecondsForDuration = exports.SECONDS_PER_DAY = exports.DAYS_PER_400_YEAR_CYCLE = exports.DAYS_0000_TO_1970 = exports.NANOS_PER_HOUR = exports.NANOS_PER_MINUTE = exports.NANOS_PER_MILLISECOND = exports.NANOS_PER_SECOND = exports.SECONDS_PER_HOUR = exports.SECONDS_PER_MINUTE = exports.MINUTES_PER_HOUR = exports.NANOSECOND_OF_SECOND_RANGE = exports.SECOND_OF_MINUTE_RANGE = exports.MINUTE_OF_HOUR_RANGE = exports.HOUR_OF_DAY_RANGE = exports.DAY_OF_MONTH_RANGE = exports.MONTH_OF_YEAR_RANGE = exports.YEAR_RANGE = void 0;
12410
12413
  var integer_1 = __importStar(require("../integer"));
12411
12414
  var error_1 = require("../error");
12412
12415
  var util_1 = require("./util");
@@ -12609,20 +12612,41 @@ exports.timeZoneOffsetToIsoString = timeZoneOffsetToIsoString;
12609
12612
  * @return {string} ISO string that represents given date.
12610
12613
  */
12611
12614
  function dateToIsoString(year, month, day) {
12612
- year = (0, integer_1.int)(year);
12613
- var isNegative = year.isNegative();
12614
- if (isNegative) {
12615
- year = year.multiply(-1);
12616
- }
12617
- var yearString = formatNumber(year, 4);
12618
- if (isNegative) {
12619
- yearString = '-' + yearString;
12620
- }
12615
+ var yearString = formatYear(year);
12621
12616
  var monthString = formatNumber(month, 2);
12622
12617
  var dayString = formatNumber(day, 2);
12623
12618
  return yearString + "-" + monthString + "-" + dayString;
12624
12619
  }
12625
12620
  exports.dateToIsoString = dateToIsoString;
12621
+ /**
12622
+ * Convert the given iso date string to a JavaScript Date object
12623
+ *
12624
+ * @param {string} isoString The iso date string
12625
+ * @returns {Date} the date
12626
+ */
12627
+ function isoStringToStandardDate(isoString) {
12628
+ return new Date(isoString);
12629
+ }
12630
+ exports.isoStringToStandardDate = isoStringToStandardDate;
12631
+ /**
12632
+ * Convert the given utc timestamp to a JavaScript Date object
12633
+ *
12634
+ * @param {number} utc Timestamp in UTC
12635
+ * @returns {Date} the date
12636
+ */
12637
+ function toStandardDate(utc) {
12638
+ return new Date(utc);
12639
+ }
12640
+ exports.toStandardDate = toStandardDate;
12641
+ /**
12642
+ * Shortcut for creating a new StandardDate
12643
+ * @param date
12644
+ * @returns {Date} the standard date
12645
+ */
12646
+ function newDate(date) {
12647
+ return new Date(date);
12648
+ }
12649
+ exports.newDate = newDate;
12626
12650
  /**
12627
12651
  * Get the total number of nanoseconds from the milliseconds of the given standard JavaScript date and optional nanosecond part.
12628
12652
  * @param {global.Date} standardDate the standard JavaScript date.
@@ -12648,11 +12672,14 @@ exports.totalNanoseconds = totalNanoseconds;
12648
12672
  * @return {number} the time zone offset in seconds.
12649
12673
  */
12650
12674
  function timeZoneOffsetInSeconds(standardDate) {
12675
+ var secondsPortion = standardDate.getSeconds() >= standardDate.getUTCSeconds()
12676
+ ? standardDate.getSeconds() - standardDate.getUTCSeconds()
12677
+ : standardDate.getSeconds() - standardDate.getUTCSeconds() + 60;
12651
12678
  var offsetInMinutes = standardDate.getTimezoneOffset();
12652
12679
  if (offsetInMinutes === 0) {
12653
- return 0;
12680
+ return 0 + secondsPortion;
12654
12681
  }
12655
- return -1 * offsetInMinutes * exports.SECONDS_PER_MINUTE;
12682
+ return -1 * offsetInMinutes * exports.SECONDS_PER_MINUTE + secondsPortion;
12656
12683
  }
12657
12684
  exports.timeZoneOffsetInSeconds = timeZoneOffsetInSeconds;
12658
12685
  /**
@@ -12846,12 +12873,24 @@ function formatNanosecond(value) {
12846
12873
  value = (0, integer_1.int)(value);
12847
12874
  return value.equals(0) ? '' : '.' + formatNumber(value, 9);
12848
12875
  }
12876
+ /**
12877
+ *
12878
+ * @param {Integer|number|string} year The year to be formatted
12879
+ * @return {string} formatted year
12880
+ */
12881
+ function formatYear(year) {
12882
+ var yearInteger = (0, integer_1.int)(year);
12883
+ if (yearInteger.isNegative() || yearInteger.greaterThan(9999)) {
12884
+ return formatNumber(yearInteger, 6, { usePositiveSign: true });
12885
+ }
12886
+ return formatNumber(yearInteger, 4);
12887
+ }
12849
12888
  /**
12850
12889
  * @param {Integer|number|string} num the number to format.
12851
12890
  * @param {number} [stringLength=undefined] the string length to left-pad to.
12852
12891
  * @return {string} formatted and possibly left-padded number as string.
12853
12892
  */
12854
- function formatNumber(num, stringLength) {
12893
+ function formatNumber(num, stringLength, params) {
12855
12894
  num = (0, integer_1.int)(num);
12856
12895
  var isNegative = num.isNegative();
12857
12896
  if (isNegative) {
@@ -12864,7 +12903,13 @@ function formatNumber(num, stringLength) {
12864
12903
  numString = '0' + numString;
12865
12904
  }
12866
12905
  }
12867
- return isNegative ? '-' + numString : numString;
12906
+ if (isNegative) {
12907
+ return '-' + numString;
12908
+ }
12909
+ else if ((params === null || params === void 0 ? void 0 : params.usePositiveSign) === true) {
12910
+ return '+' + numString;
12911
+ }
12912
+ return numString;
12868
12913
  }
12869
12914
  function add(x, y) {
12870
12915
  if (x instanceof integer_1.default) {
@@ -30738,7 +30783,7 @@ exports["default"] = void 0;
30738
30783
  // This is set up this way to keep the version in the code in
30739
30784
  // sync with the npm package version, and to allow the build
30740
30785
  // system to control version names at packaging time.
30741
- var _default = '4.4.9';
30786
+ var _default = '4.4.11';
30742
30787
  exports["default"] = _default;
30743
30788
 
30744
30789
  },{}]},{},[304])(304)