@orangecheck/agent-core 2.0.0 → 2.1.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.
package/dist/index.mjs CHANGED
@@ -223,10 +223,15 @@ function rangeSubset(ex, g) {
223
223
  if (!exRange || !gRange) return false;
224
224
  return gRange.lo <= exRange.lo && exRange.hi <= gRange.hi;
225
225
  }
226
+ function parseDecimalInteger(value) {
227
+ if (!/^-?\d+$/.test(value)) return null;
228
+ const n = Number(value);
229
+ return Number.isSafeInteger(n) ? n : null;
230
+ }
226
231
  function opToRange(c) {
227
232
  if (c.value === void 0) return null;
228
- const n = Number(c.value);
229
- if (!Number.isFinite(n)) return null;
233
+ const n = parseDecimalInteger(c.value);
234
+ if (n === null) return null;
230
235
  switch (c.op) {
231
236
  case "=":
232
237
  return { lo: n, hi: n };