Parse a CLI-style positive integer without allowing IEEE-754 or native-width truncation.
Decimal spelling supplied by the caller.
Human-readable option name used in the error.
Inclusive upper bound; defaults to JavaScript's safe-integer maximum.
The admitted integer.
If the spelling is not a positive safe integer within the bound.
const ef = parsePositiveInt("100", "--hnsw-ef", 0xffff_ffff); Copy
const ef = parsePositiveInt("100", "--hnsw-ef", 0xffff_ffff);
Parse a CLI-style positive integer without allowing IEEE-754 or native-width truncation.