changes record comparison

This commit is contained in:
Akshay Nair
2022-01-17 19:06:55 +05:30
parent 209f5dc971
commit 00156c7668
2 changed files with 3 additions and 1 deletions

1
.envrc Normal file
View File

@@ -0,0 +1 @@
use_nix

View File

@@ -44,7 +44,8 @@ const recordToEmailMx = ({ name, address, priority }) => ({
priority,
})
const getHostKey = host => `${host.name}##${host.type}##${host.address}`;
const getHostKey = host =>
`${host.name?.toLowerCase()}##${host.type.toLowerCase()}##${host.address?.toLowerCase()}`;
const diffRecords = (oldRecords, newRecords) => {
const isMatchingRecord = (a, b) => getHostKey(a) === getHostKey(b);