Untitled
user_1095306
plain_text
2 years ago
643 B
8
Indexable
public static relativePath(fromPath: string, toPath: string): string {
if (CSSPluginUtilities.startsWith(toPath, '/') || CSSPluginUtilities.startsWith(toPath, 'http://') || CSSPluginUtilities.startsWith(toPath, 'https://')) {
return toPath;
}
// Ignore common folder prefix
const prefix = CSSPluginUtilities.commonFolderPrefix(fromPath, toPath);
fromPath = fromPath.substr(prefix.length);
toPath = toPath.substr(prefix.length);
const upCount = fromPath.split('/').length;
let result = '';
for (let i = 1; i < upCount; i++) {
result += '../';
}
return result + toPath;
}as of now this is i found
Editor is loading...