datasquirel/package-shared/utils/trim-sql.ts
2025-01-10 20:10:28 +01:00

11 lines
245 B
TypeScript

/**
* # Trim SQL
* @description Remove Returns and miltiple spaces from SQL Query
*/
export default function trimSql(sql: string) {
return sql
.replace(/\n|\r|\n\r|\r\n/gm, " ")
.replace(/ {2,}/g, " ")
.trim();
}