26 řádky
669 B
JavaScript
26 řádky
669 B
JavaScript
|
import { UTXOEngine } from "./engine.js";
|
||
|
|
||
|
const utxo = new UTXOEngine({ silent: true });
|
||
|
await utxo.init();
|
||
|
|
||
|
const entryId = "22";
|
||
|
const entry = utxo.entries[entryId];
|
||
|
|
||
|
const pt = entry.specs.team.teams;
|
||
|
const teams = Object.keys(pt).map((id) => Object.assign({ id }, pt[id]));
|
||
|
|
||
|
console.log("----");
|
||
|
|
||
|
function members(t) {
|
||
|
return t.members.map((m) => m === t.lead ? "@" + m : m).sort((m) =>
|
||
|
m.substring(0, 1) === "@" ? -1 : 1
|
||
|
).join(", ");
|
||
|
}
|
||
|
|
||
|
for (const t of teams.filter((t) => !t.parent)) {
|
||
|
console.log(`[${t.id}] +${members(t)}`);
|
||
|
for (const st of teams.filter((tx) => tx.parent === t.id)) {
|
||
|
console.log(` \\\__ [${st.id}] +${members(st)}`);
|
||
|
}
|
||
|
}
|