UNPKG

@redocly/cli

Version:

[@Redocly](https://redocly.com) CLI is your all-in-one API documentation utility. It builds, manages, improves, and quality-checks your API descriptions, all of which comes in handy for various phases of the API Lifecycle. Create your own rulesets to make

13 lines 472 B
export function validatePositiveNumber(optionName, requireInteger = false) { return (arg) => { const num = Number(arg); if (isNaN(num) || num <= 0) { throw new Error(`${optionName} must be a positive number`); } if (requireInteger && !Number.isInteger(num)) { throw new Error(`${optionName} must be a positive integer`); } return num; }; } //# sourceMappingURL=validate-positive-number.js.map