Skip to content

Commit

Permalink
Fix with evaluation of ends_with condition in KML Generation (#136)
Browse files Browse the repository at this point in the history
  • Loading branch information
erssebaggala authored Oct 25, 2019
1 parent 852bb21 commit d4180b3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion background/kml.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ function checkStyleCondition(lValue, op, rValue){
return rValue.split(',').indexOf(lValue) == -1;
}

if(op === 'end_with'){
if(op === 'ends_with'){
return new RegExp(`${rValue}\$`).test(lValue);
}

Expand Down Expand Up @@ -87,6 +87,7 @@ function checkStyleCondition(lValue, op, rValue){
if(op === 'length_greater'){
return lValue === null ? false : lValue.length > rValue;
}
383

if(op === 'is_empty'){
return lValue.length === 0
Expand Down Expand Up @@ -346,6 +347,9 @@ async function generate(options, type){
const filterKey = filterKeys[k];
const filterVal = filter[filterKey];
const keyIndex = headers.indexOf(filterKey);

if(worksheet[XLSX.utils.encode_cell({c: keyIndex, r:R})] === undefined) continue;

const rowColVal= worksheet[XLSX.utils.encode_cell({c: keyIndex, r:R})].v;

if(filterVal !== rowColVal) { filterStatus = false; break } //skip this row's values
Expand Down

0 comments on commit d4180b3

Please sign in to comment.