11 lines
245 B
TypeScript
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();
|
||
|
}
|