Merge pull request #15 from rajat2502/trim-data-values

fix: trim data values before generate
This commit is contained in:
Rahul Jain
2020-07-20 19:56:23 +05:30
committed by GitHub
+6
View File
@@ -124,7 +124,13 @@ const IndexPage = () => {
}); });
}, 3000); }, 3000);
} }
const trimDataValues = () => {
const dataObj = { ...data };
Object.keys(dataObj).forEach(k => (typeof dataObj[k] === 'string') ? dataObj[k] = dataObj[k].trim() : null);
setData(dataObj);
}
const handleGenerate = () => { const handleGenerate = () => {
trimDataValues();
if (data.visitorsBadge || data.githubStats) { if (data.visitorsBadge || data.githubStats) {
if (social.github) { if (social.github) {
generate(); generate();