mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-05-12 19:35:30 +01:00
14 lines
358 B
TypeScript
14 lines
358 B
TypeScript
// Added return type optional undefined because passing undefined from test cases.
|
|
export function getQuotedCqlIdentifier(identifier: string | undefined): string | undefined {
|
|
let result = identifier;
|
|
if (!identifier) {
|
|
return result;
|
|
}
|
|
|
|
if (identifier.includes('"')) {
|
|
result = identifier.replace(/"/g, '""');
|
|
}
|
|
|
|
return `"${result}"`;
|
|
}
|