text: 
  module.exports = function makeRelative(currentDir, absolutePath) {
  
    const dirParts = currentDir.split('/');
    const fileParts = absolutePath.split('/');
    const newParts = [];
    let diverged = false;
  
    for (let i=0; i<fileParts.length; i++) {
      if (fileParts[i] === dirParts[i] && !diverged) continue;
      if (!diverged && i < dirParts.length) {
        for (let j=i; j<dirParts.length; j++) {
          newParts.unshift('..');
        }
  
      }
  
      newParts.push(fileParts[i]);
      diverged = true;
    }
  
    const retPath = newParts.join('/');
    return ((retPath.indexOf('../')>=0) ? '': './') + retPath;
  };
  