import { format } from 'sql-formatter';

function formatSQL(q, language = "sql") {
  const formatted = format(q, {
    language,
    paramTypes: {
      custom: [
        {
          regex: "\\$\\s*\\{[^}]*\\}|\\$\\s*__\\w+(?:\\([^)]*\\))?|\\$\\s*\\w+"
        }
      ]
    }
  });
  return formatted.replace(
    /(\$\s*\{[^}]*\})|(\$\s*__\w+(?:\([^)]*\))?)|(\$\s*\w+)/g,
    (m) => m.replace(/\s/g, "")
  );
}

export { formatSQL };
//# sourceMappingURL=formatSQL.js.map
