Skip to content

Commit

Permalink
Merge pull request origo-map#1201 from origo-map/geopackage-null-fix
Browse files Browse the repository at this point in the history
Fix for null values for geopackage source
  • Loading branch information
johnnyblasta authored Mar 10, 2021
2 parents de6ceb0 + cc4b62a commit fc9902d
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 fc9902d

Please sign in to comment.