UNPKG

@linkedmink/node-route53-dynamic-dns

Version:

Background process that updates AWS Route 53 DNS address records whenever the public IP of the hosting environment changes

11 lines 548 B
const DNS_RECORD_REG_EX = /^((\\052|\\100).)?[a-z0-9-_.]*\.$/; export const validateNormalizeDnsRecord = (dnsRecordName) => { const trimLower = dnsRecordName.trim().toLowerCase(); const withTrailingDot = trimLower.endsWith(".") ? trimLower : `${trimLower}.`; const normalized = withTrailingDot.replace("*", "\\052").replace("@", "\\100"); if (!DNS_RECORD_REG_EX.test(normalized)) { throw new Error(`The name is not a valid DNS record: ${dnsRecordName}`); } return normalized; }; //# sourceMappingURL=validate.mjs.map