code: function (path) {
        // Counter for '/'.
        var standardFolderSepCount = 0;
        // Counter for '\' (windows folder separator).
        var windowsFolderSepCount = 0;
        // Loops index used for parsing chars of `path`and to add `../` to the result.
        var i;
        // Current char read from `path`.
        var c;
        // Counting folders' separators.
        for (i = 0; i < path.length; i++) {
          c = path.charAt(i);
          if (c == '/') standardFolderSepCount++;
          if (c == '\\') windowsFolderSepCount++;
        }
        var folderSepCount = Math.max(standardFolderSepCount, windowsFolderSepCount);
        if (folderSepCount == 0) {
          // There is no subfolder.
          return '';
        }
  
        var result = '';
        var folderSep = '/';  // windowsFolderSepCount > standardFolderSepCount ? '\\' : '/';
        for (i = 0; i < folderSepCount; i++) {
          result += '..' + folderSep;
        }
        return result;
      }
docs: The  depth of  `path` is  the number  of subfolders  it defines.  For
  example, `foo.js'  defined no  subfolder and  it is  of depth  0. But
  `foo/bar/file.html` has two levels of subfolders hence it is of depth
  2.