code: function pathJoin(...args) {
      return args
          .reduce((prev, val) => {
          if (typeof prev === "undefined") {
              return;
          }
          if (val === undefined) {
              return prev;
          }
          return typeof val === "string" || typeof val === "number"
              ? joinStringsWithSlash(prev, "" + val) // if string or number just keep as is
              : Array.isArray(val)
                  ? joinStringsWithSlash(prev, pathJoin.apply(null, val)) // handle array with recursion
                  : console.error(errorStr(typeof val));
      }, "")
          .replace(moreThanThreePeriods, ".."); // join the resulting array together
  }
docs: An ISO-morphic path join that works everywhere