mirror of
https://github.com/maelgangloff/domain-watchdog.git
synced 2025-12-29 16:15:04 +00:00
feat: add delete property on DomainEntity
This commit is contained in:
@@ -27,6 +27,7 @@ export interface Event {
|
||||
export interface Entity {
|
||||
handle: string
|
||||
jCard: any
|
||||
deleted: boolean
|
||||
}
|
||||
|
||||
export interface Nameserver {
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
import {Domain} from "../api";
|
||||
|
||||
export const sortDomainEntities = (domain: Domain) => domain.entities.sort((e1, e2) => {
|
||||
const p = (r: string[]) => r.includes('registrant') ? 5 :
|
||||
r.includes('administrative') ? 4 :
|
||||
r.includes('billing') ? 3 :
|
||||
r.includes('registrar') ? 2 : 1
|
||||
return p(e2.roles) - p(e1.roles)
|
||||
})
|
||||
export const sortDomainEntities = (domain: Domain) => domain.entities
|
||||
.filter(e => !e.entity.deleted)
|
||||
.sort((e1, e2) => {
|
||||
const p = (r: string[]) => r.includes('registrant') ? 5 :
|
||||
r.includes('administrative') ? 4 :
|
||||
r.includes('billing') ? 3 :
|
||||
r.includes('registrar') ? 2 : 1
|
||||
return p(e2.roles) - p(e1.roles)
|
||||
})
|
||||
Reference in New Issue
Block a user