MCPcopy Index your code
hub / github.com/callstack/agent-device / toRelativePath

Function toRelativePath

src/utils/output.ts:564–571  ·  view source on GitHub ↗
(filePath: string)

Source from the content-addressed store, hash-verified

562}
563
564function toRelativePath(filePath: string): string {
565 const cwd = process.cwd();
566 const relativePath = path.relative(cwd, filePath);
567 if (relativePath === '' || (!relativePath.startsWith('..') && !path.isAbsolute(relativePath))) {
568 return relativePath === '' ? '.' : `.${path.sep}${relativePath}`;
569 }
570 return filePath;
571}
572
573function toNumber(value: unknown): number {
574 return typeof value === 'number' && Number.isFinite(value) ? value : 0;

Callers 1

Calls 1

startsWithMethod · 0.80

Tested by

no test coverage detected