/**
 * Browser shim for node:dns
 *
 * DNS resolution is not available in the browser. This shim provides
 * a minimal implementation to satisfy the bundler while ensuring
 * that DNS-based private network protection fails safe (by blocking).
 */
export function lookup(hostname, optionsOrCallback, callbackOrNone) {
    const options = typeof optionsOrCallback === "function" ? undefined : optionsOrCallback;
    const callback = typeof optionsOrCallback === "function"
        ? optionsOrCallback
        : callbackOrNone;
    const err = new Error(`DNS lookup for "${hostname}" is not supported in the browser.`);
    // Add code to satisfy typical node error handling
    Object.assign(err, { code: "ENOTFOUND" });
    // Always return an error to prevent reaching private IPs by hostname
    // since we can't verify the resolved IP in the browser.
    setTimeout(() => {
        if (typeof options === "object" && options.all) {
            callback(err, []);
        }
        else {
            callback(err, null, 0);
        }
    }, 0);
}
const _default_1 = {
    lookup,
};
export default _default_1;
