MCPcopy
hub / github.com/jestjs/jest / escapeBacktickString

Function escapeBacktickString

packages/jest-snapshot-utils/src/utils.ts:167–168  ·  view source on GitHub ↗
(str: string)

Source from the content-addressed store, hash-verified

165};
166
167export const escapeBacktickString = (str: string): string =>
168 str.replaceAll(/`|\\|\${/g, '\\$&');
169
170const printBacktickString = (str: string): string =>
171 `\`${escapeBacktickString(str)}\``;

Callers 3

printSnapshotNameFunction · 0.90
traverseAstFunction · 0.90
printBacktickStringFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected