MCPcopy Create free account
hub / github.com/Kilo-Org/cloud / stripLineComments

Function stripLineComments

packages/wl-sdk/scripts/sql-parser.ts:59–67  ·  view source on GitHub ↗

* Strip line comments (`-- ...`) but not block comments. `commons.sql` does * not currently use either; we keep the helper trivial and document the * limitation.

(sql: string)

Source from the content-addressed store, hash-verified

57 * limitation.
58 */
59function stripLineComments(sql: string): string {
60 return sql
61 .split('\n')
62 .map(line => {
63 const idx = line.indexOf('--');
64 return idx >= 0 ? line.slice(0, idx) : line;
65 })
66 .join('\n');
67}
68
69/**
70 * Split SQL into top-level statements at semicolons that appear outside of

Callers 1

splitStatementsFunction · 0.85

Calls 1

joinMethod · 0.80

Tested by

no test coverage detected