Skip to content

Commit c40a5da

Browse files
committed
docs: typo, template builder type fixes
1 parent 1158e35 commit c40a5da

File tree

2 files changed

+16
-10
lines changed

2 files changed

+16
-10
lines changed

docs/stacks/vue/TemplateBuilder.vue

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,9 @@
9494
9595
&:hover {
9696
background-color: var(--vp-code-bg);
97-
transition: color 0.25s, background-color 0.5s;
97+
transition:
98+
color 0.25s,
99+
background-color 0.5s;
98100
}
99101
}
100102
</style>
@@ -109,7 +111,7 @@ type Parameter = {
109111
displayName: string;
110112
description?: string;
111113
meetsReqs: boolean;
112-
requires: Parameter[];
114+
requires: string;
113115
onlyIf?: string[];
114116
link?: string;
115117
};
@@ -155,33 +157,35 @@ watch(
155157
.map((x) => "--" + x)
156158
.join(" ");
157159
},
158-
{ immediate: true }
160+
{ immediate: true },
159161
);
160162
161163
type Requirements = ["and" | "or", ...(Requirements | string)[]];
162-
function evalReq(req: Requirements) {
164+
function evalReq(req: Requirements): boolean {
163165
if (req[0] == "and") {
164166
return req
165167
.slice(1)
166168
.every((req) =>
167-
typeof req == "string" ? selections.value.includes(req) : evalReq(req)
169+
typeof req == "string" ? selections.value.includes(req) : evalReq(req),
168170
);
169171
} else if (req[0] == "or") {
170172
return req
171173
.slice(1)
172174
.some((req) =>
173-
typeof req == "string" ? selections.value.includes(req) : evalReq(req)
175+
typeof req == "string" ? selections.value.includes(req) : evalReq(req),
174176
);
177+
} else {
178+
return false;
175179
}
176180
}
177-
function displayReq(req: Requirements) {
181+
function displayReq(req: Requirements): string | null {
178182
if (req[0] == "and") {
179183
return req
180184
.slice(1)
181185
.map((req) =>
182186
typeof req == "string"
183187
? parameters.find((p) => p.key == req)?.displayName
184-
: "(" + displayReq(req) + ")"
188+
: "(" + displayReq(req) + ")",
185189
)
186190
.join(" and ");
187191
} else if (req[0] == "or") {
@@ -190,9 +194,11 @@ function displayReq(req: Requirements) {
190194
.map((req) =>
191195
typeof req == "string"
192196
? parameters.find((p) => p.key == req)?.displayName
193-
: "(" + displayReq(req) + ")"
197+
: "(" + displayReq(req) + ")",
194198
)
195199
.join(" or ");
200+
} else {
201+
return null;
196202
}
197203
}
198204
</script>

docs/topics/startup.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ app.UseViteStaticFiles(new()
9999
OnAuthorizeAsync = ctx => ctx.Context.Request.Path.StartsWithSegments("/assets") == true
100100
// Vite compiled assets require authentication
101101
? ValueTask.FromResult(ctx.Context.User.Identity?.IsAuthenticated == true)
102-
// Anything else (e.g. `arc/public` directory) do not.
102+
// Anything else (e.g. `src/public` directory) do not.
103103
: ValueTask.FromResult(true)
104104
});
105105
```

0 commit comments

Comments
 (0)