Skip to content

Commit 1d58d77

Browse files
committed
Remove escape symbol regex in favor of a string
1 parent 6f2794a commit 1d58d77

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/utils/escape.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717
* limitations under the License.
1818
*/
1919

20-
const ESCAPE_SYMBOL_REGEX = /`/g;
21-
2220
/** These names must be escaped for variables */
2321
const RESERVED_VAR_NAMES = new Set(["contains", "in", "where", "is"]);
2422

@@ -61,7 +59,7 @@ function escapeIfNeeded(str: string): string {
6159

6260
function escapeString(str: string): string {
6361
const normalizedStr = normalizeString(str);
64-
const escapedStr = normalizedStr.replaceAll(ESCAPE_SYMBOL_REGEX, "``");
62+
const escapedStr = normalizedStr.replaceAll("`", "``");
6563
return `\`${escapedStr}\``;
6664
}
6765

0 commit comments

Comments
 (0)