Skip to content

Commit

Permalink
Fix for null values for geopackage source
Browse files Browse the repository at this point in the history
  • Loading branch information
johnnyblasta committed Mar 10, 2021
1 parent 2e2dac2 commit cc4b62a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/utils/templatehelpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@ const templateHelpers = {
if: (condition, thenTemplate, elseTemplate = '') => (condition ? thenTemplate : elseTemplate),
each: (obj, templateFn) => {
const props = Object.keys(obj);
const items = props.map(prop => ({
const propsIncluded = [];
props.forEach(element => {
if (typeof obj[element] !== 'undefined' && obj[element] !== null && obj[element] !== '') {
propsIncluded.push(element);
}
});
const items = propsIncluded.map(prop => ({
prop,
value: obj[prop]
}));
Expand Down

0 comments on commit cc4b62a

Please sign in to comment.