mirror of
https://github.com/CompassConnections/Compass.git
synced 2026-02-19 15:27:16 -05:00
7 lines
334 B
TypeScript
7 lines
334 B
TypeScript
export function sqlMatch(sql: string) {
|
|
// Normalize: collapse all whitespace to single spaces, trim
|
|
// Then build a regex that tolerates any whitespace or line break in the real SQL.
|
|
const escaped = sql.replace(/[.*+?^${}()|[\]\\]/g, '\\$&').trim()
|
|
return expect.stringMatching(new RegExp(escaped.replace(/\s+/g, '\\s+')))
|
|
}
|