* Sanitize a string for PostgreSQL by removing null bytes (0x00). * PostgreSQL text columns don't accept null bytes in UTF-8 encoding.
(str: string)
| 22 | * PostgreSQL text columns don't accept null bytes in UTF-8 encoding. |
| 23 | */ |
| 24 | function sanitizeForPostgres(str: string): string { |
| 25 | // Remove null bytes which cause "invalid byte sequence for encoding UTF8: 0x00" |
| 26 | // Using String.fromCharCode(0) to avoid linter warnings about control characters in regex |
| 27 | return str.split(String.fromCharCode(0)).join(''); |
| 28 | } |
| 29 | |
| 30 | export interface EngineConfig { |
| 31 | keepTopNPerModuleWindow: number; // e.g. 5 |