diff --git a/umap/static/umap/js/modules/rules.js b/umap/static/umap/js/modules/rules.js index fa802efb..dbeb88e0 100644 --- a/umap/static/umap/js/modules/rules.js +++ b/umap/static/umap/js/modules/rules.js @@ -74,7 +74,8 @@ class Rule { if (vars.length !== 2) return this.key = vars[0] this.expected = vars[1] - if (!Number.isNaN(this.expected)) this.cast = Number.parseFloat + // biome-ignore lint/suspicious/noGlobalIsNan: expected might not be a number. + if (!isNaN(this.expected)) this.cast = Number.parseFloat else if (['true', 'false'].includes(this.expected)) this.cast = (v) => !!v this.expected = this.cast(this.expected) } diff --git a/umap/static/umap/test/DataLayer.js b/umap/static/umap/test/DataLayer.js index 201f8a7f..26ba7d61 100644 --- a/umap/static/umap/test/DataLayer.js +++ b/umap/static/umap/test/DataLayer.js @@ -316,7 +316,7 @@ describe('U.DataLayer', () => { let icon = qs('div.umap-div-icon .icon_container') poly.properties.mycolor = 'DarkGoldenRod' marker.properties.mycolor = 'DarkRed' - delete marker.properties._umap_options.color + marker.properties._umap_options.color = undefined assert.notOk(qs('path[fill="DarkGoldenRod"]')) assert.equal(icon.style.backgroundColor, 'olivedrab') datalayer.options.color = '{mycolor}'