@getodk/xpath 0.6.0 → 0.7.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.
@@ -1,2 +1,2 @@
1
- export { e as expressionParser } from './expressionParser-BUM7qFCl.js';
1
+ export { e as expressionParser } from './expressionParser-DjyNe4Lw.js';
2
2
  //# sourceMappingURL=expressionParser.js.map
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { U as UpsertableMap, e as expressionParser, g as getAugmentedNamespace, c as commonjsGlobal, a as getDefaultExportFromCjs } from './expressionParser-BUM7qFCl.js';
1
+ import { U as UpsertableMap, e as expressionParser, g as getAugmentedNamespace, c as commonjsGlobal, a as getDefaultExportFromCjs } from './expressionParser-DjyNe4Lw.js';
2
2
 
3
3
  function _mergeNamespaces(n, m) {
4
4
  for (var i = 0; i < m.length; i++) {
@@ -400,7 +400,7 @@ function epochMilliToIso(e, n = 0, t = 0) {
400
400
  return zipProps(Tr, [r.getUTCFullYear(), r.getUTCMonth() + 1, r.getUTCDate() + o, r.getUTCHours(), r.getUTCMinutes(), r.getUTCSeconds(), r.getUTCMilliseconds(), n, t]);
401
401
  }
402
402
  function hashIntlFormatParts(e, n) {
403
- if (n < -864e13) {
403
+ if (n < -Pr) {
404
404
  throw new RangeError(Io);
405
405
  }
406
406
  const t = e.formatToParts(n),
@@ -1084,7 +1084,7 @@ function getSingleInstantFor(e, n, t = 0, o = e.I(n)) {
1084
1084
  }
1085
1085
  const r = isoToEpochNano(n),
1086
1086
  i = ((e, n) => {
1087
- const t = e.R(moveBigNano(n, -864e11));
1087
+ const t = e.R(moveBigNano(n, -Uo));
1088
1088
  return (e => {
1089
1089
  if (e > Uo) {
1090
1090
  throw new RangeError(go);
@@ -1100,7 +1100,7 @@ function getStartOfDayInstantFor(e, n) {
1100
1100
  if (t.length) {
1101
1101
  return t[0];
1102
1102
  }
1103
- const o = moveBigNano(isoToEpochNano(n), -864e11);
1103
+ const o = moveBigNano(isoToEpochNano(n), -Uo);
1104
1104
  return e.O(o, 1);
1105
1105
  }
1106
1106
  function Ye(e, n, t) {
@@ -1322,7 +1322,7 @@ function computeDurationSign(e, n = p) {
1322
1322
  }
1323
1323
  function checkDurationUnits(e) {
1324
1324
  for (const n of dr) {
1325
- clampEntity(n, e[n], -4294967295, di, 1);
1325
+ clampEntity(n, e[n], -di, di, 1);
1326
1326
  }
1327
1327
  return checkDurationTimeUnit(bigNanoToNumber(durationFieldsToBigNano(e), Ro)), e;
1328
1328
  }
@@ -1981,7 +1981,7 @@ function createIntlYearDataCache(e) {
1981
1981
  r += 400 * ko;
1982
1982
  } while ((o = e(r)).year <= t);
1983
1983
  do {
1984
- if (r += (1 - o.day) * ko, o.year === t && (a.push(r), s.push(o.o)), r -= ko, ++i > 100 || r < -864e13) {
1984
+ if (r += (1 - o.day) * ko, o.year === t && (a.push(r), s.push(o.o)), r -= ko, ++i > 100 || r < -Pr) {
1985
1985
  throw new RangeError(fo);
1986
1986
  }
1987
1987
  } while ((o = e(r)).year >= t);
@@ -2774,7 +2774,7 @@ const expectedInteger = (e, n) => `Non-integer ${e}: ${n}`,
2774
2774
  vr = 1e8,
2775
2775
  Pr = vr * ko,
2776
2776
  Er = [vr, 0],
2777
- Sr = [-1e8, 0],
2777
+ Sr = [-vr, 0],
2778
2778
  Fr = 275760,
2779
2779
  wr = -271821,
2780
2780
  en = Intl.DateTimeFormat,
@@ -7164,7 +7164,9 @@ const dateTimeFromString = (timeZone, value) => {
7164
7164
  }
7165
7165
  return Xn.PlainDateTime.from(value).toZonedDateTime(timeZone);
7166
7166
  };
7167
- const toNanoseconds = (milliseconds) => BigInt(milliseconds) * MILLISECOND_NANOSECONDS;
7167
+ const toNanoseconds = (milliseconds) => {
7168
+ return BigInt(Math.round(milliseconds)) * MILLISECOND_NANOSECONDS;
7169
+ };
7168
7170
  const dateTimeFromNumber = (timeZone, milliseconds) => {
7169
7171
  if (Number.isNaN(milliseconds)) {
7170
7172
  return null;