refactor: deno lint fix slow-type-missing-explicit-return-type
This commit is contained in:
parent
6eaf3b6083
commit
b437863f8b
|
@ -1,14 +1,16 @@
|
||||||
import accounts from '../config/account.json' with { type: 'json' }
|
import accounts from '../config/account.json' with { type: 'json' }
|
||||||
import dkim from '../config/dkim.json' with { type: 'json' }
|
import dkim from '../config/dkim.json' with { type: 'json' }
|
||||||
|
|
||||||
|
export type AddressString = `${string}@${string}.${string}`
|
||||||
|
|
||||||
export class Contact {
|
export class Contact {
|
||||||
#name: string
|
#name: string
|
||||||
#address: `${string}@${string}.${string}`
|
#address: AddressString
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
{ name, address }: {
|
{ name, address }: {
|
||||||
name: string
|
name: string
|
||||||
address: `${string}@${string}.${string}`
|
address: AddressString
|
||||||
},
|
},
|
||||||
) {
|
) {
|
||||||
this.#name = name
|
this.#name = name
|
||||||
|
@ -60,18 +62,18 @@ export class Contact {
|
||||||
return `${this.#name} <${this.#address}>`
|
return `${this.#name} <${this.#address}>`
|
||||||
}
|
}
|
||||||
|
|
||||||
toJSON() {
|
toJSON(): { name: string; address: AddressString } {
|
||||||
return {
|
return {
|
||||||
name: this.#name,
|
name: this.#name,
|
||||||
address: this.#address,
|
address: this.#address,
|
||||||
} as const
|
} as const
|
||||||
}
|
}
|
||||||
|
|
||||||
get name() {
|
get name(): string {
|
||||||
return this.#name
|
return this.#name
|
||||||
}
|
}
|
||||||
|
|
||||||
get address() {
|
get address(): AddressString {
|
||||||
return this.#address
|
return this.#address
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue