import Email from "./Email";
import Typeof from "./Typeof";
export default class EmailWithName {
    get email() {
        return this._email;
    }
    set email(v) {
        if (typeof v === Typeof.String) {
            this._email = new Email(v.toString());
        }
        if (v instanceof Email) {
            this._email = v;
        }
    }
    get name() {
        return this._name;
    }
    set name(v) {
        this._name = v;
    }
    constructor(name, email) {
        this._email = new Email("noreply@oneuptime.com");
        this._name = "";
        this.email = email;
        this.name = name;
    }
    toString() {
        return `"${this.name}" <${this.email}>`;
    }
}
//# sourceMappingURL=EmailWithName.js.map