Merge pull request #15 from rajat2502/trim-data-values
fix: trim data values before generate
This commit is contained in:
@@ -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();
|
||||||
|
|||||||
Reference in New Issue
Block a user