Files
is-a-good-dev/utils/checkRecords.js
T
2022-08-03 11:37:05 -06:00

13 lines
417 B
JavaScript

const { checkIfValidIP, checkIfValidFQDN } = require('./utils.js');
function checkRecords(data) {
const recordType = Object.keys(data.target)[0]
if (recordType.toLowerCase() === "a") {
return checkIfValidIP(data.target[recordType])
}
if (recordType.toLowerCase() === "cname") {
return checkIfValidFQDN(data.target[recordType])
}
return false;
}
module.exports = checkRecords;