Skip to content

Commit d4180b3

Browse files
authored
Fix with evaluation of ends_with condition in KML Generation (#136)
1 parent 852bb21 commit d4180b3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

background/kml.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ function checkStyleCondition(lValue, op, rValue){
5959
return rValue.split(',').indexOf(lValue) == -1;
6060
}
6161

62-
if(op === 'end_with'){
62+
if(op === 'ends_with'){
6363
return new RegExp(`${rValue}\$`).test(lValue);
6464
}
6565

@@ -87,6 +87,7 @@ function checkStyleCondition(lValue, op, rValue){
8787
if(op === 'length_greater'){
8888
return lValue === null ? false : lValue.length > rValue;
8989
}
90+
383
9091

9192
if(op === 'is_empty'){
9293
return lValue.length === 0
@@ -346,6 +347,9 @@ async function generate(options, type){
346347
const filterKey = filterKeys[k];
347348
const filterVal = filter[filterKey];
348349
const keyIndex = headers.indexOf(filterKey);
350+
351+
if(worksheet[XLSX.utils.encode_cell({c: keyIndex, r:R})] === undefined) continue;
352+
349353
const rowColVal= worksheet[XLSX.utils.encode_cell({c: keyIndex, r:R})].v;
350354

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

0 commit comments

Comments
 (0)