mirror of
https://github.com/zhigang1992/now-deployment.git
synced 2026-04-21 02:16:42 +08:00
12 lines
250 B
TypeScript
12 lines
250 B
TypeScript
import { relative as nativeRelative } from 'path';
|
|
|
|
const isWin = process.platform === 'win32';
|
|
|
|
export function relative(a: string, b: string): string {
|
|
let p = nativeRelative(a, b);
|
|
if (isWin) {
|
|
p = p.replace(/\\/g, '/');
|
|
}
|
|
return p;
|
|
}
|