Implement MergedMap pattern

This commit is contained in:
Tangent 2024-07-14 22:19:26 -04:00
parent dc19a5ed9e
commit 63c41f07cb
2 changed files with 27 additions and 3 deletions
debug

View file

@ -36,7 +36,7 @@ User: tirga
const idv = Idv.parse(textarea.value);
pre.textContent = JSON.stringify(
idv.getMap("User", UserFromDocument),
idv.getMergedMap("User", UserFromDocument),
null,
2
);
@ -49,8 +49,7 @@ User: tirga
return [textarea, pre];
}
const UserFromDocument = (lines: string[]) => {
const idv = Idv.parseLines(lines);
const UserFromDocument = (idv: Idv) => {
return {
shell: idv.getProperty("Shell", String, StringFromDocument),
groups: idv.getList("Group", String, StringFromDocument),