mirror of
https://github.com/appium/appium.git
synced 2026-10-18 13:41:26 +08:00
14 lines
457 B
TypeScript
14 lines
457 B
TypeScript
import path from 'node:path';
|
|
|
|
/**
|
|
* Computes a relative path, prepending `./`
|
|
*/
|
|
export function relative(from: string): (to: string) => string;
|
|
export function relative(from: string, to: string): string;
|
|
export function relative(from: string, to?: string): string | ((to: string) => string) {
|
|
if (to === undefined) {
|
|
return (nextTo: string) => `.${path.sep}${path.relative(from, nextTo)}`;
|
|
}
|
|
return `.${path.sep}${path.relative(from, to)}`;
|
|
}
|