| 1234567891011121314151617181920212223242526272829303132333435 |
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- class ContactItem {
- constructor(props) {
- this.data = props;
- this.hash = props.hash;
- this.id = props.id;
- this.addrs = props.addrs || [];
- this.groups = props.groups || [];
- }
- matchesAddressOrName(search) {
- if (this.addrs.filter(x => x.indexOf(search.trim()) >= 0)[0].length > 0) {
- return true;
- }
- return false;
- }
- matchesGroup(group) {
- if (this.groups.filter(x => x === group.trim())[0].length > 0) {
- return true;
- }
- return false;
- }
- getFirstEmail() {
- const prefixed = this.addrs.filter(x => x.startsWith('email:'))[0];
- if (prefixed == null) {
- return undefined;
- }
- return prefixed.substring(6);
- }
- getMatchingAddresses() {
- return this.addrs.filter(x => x.indexOf(x) >= 0);
- }
- }
- exports.ContactItem = ContactItem;
- //# sourceMappingURL=contact-item.js.map
|