Projekt

Obecné

Profil

Stáhnout (442 Bajtů) Statistiky
| Větev: | Revize:
1
"use strict";
2

    
3
var path = require("path");
4

    
5
module.exports = function relative(sourceRoot, filename) {
6
  var rootPath = sourceRoot.replace(/\\/g, "/").split("/")[1];
7
  var fileRootPath = filename.replace(/\\/g, "/").split("/")[1];
8

    
9
  // If the file is in a completely different root folder use the absolute path of file.
10
  if (rootPath && rootPath !== fileRootPath) {
11
    return filename;
12
  }
13

    
14
  return path.relative(sourceRoot, filename);
15
};
(3-3/3)