First upload version 0.0.1
This commit is contained in:
18
node_modules/env-var/lib/accessors/bool.js
generated
vendored
Normal file
18
node_modules/env-var/lib/accessors/bool.js
generated
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
'use strict'
|
||||
|
||||
module.exports = function asBool (value) {
|
||||
const val = value.toLowerCase()
|
||||
|
||||
const allowedValues = [
|
||||
'false',
|
||||
'0',
|
||||
'true',
|
||||
'1'
|
||||
]
|
||||
|
||||
if (allowedValues.indexOf(val) === -1) {
|
||||
throw new Error('should be either "true", "false", "TRUE", "FALSE", 1, or 0')
|
||||
}
|
||||
|
||||
return !(((val === '0') || (val === 'false')))
|
||||
}
|
||||
Reference in New Issue
Block a user