1247
return '';
1248
}
1250
>
// Trim leading forward slashes.
1251
>
from = posix.resolve(from);
1252
>
to = posix.resolve(to);
1253
>
1254
>
if (from === to) {
1255
return '';
1256
}
1258
>
const fromStart = 1;
1259
>
const fromEnd = from.length;
1260
>
const fromLen = fromEnd - fromStart;
1261
>
const toStart = 1;
1262
>
const toLen = to.length - toStart;
1263
>
1264
>
// Compare paths to find the longest common path from root
1265
const length = (fromLen < toLen ? fromLen : toLen);
1266
let lastCommonSep = -1;