MCPcopy
hub / github.com/vercel/hyper / normalizeDirectoryPath

Function normalizeDirectoryPath

bin/yarn-standalone.js:105732–105740  ·  view source on GitHub ↗
(fsPath)

Source from the content-addressed store, hash-verified

105730 };
105731
105732 const normalizeDirectoryPath = function normalizeDirectoryPath(fsPath) {
105733 let relativePath = normalizePath(path.relative(targetDirectory, resolveOfflineCacheFolder(fsPath)));
105734
105735 if (!relativePath.match(/^\.{0,2}\//) && !path.isAbsolute(relativePath)) {
105736 relativePath = `./${relativePath}`;
105737 }
105738
105739 return relativePath.replace(/\/?$/, '/');
105740 };
105741
105742 const getHashFrom = function getHashFrom(data) {
105743 const hashGenerator = crypto.createHash('sha1');

Callers 1

yarn-standalone.jsFile · 0.85

Calls 3

normalizePathFunction · 0.85
matchMethod · 0.80

Tested by

no test coverage detected