Host checked adapter-object controllers through bounded registries (WI-13)
This commit is contained in:
@@ -10,7 +10,8 @@ export async function scaffoldController(
|
||||
const entry = { id: spec.id, ...spec.controller };
|
||||
const fields = ["id", "subject", "snapshot", "remote", "input"];
|
||||
if (
|
||||
Object.keys(entry).length !== fields.length ||
|
||||
Object.keys(entry).some((key) => ![...fields, "registry"].includes(key)) ||
|
||||
(entry.registry !== undefined && typeof entry.registry !== "string") ||
|
||||
fields.some((key) => typeof (entry as Record<string, unknown>)[key] !== "string") ||
|
||||
!["unit", "value"].includes(entry.input ?? "")
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user