Skip to content

Commit 6f2794a

Browse files
committed
Fix a couple of code issues raised by sonarcloud
1 parent 2fef5ed commit 6f2794a

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/clauses/Clause.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ export abstract class Clause extends CypherASTNode {
109109
throw new Error(`Cannot build root: ${root.constructor.name}`);
110110
}
111111

112-
private getEnv(prefix?: string, config: BuildConfig = {}): CypherEnvironment {
112+
private getEnv(prefix: string | undefined, config: BuildConfig): CypherEnvironment {
113113
return new CypherEnvironment(prefix, config);
114114
}
115115

src/utils/escape.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ function escapeString(str: string): string {
6666
}
6767

6868
function normalizeString(str: string): string {
69-
return str.replaceAll(/\\u0060/g, "`");
69+
return str.replaceAll("\\u0060", "`");
7070
}
7171

7272
function needsEscape(str: string): boolean {

src/utils/pad-block.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@
1919

2020
export function padBlock(block: string, spaces = 4): string {
2121
const paddingStr = " ".repeat(spaces);
22-
const paddedNewLines = block.replaceAll(/\n/g, `\n${paddingStr}`);
22+
const paddedNewLines = block.replaceAll("\n", `\n${paddingStr}`);
2323
return `${paddingStr}${paddedNewLines}`;
2424
}

0 commit comments

Comments
 (0)