/**
 * Build fetch resource for request
 */
export function buildResource(serverResolver, hostname, recordType) {
    return `${serverResolver}?name=${hostname}&type=${recordType}`;
}
/**
 * Use fetch to find the record
 */
export async function request(resource, signal) {
    const req = await fetch(resource, {
        headers: new Headers({
            accept: 'application/dns-json'
        }),
        signal
    });
    const res = await req.json();
    return res;
}
/**
 * Creates cache key composed by recordType and hostname
 *
 * @param {string} hostname
 * @param {string} recordType
 */
export function getCacheKey(hostname, recordType) {
    return `${recordType}_${hostname}`;
}
//# sourceMappingURL=utils.js.map