Format fixes

This commit is contained in:
Richard Bowman 2023-12-01 02:23:58 +00:00
parent 59e0cf5905
commit 5d87a7582e
3 changed files with 8 additions and 4 deletions

View file

@ -75,8 +75,7 @@ export const wotStoreModule = {
if ("base" in td) {
let base = td.base;
if (href.startsWith("/")) href = href.slice(1);
if (!base.endsWith("/"))
base += "/";
if (!base.endsWith("/")) base += "/";
return base + href;
}
return href;
@ -96,6 +95,7 @@ export function findFormHref(affordance, op) {
// Find the form in the affordance that matches the given operation type
let forms = affordance.forms;
let matchingForm = forms.find(f => f.op == op || f.op.includes(op));
if (matchingForm == undefined) return undefined;
return matchingForm.href;
}