(name: string)
| 136 | }; |
| 137 | |
| 138 | const escapeMongoDBCollectionName = (name: string) => { |
| 139 | // The backend wraps --eval in single quotes for shell execution and escapes |
| 140 | // single quotes with '"'"'. To avoid conflicts, we: |
| 141 | // 1. Use double quotes for the collection name string |
| 142 | // 2. Escape backslashes and double quotes for JavaScript |
| 143 | // 3. Replace single quotes with Unicode escape \u0027 so the shell doesn't see them |
| 144 | return name |
| 145 | .replace(/\\/g, "\\\\") |
| 146 | .replace(/"/g, '\\"') |
| 147 | .replace(/'/g, "\\u0027"); |
| 148 | }; |
| 149 | |
| 150 | const wrapSQLIdentifier = (id: string, engine: Engine) => { |
| 151 | if (engine === Engine.MSSQL) { |
no outgoing calls
no test coverage detected