-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers
Description
Currently, e.g. in histohour.js, input validation is implemented for each param, required and optional, with a lot of repetitive code:
// optional fields
// extraParams
if(msg.params && msg.params.extraParams){
urlParams.push("extraParams="+msg.params.extraParams);
}else{
if(node.extraParams || node.extraParams!=""){
urlParams.push("extraParams="+ node.extraParams);
}
}
// sign
if(msg.params && msg.params.sign){
urlParams.push("sign="+msg.params.sign);
}else{
if(node.sign || node.sign!=""){
urlParams.push("sign="+ node.sign);
}
}
This should be replaced by a generic method, to which you pass: the full input object and with a params setting or config object, the method should validate if input object complies to paramsConfig object.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers