Skip to content

Commit 1e0c7cf

Browse files
committed
Merge branch 'main' into bump-to-v3.18.1
2 parents 9a7efb0 + c72fcc8 commit 1e0c7cf

4 files changed

Lines changed: 24 additions & 18 deletions

File tree

package-lock.json

Lines changed: 16 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
"leaflet-lasso": "^2.2.13",
7373
"leaflet-vectoricon": "https://github.com/CollinBeczak/Leaflet.VectorIcon",
7474
"leaflet.markercluster": "^1.5.3",
75-
"lodash": "4.17.23",
75+
"lodash": "4.18.1",
7676
"mapillary-js": "^4.1.2",
7777
"normalize.css": "^7.0.0",
7878
"normalizr": "^3.6.0",

src/hooks/UsePropertyReplacement/UsePropertyReplacement.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export const replacePropertyTags = (
6262
}
6363

6464
// Conditionally url encode replacement value
65-
const replacement = _get(properties, tagName, "");
65+
const replacement = _get(properties, tagName, "") ?? "";
6666
return firstChar + (urlEncodeReplacement ? encodeURIComponent(replacement) : replacement);
6767
});
6868
};

src/hooks/UsePropertyReplacement/UsePropertyReplacement.test.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,12 @@ describe("usePropertyReplacement additional tests", () => {
9494
expect(result.current).toBe(content);
9595
});
9696

97+
it("replaces null property values with empty string", () => {
98+
const content = "alt_name={{alt_name}}";
99+
const { result } = renderHook(() => usePropertyReplacement(content, { alt_name: null }));
100+
expect(result.current).toBe("alt_name=");
101+
});
102+
97103
it("handles content with special characters in property values", () => {
98104
const content = "Special: {{special}}";
99105
const { result } = renderHook(() => usePropertyReplacement(content, properties));

0 commit comments

Comments
 (0)