hardened quicklaunch script

This commit is contained in:
2026-01-15 07:36:54 +01:00
parent d37ff2a355
commit d4d2e308db
+4 -4
View File
@@ -143,9 +143,9 @@ data:
})
.then(data => {
indexed = data.map(x => ({
title: x.title,
url: x.url,
meta: [x.page, x.widget, x.group].filter(Boolean).join(' • ')
title: String(x.title ?? x.url ?? ''),
url: String(x.url ?? ''),
meta: [x.page, x.widget, x.group].filter(Boolean).map(v => String(v)).join(' • ')
}));
indexLoaded = true;
})
@@ -166,7 +166,7 @@ data:
}
function normalize(s) {
return (s || '').toLowerCase().replace(/\s+/g, ' ').trim();
return String(s ?? '').toLowerCase().replace(/\s+/g, ' ').trim();
}
function score(item, q) {