refactor: deno lint fix slow-type-missing-explicit-return-type

This commit is contained in:
Julien Oculi 2024-07-15 14:23:17 +02:00
parent 6eaf3b6083
commit b437863f8b

View file

@ -1,14 +1,16 @@
import accounts from '../config/account.json' with { type: 'json' }
import dkim from '../config/dkim.json' with { type: 'json' }
export type AddressString = `${string}@${string}.${string}`
export class Contact {
#name: string
#address: `${string}@${string}.${string}`
#address: AddressString
constructor(
{ name, address }: {
name: string
address: `${string}@${string}.${string}`
address: AddressString
},
) {
this.#name = name
@ -60,18 +62,18 @@ export class Contact {
return `${this.#name} <${this.#address}>`
}
toJSON() {
toJSON(): { name: string; address: AddressString } {
return {
name: this.#name,
address: this.#address,
} as const
}
get name() {
get name(): string {
return this.#name
}
get address() {
get address(): AddressString {
return this.#address
}
}