Skip to content

Commit

Permalink
fix: parsing the body limit value (#613)
Browse files Browse the repository at this point in the history
  • Loading branch information
petermasking authored Feb 6, 2025
1 parent 0c7b437 commit 5b56f14
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions packages/cli/src/commands/StartServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,10 @@ export default class StartServer implements Command
return logLevelParser.parse(logLevel);
}

#parseBodyLimit(bodyLimit: string | undefined): number | undefined
#parseBodyLimit(bodyLimitString: string | undefined): number | undefined
{
if (Number.isInteger(bodyLimit) === false)
{
return undefined;
}
const bodyLimit = Number.parseInt(bodyLimitString as string);

return Number.parseInt(bodyLimit as string);
return Number.isNaN(bodyLimit) ? undefined : bodyLimit;
}
}

0 comments on commit 5b56f14

Please sign in to comment.