contact-item.js 717 B

12345678910111213141516171819202122232425
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. class ContactItem {
  4. constructor(props) {
  5. this.data = props;
  6. this.hash = props.hash;
  7. this.id = props.id;
  8. this.addrs = props.addrs || [];
  9. this.groups = props.groups || [];
  10. }
  11. matchesAddressOrName(search) {
  12. if (this.addrs.filter(x => x.indexOf(search.trim()) >= 0)[0].length > 0) {
  13. return true;
  14. }
  15. return false;
  16. }
  17. matchesGroup(group) {
  18. if (this.groups.filter(x => x === group.trim())[0].length > 0) {
  19. return true;
  20. }
  21. return false;
  22. }
  23. }
  24. exports.ContactItem = ContactItem;
  25. //# sourceMappingURL=contact-item.js.map