UNPKG

env-var

Version:

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

14 lines (9 loc) 219 B
'use strict' const asFloat = require('./float') module.exports = function asFloatPositive (value) { const ret = asFloat(value) if (ret < 0) { throw new Error('should be a positive float') } return ret }