Merge pull request #1482 from umap-project/greedytemplate-object

Do not fail on greedyTemplate when description is an object
This commit is contained in:
Yohan Boniface 2023-12-23 08:41:48 +01:00 committed by GitHub
commit acfcc2e2a6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -176,6 +176,8 @@ L.Util.greedyTemplate = (str, data, ignore) => {
return value return value
} }
if (typeof str !== 'string') return ''
return str.replace( return str.replace(
/\{ *([^\{\}/\-]+)(?:\|("[^"]*"))? *\}/g, /\{ *([^\{\}/\-]+)(?:\|("[^"]*"))? *\}/g,
(str, key, staticFallback) => { (str, key, staticFallback) => {