contact-book.js 766 B

123456789101112131415161718192021222324252627
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. class ContactBook {
  4. constructor(items) {
  5. this.items = items;
  6. }
  7. getPrimaryEmailAddress() {
  8. for (const item of this.items) {
  9. for (const address of item.canSendFromAddrs) {
  10. if (address.startsWith('email:')) {
  11. return address;
  12. }
  13. }
  14. }
  15. }
  16. getPrimaryPhoneNumber() {
  17. for (const item of this.items) {
  18. for (const address of item.canSendFromAddrs) {
  19. if (address.startsWith('phone:')) {
  20. return address;
  21. }
  22. }
  23. }
  24. }
  25. }
  26. exports.ContactBook = ContactBook;
  27. //# sourceMappingURL=contact-book.js.map