/**
 * Default OpenAPI template for creating new documents
 */
export const BASE_TEMPLATE = `
{
  "openapi": "3.1.0",
  "info": {
    "version": "1.0.0",
    "title": "My Zuplo API"
  },
  "paths": {}
}

`;
/**
 * Detect if source is a URL
 */
export function isUrl(source) {
    try {
        new URL(source);
        return true;
    }
    catch {
        return false;
    }
}
/**
 * Guess file name from URL
 * Extracts the base filename from a URL's pathname
 */
export function guessFileNameFromUrl(url) {
    const parsedUrl = new URL(url);
    const basename = parsedUrl.pathname
        .split("/")
        .pop()
        ?.replace(/\.[^/.]+$/, "");
    // Use btoa for browser compatibility (Node.js 16+ supports btoa globally)
    return basename || `imported-${btoa(url)}`;
}
//# sourceMappingURL=url-utils.js.map