1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
export class Logins { constructor() { this.logins = {}; } addLogin(id, name) { this.logins[id] = name; return this; } setLogins(logins) { this.logins = {}; for (let { id, name } of logins) { this.addLogin(id, name); } return this; } get(id) { return this.logins[id]; } }