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

Function replaceWindowsPaths

test/common/assertSnapshot.js:76–83  ·  view source on GitHub ↗
(str)

Source from the content-addressed store, hash-verified

74// Replaces all Windows path separators with posix separators for unified snapshots
75// across platforms.
76function replaceWindowsPaths(str) {
77 if (!common.isWindows) {
78 return str;
79 }
80 // Only replace `\` and `\\` with a leading letter, colon, or a `.`.
81 // Avoid replacing escaping patterns like ` \#`, `\ `, or `\\`.
82 return str.replaceAll(/(?<=(\w:|\.|\w+)(?:\S|\\ )*)\\\\?/g, '/');
83}
84
85// Removes line trailing white spaces.
86function replaceTrailingSpaces(str) {

Callers 1

transformPathFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…