MCPcopy Index your code
hub / github.com/itwanger/toBeBetterJavaer / parsePositiveInt

Function parsePositiveInt

scripts/convert-mdnice-images-to-cdn.js:121–127  ·  view source on GitHub ↗
(value, optionName)

Source from the content-addressed store, hash-verified

119}
120
121function parsePositiveInt(value, optionName) {
122 const parsed = Number.parseInt(value, 10);
123 if (!Number.isFinite(parsed) || parsed <= 0) {
124 throw new Error(`${optionName} must be a positive integer`);
125 }
126 return parsed;
127}
128
129function loadEnv(envFile) {
130 if (!fs.existsSync(envFile)) {

Callers 1

parseArgsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected