UNPKG

env-var

Version:

Verification, sanitization, and type coercion for environment variables in Node.js

14 lines (9 loc) 213 B
'use strict' const asInt = require('./int') module.exports = function asIntPositive (value) { const ret = asInt(value) if (ret < 0) { throw new Error('should be a positive integer') } return ret }