mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 04:01:58 +00:00
wip refactor
This commit is contained in:
@@ -226,12 +226,16 @@ function filterRec(
|
||||
return hostnames
|
||||
}
|
||||
|
||||
function isDefaultEnabled(h: HostnameInfo): boolean {
|
||||
return !(h.public && (h.hostname.kind === 'ipv4' || h.hostname.kind === 'ipv6'))
|
||||
}
|
||||
|
||||
function enabledAddresses(addr: DerivedAddressInfo): HostnameInfo[] {
|
||||
return addr.possible.filter((h) =>
|
||||
h.public
|
||||
? addr.publicEnabled.some((e) => deepEqual(e, h))
|
||||
: !addr.privateDisabled.some((d) => deepEqual(d, h)),
|
||||
)
|
||||
return addr.possible.filter((h) => {
|
||||
if (addr.enabled.some((e) => deepEqual(e, h))) return true
|
||||
if (addr.disabled.some((d) => deepEqual(d, h))) return false
|
||||
return isDefaultEnabled(h)
|
||||
})
|
||||
}
|
||||
|
||||
export const filledAddress = (
|
||||
|
||||
Reference in New Issue
Block a user