mirror of
https://github.com/n8n-io/n8n.git
synced 2026-06-01 17:27:14 +02:00
18 lines
407 B
TypeScript
18 lines
407 B
TypeScript
/**
|
|
* Provides syntax highlighting for embedded SQL queries in template strings.
|
|
*/
|
|
export function sql(strings: TemplateStringsArray, ...values: string[]): string {
|
|
let result = '';
|
|
|
|
// Interleave the strings with the values
|
|
for (let i = 0; i < values.length; i++) {
|
|
result += strings[i];
|
|
result += values[i];
|
|
}
|
|
|
|
// Add the last string
|
|
result += strings[strings.length - 1];
|
|
|
|
return result;
|
|
}
|