This function assumes current directory '/'. It is not possible to change it.
function toAbsolutePath(path) {
  if (typeof path !== 'string') {
    return null;
  }

  const parts = path.split('/');
  const n = normalizePath(parts);
  if (!n) {
    return null;
  }

  return `/${n.join('/')}`;
}