mirror of
https://github.com/grafana/grafana.git
synced 2025-02-15 01:53:33 -06:00
9 lines
234 B
TypeScript
9 lines
234 B
TypeScript
// @ts-ignore
|
|
import sqlFormatter from 'sql-formatter-plus';
|
|
|
|
export function formatSQL(q: string) {
|
|
return sqlFormatter.format(q).replace(/(\$ \{ .* \})|(\$ __)|(\$ \w+)/g, (m: string) => {
|
|
return m.replace(/\s/g, '');
|
|
});
|
|
}
|