As minio causes various problem if you configure it using environment variables and leave the port setting out, which will evaluate to NaN, this change should fix this in a clean way for this time and helps to support numbers in general in future. Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
		
			
				
	
	
		
			23 lines
		
	
	
		
			632 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			23 lines
		
	
	
		
			632 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| 'use strict'
 | |
| 
 | |
| exports.toBooleanConfig = function toBooleanConfig (configValue) {
 | |
|   if (configValue && typeof configValue === 'string') {
 | |
|     return (configValue === 'true')
 | |
|   }
 | |
|   return configValue
 | |
| }
 | |
| 
 | |
| exports.toArrayConfig = function toArrayConfig (configValue, separator = ',', fallback) {
 | |
|   if (configValue && typeof configValue === 'string') {
 | |
|     return (configValue.split(separator).map(arrayItem => arrayItem.trim()))
 | |
|   }
 | |
|   return fallback
 | |
| }
 | |
| 
 | |
| exports.toIntegerConfig = function toIntegerConfig (configValue) {
 | |
|   if (configValue && typeof configValue === 'string') {
 | |
|     return parseInt(configValue)
 | |
|   }
 | |
|   return configValue
 | |
| }
 |