mirror of
https://github.com/tiennm99/is-a-good-dev.git
synced 2026-06-06 08:12:09 +00:00
18 lines
437 B
JavaScript
18 lines
437 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].value);
|
|
}
|
|
|
|
if (recordType.toLowerCase() === 'cname') {
|
|
return checkIfValidFQDN(data.target[recordType].value);
|
|
}
|
|
|
|
return false;
|
|
}
|
|
|
|
module.exports = checkRecords;
|