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

Function normalizeSlashes

test/fixtures/snapshot/typescript.js:7866–7873  ·  view source on GitHub ↗

* Normalize path separators, converting `\` into `/`.

(path)

Source from the content-addressed store, hash-verified

7864 * Normalize path separators, converting `\` into `/`.
7865 */
7866 function normalizeSlashes(path) {
7867 var index = path.indexOf("\\");
7868 if (index === -1) {
7869 return path;
7870 }
7871 backslashRegExp.lastIndex = index; // prime regex with known position
7872 return path.replace(backslashRegExp, ts.directorySeparator);
7873 }
7874 ts.normalizeSlashes = normalizeSlashes;
7875 /**
7876 * Reduce an array of path components to a more simplified path by navigating any

Callers 5

getDirectoryPathFunction · 0.85
getBaseFileNameFunction · 0.85
combinePathsFunction · 0.85
resolvePathFunction · 0.85
normalizePathFunction · 0.85

Calls 1

indexOfMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…