unforgit 0.8.3 → 0.8.4

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.
@@ -1537,29 +1537,33 @@ function validateMemoryType(value) {
1537
1537
  return VALID_MEMORY_TYPES.includes(value);
1538
1538
  }
1539
1539
  function parseConfidence(value) {
1540
- const n = parseFloat(value);
1540
+ const normalized = value.trim();
1541
+ const n = normalized === "" ? Number.NaN : Number(normalized);
1541
1542
  if (Number.isNaN(n) || n < 0 || n > 1) {
1542
1543
  throw new Error("--confidence must be a number between 0 and 1");
1543
1544
  }
1544
1545
  return n;
1545
1546
  }
1546
1547
  function parseThreshold(value) {
1547
- const n = parseFloat(value);
1548
+ const normalized = value.trim();
1549
+ const n = normalized === "" ? Number.NaN : Number(normalized);
1548
1550
  if (Number.isNaN(n) || n < 0 || n > 1) {
1549
1551
  throw new Error("--threshold must be a number between 0 and 1");
1550
1552
  }
1551
1553
  return n;
1552
1554
  }
1553
1555
  function parseTtl(value) {
1554
- const n = parseInt(value, 10);
1555
- if (Number.isNaN(n) || n <= 0) {
1556
+ const normalized = value.trim();
1557
+ const n = Number(normalized);
1558
+ if (!/^\d+$/.test(normalized) || n <= 0) {
1556
1559
  throw new Error("--ttl must be a positive integer (seconds)");
1557
1560
  }
1558
1561
  return n;
1559
1562
  }
1560
1563
  function parsePositiveInt(value, name) {
1561
- const n = parseInt(value, 10);
1562
- if (Number.isNaN(n) || n <= 0) {
1564
+ const normalized = value.trim();
1565
+ const n = Number(normalized);
1566
+ if (!/^\d+$/.test(normalized) || n <= 0) {
1563
1567
  throw new Error(`--${name} must be a positive integer`);
1564
1568
  }
1565
1569
  return n;
@@ -3797,4 +3801,4 @@ export {
3797
3801
  RemoteClient,
3798
3802
  LocalStore
3799
3803
  };
3800
- //# sourceMappingURL=chunk-HTLAEGSA.js.map
3804
+ //# sourceMappingURL=chunk-VESJIIT2.js.map