mirror of
https://github.com/aljazceru/cyphernode.git
synced 2025-12-26 17:15:08 +01:00
made uacomment optional
This commit is contained in:
@@ -139,6 +139,15 @@ module.exports = class extends Generator {
|
||||
return this.props && this.props[name];
|
||||
}
|
||||
|
||||
_optional(input,validator) {
|
||||
if( input === undefined ||
|
||||
input === null ||
|
||||
input === '' ) {
|
||||
return true;
|
||||
}
|
||||
return validator(input);
|
||||
}
|
||||
|
||||
_ipOrFQDNValidator( host ) {
|
||||
host = (host+"").trim();
|
||||
if( !(validator.isIP(host) ||
|
||||
|
||||
@@ -77,7 +77,7 @@ module.exports = {
|
||||
default: utils._getDefault( 'bitcoin_uacomment' ),
|
||||
message: prefix()+'Any UA comment?'+'\n',
|
||||
filter: utils._trimFilter,
|
||||
validate: utils._UACommentValidator
|
||||
validate: (input)=> {return utils._optional(input,utils._UACommentValidator) }
|
||||
}];
|
||||
},
|
||||
env: function( props ) {
|
||||
|
||||
Reference in New Issue
Block a user