MCPcopy Index your code
hub / github.com/nodejs/node / escapeSnapshotKey

Function escapeSnapshotKey

lib/internal/test_runner/snapshot.js:294–299  ·  view source on GitHub ↗
(str)

Source from the content-addressed store, hash-verified

292}
293
294function escapeSnapshotKey(str) {
295 let result = StringPrototypeSlice(JSONStringify(str, null, 2), 1, -1);
296 result = StringPrototypeReplaceAll(result, '`', '\\`');
297 result = StringPrototypeReplaceAll(result, '${', '\\${');
298 return result;
299}
300
301function templateEscape(str) {
302 let result = String(str);

Callers 1

setSnapshotMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected