Skip to content

Commit

Permalink
refactor: Increase understandability of function
Browse files Browse the repository at this point in the history
For this change, I increased the tolerance for the coverage of lines
setting
  • Loading branch information
Roman Seidelsohn committed May 12, 2023
1 parent 8b94df8 commit cbbbba4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
13 changes: 11 additions & 2 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -970,5 +970,14 @@ const getCsvData = (sorted, customFormat, csvComponentPrefix) => {
return csvDataArr;
};

const getOptionArray = (option) =>
(Array.isArray(option) && option) || (typeof option === 'string' && option.split(';')) || false;
const getOptionArray = (option) => {
if (Array.isArray(option)) {
return option;
}

if (typeof option === 'string') {
return option.split(';');
}

return false;
};
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"exclude": [
"**/tests/*.js"
],
"lines": 90,
"lines": 80,
"statements": 80,
"functions": 80,
"branches": 80
Expand Down

0 comments on commit cbbbba4

Please sign in to comment.