fix: move hash to front of identifier

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
This commit is contained in:
Andrew Calcutt 2023-10-15 01:06:52 -04:00
parent f786989600
commit fd2ffacb7c

View file

@ -212,7 +212,7 @@ function start(opts) {
StyleSourceId; StyleSourceId;
if (isValidHttpUrl(StyleSourceId)) { if (isValidHttpUrl(StyleSourceId)) {
id = id =
id.replace(/^.*\/(.*)$/, '$1') + '_' + fnv1a(StyleSourceId); fnv1a(StyleSourceId) + '_' + id.replace(/^.*\/(.*)$/, '$1');
} }
while (data[id]) id += '_'; //if the data source id already exists, add a "_" untill it doesn't while (data[id]) id += '_'; //if the data source id already exists, add a "_" untill it doesn't
//Add the new data source to the data array. //Add the new data source to the data array.