hardened quicklaunch script
This commit is contained in:
@@ -143,9 +143,9 @@ data:
|
|||||||
})
|
})
|
||||||
.then(data => {
|
.then(data => {
|
||||||
indexed = data.map(x => ({
|
indexed = data.map(x => ({
|
||||||
title: x.title,
|
title: String(x.title ?? x.url ?? ''),
|
||||||
url: x.url,
|
url: String(x.url ?? ''),
|
||||||
meta: [x.page, x.widget, x.group].filter(Boolean).join(' • ')
|
meta: [x.page, x.widget, x.group].filter(Boolean).map(v => String(v)).join(' • ')
|
||||||
}));
|
}));
|
||||||
indexLoaded = true;
|
indexLoaded = true;
|
||||||
})
|
})
|
||||||
@@ -166,7 +166,7 @@ data:
|
|||||||
}
|
}
|
||||||
|
|
||||||
function normalize(s) {
|
function normalize(s) {
|
||||||
return (s || '').toLowerCase().replace(/\s+/g, ' ').trim();
|
return String(s ?? '').toLowerCase().replace(/\s+/g, ' ').trim();
|
||||||
}
|
}
|
||||||
|
|
||||||
function score(item, q) {
|
function score(item, q) {
|
||||||
|
|||||||
Reference in New Issue
Block a user