MCPcopy Create free account
hub / github.com/apache/maka / trimTrailingPathSeparators

Function trimTrailingPathSeparators

packages/core/src/absolute-path.ts:51–54  ·  view source on GitHub ↗
(value: string)

Source from the content-addressed store, hash-verified

49}
50
51export function trimTrailingPathSeparators(value: string): string {
52 if (value === '/' || /^[A-Za-z]:\\$/.test(value)) return value;
53 return isWindowsDrivePath(value) ? value.replace(/\\+$/g, '') : value.replace(/\/+$/g, '');
54}
55
56function comparablePath(value: string): string {
57 const trimmed = trimTrailingPathSeparators(value);

Callers 4

comparablePathFunction · 0.85
trimTrailingSlashesFunction · 0.85
trimTrailingSlashesFunction · 0.85
trimTrailingSlashesFunction · 0.85

Calls 3

isWindowsDrivePathFunction · 0.85
replaceMethod · 0.80
testMethod · 0.65

Tested by

no test coverage detected