Files
30-seconds-of-code/node_modules/gatsby-core-utils/dist/path.js
2019-08-20 15:52:05 +02:00

22 lines
359 B
JavaScript

"use strict";
exports.__esModule = true;
exports.joinPath = joinPath;
const path = require(`path`);
const os = require(`os`);
/**
* @type {import('../index').joinPath}
*/
function joinPath(...paths) {
const joinedPath = path.join(...paths);
if (os.platform() === `win32`) {
return joinedPath.replace(/\\/g, `\\\\`);
}
return joinedPath;
}