First upload version 0.0.1
This commit is contained in:
11
node_modules/env-var/lib/accessors/int.js
generated
vendored
Normal file
11
node_modules/env-var/lib/accessors/int.js
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
'use strict'
|
||||
|
||||
module.exports = function asInt (value) {
|
||||
const n = parseInt(value, 10)
|
||||
|
||||
if (isNaN(n) || n.toString(10) !== value) {
|
||||
throw new Error('should be a valid integer')
|
||||
}
|
||||
|
||||
return n
|
||||
}
|
||||
Reference in New Issue
Block a user