import { isLoopbackAddr } from 'is-loopback-addr';
import { isIpBased } from './is-ip-based.js';
/**
 * Check if a given multiaddr is a loopback address.
 */
export function isLoopback(ma) {
    if (!isIpBased(ma)) {
        // not an IP based multiaddr, cannot be private
        return false;
    }
    const { address } = ma.nodeAddress();
    return isLoopbackAddr(address);
}
//# sourceMappingURL=is-loopback.js.map