You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
455 B

3 years ago
  1. export class UserItem {
  2. constructor(
  3. public id: number,
  4. public username: string,
  5. public is_superuser: boolean
  6. ) {}
  7. static valueOf(
  8. { id, username, is_superuser }:
  9. { id: number, username: string, is_superuser: boolean }
  10. ): UserItem {
  11. return new UserItem(id, username, is_superuser)
  12. }
  13. toObject(): Object {
  14. return {
  15. id: this.id,
  16. username: this.username,
  17. is_superuser: this.is_superuser
  18. }
  19. }
  20. }