added validation for folder

This commit is contained in:
Dhroov7
2019-12-04 17:05:01 +05:30
parent df454cdfd8
commit 822a034526
2 changed files with 57 additions and 49 deletions

View File

@@ -120,6 +120,14 @@ module.exports = {
data = fs.readFileSync(input.data).toString();
return validate(data);
}
else if (input.type === 'folder') {
if (!_.isEmpty(parse.getRootFiles(input.data))) {
return {
result: true,
reason: 'valid input type'
};
}
}
return {
result: false,
reason: 'input type is not valid'