datasquirel/package-shared/utils/trim-sql.ts

11 lines
245 B
TypeScript
Raw Normal View History

2025-01-10 19:10:28 +00:00
/**
* # 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();
}