import { User } from './user' ; export class UserRepository { constructor ( readonly list ) { } find ( username ) { const found = Object . keys ( this . list ) . find ( k => this . list [ k ] . username === username ) ; return found ? this . list [ found ] : undefined ; } }