neo4j-driver 4.4.9 → 4.4.10

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.
@@ -12406,7 +12406,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
12406
12406
  return result;
12407
12407
  };
12408
12408
  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;
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.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
12410
  var integer_1 = __importStar(require("../integer"));
12411
12411
  var error_1 = require("../error");
12412
12412
  var util_1 = require("./util");
@@ -12609,20 +12609,41 @@ exports.timeZoneOffsetToIsoString = timeZoneOffsetToIsoString;
12609
12609
  * @return {string} ISO string that represents given date.
12610
12610
  */
12611
12611
  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
- }
12612
+ var yearString = formatYear(year);
12621
12613
  var monthString = formatNumber(month, 2);
12622
12614
  var dayString = formatNumber(day, 2);
12623
12615
  return yearString + "-" + monthString + "-" + dayString;
12624
12616
  }
12625
12617
  exports.dateToIsoString = dateToIsoString;
12618
+ /**
12619
+ * Convert the given iso date string to a JavaScript Date object
12620
+ *
12621
+ * @param {string} isoString The iso date string
12622
+ * @returns {Date} the date
12623
+ */
12624
+ function isoStringToStandardDate(isoString) {
12625
+ return new Date(isoString);
12626
+ }
12627
+ exports.isoStringToStandardDate = isoStringToStandardDate;
12628
+ /**
12629
+ * Convert the given utc timestamp to a JavaScript Date object
12630
+ *
12631
+ * @param {number} utc Timestamp in UTC
12632
+ * @returns {Date} the date
12633
+ */
12634
+ function toStandardDate(utc) {
12635
+ return new Date(utc);
12636
+ }
12637
+ exports.toStandardDate = toStandardDate;
12638
+ /**
12639
+ * Shortcut for creating a new StandardDate
12640
+ * @param date
12641
+ * @returns {Date} the standard date
12642
+ */
12643
+ function newDate(date) {
12644
+ return new Date(date);
12645
+ }
12646
+ exports.newDate = newDate;
12626
12647
  /**
12627
12648
  * Get the total number of nanoseconds from the milliseconds of the given standard JavaScript date and optional nanosecond part.
12628
12649
  * @param {global.Date} standardDate the standard JavaScript date.
@@ -12648,11 +12669,14 @@ exports.totalNanoseconds = totalNanoseconds;
12648
12669
  * @return {number} the time zone offset in seconds.
12649
12670
  */
12650
12671
  function timeZoneOffsetInSeconds(standardDate) {
12672
+ var secondsPortion = standardDate.getSeconds() >= standardDate.getUTCSeconds()
12673
+ ? standardDate.getSeconds() - standardDate.getUTCSeconds()
12674
+ : standardDate.getSeconds() - standardDate.getUTCSeconds() + 60;
12651
12675
  var offsetInMinutes = standardDate.getTimezoneOffset();
12652
12676
  if (offsetInMinutes === 0) {
12653
- return 0;
12677
+ return 0 + secondsPortion;
12654
12678
  }
12655
- return -1 * offsetInMinutes * exports.SECONDS_PER_MINUTE;
12679
+ return -1 * offsetInMinutes * exports.SECONDS_PER_MINUTE + secondsPortion;
12656
12680
  }
12657
12681
  exports.timeZoneOffsetInSeconds = timeZoneOffsetInSeconds;
12658
12682
  /**
@@ -12846,12 +12870,24 @@ function formatNanosecond(value) {
12846
12870
  value = (0, integer_1.int)(value);
12847
12871
  return value.equals(0) ? '' : '.' + formatNumber(value, 9);
12848
12872
  }
12873
+ /**
12874
+ *
12875
+ * @param {Integer|number|string} year The year to be formatted
12876
+ * @return {string} formatted year
12877
+ */
12878
+ function formatYear(year) {
12879
+ var yearInteger = (0, integer_1.int)(year);
12880
+ if (yearInteger.isNegative() || yearInteger.greaterThan(9999)) {
12881
+ return formatNumber(yearInteger, 6, { usePositiveSign: true });
12882
+ }
12883
+ return formatNumber(yearInteger, 4);
12884
+ }
12849
12885
  /**
12850
12886
  * @param {Integer|number|string} num the number to format.
12851
12887
  * @param {number} [stringLength=undefined] the string length to left-pad to.
12852
12888
  * @return {string} formatted and possibly left-padded number as string.
12853
12889
  */
12854
- function formatNumber(num, stringLength) {
12890
+ function formatNumber(num, stringLength, params) {
12855
12891
  num = (0, integer_1.int)(num);
12856
12892
  var isNegative = num.isNegative();
12857
12893
  if (isNegative) {
@@ -12864,7 +12900,13 @@ function formatNumber(num, stringLength) {
12864
12900
  numString = '0' + numString;
12865
12901
  }
12866
12902
  }
12867
- return isNegative ? '-' + numString : numString;
12903
+ if (isNegative) {
12904
+ return '-' + numString;
12905
+ }
12906
+ else if ((params === null || params === void 0 ? void 0 : params.usePositiveSign) === true) {
12907
+ return '+' + numString;
12908
+ }
12909
+ return numString;
12868
12910
  }
12869
12911
  function add(x, y) {
12870
12912
  if (x instanceof integer_1.default) {
@@ -30738,7 +30780,7 @@ exports["default"] = void 0;
30738
30780
  // This is set up this way to keep the version in the code in
30739
30781
  // sync with the npm package version, and to allow the build
30740
30782
  // system to control version names at packaging time.
30741
- var _default = '4.4.9';
30783
+ var _default = '4.4.10';
30742
30784
  exports["default"] = _default;
30743
30785
 
30744
30786
  },{}]},{},[304])(304)