Hi Realdah,
I am a great fan of this library and I use it a lot in my current projects. I had a small suggestion like in general we will not use exact data in post request I will change continuously based on data.
why can we implement pattern matching instead of exact match in the data field, actually it helps developers a lot while doing form operations? for that, I have written a logic in utils.js file in your code which is working fine as expected for me. please add the below code at line 45 to get the solution.
else if(((typeof value) === 'string') && value.startsWith("/")){
if(fullObjectValue.match(value.substr(1, value.length-2))){
return false;
}else{
match = -1;
return true;
}
}
and mock json file:
{
"request" : {
"path": "test2",
"method": "post",
"body": {
"name": "Realdah",
"password": 1234,
"message": "/^[A-Z]+[A-Z]$/"
}
},
"response" : {
"status" : 200,
"data" : {
"message" : "you can see this because you used post method with pattern matching data",
"key" : "this is a post example with pattern matching data"
}
}
}
please follow below link for screenshots:
Thanks and Regards,
Viswa.
Note: it might be best if u have done the same implementation for query parameters also.
Definitely after adding these features this library will become so popular on all nodejs frontend technologies :):)