t-comm
Version:
专业、稳定、纯粹的工具库
23 lines (18 loc) • 514 B
JavaScript
;
Object.defineProperty(exports, '__esModule', { value: true });
var validate_validate = require('../validate/validate.js');
/**
* 格式化路径
* @param path 文件路径,或目录路径
* @returns 格式化后的路径
* @example
* ```ts
* normalizePath('xxx/xxx/xxx');
*
* normalizePath('xxx\\xxx\\xxx');
* ```
*/
var normalizePath = function normalizePath(path) {
return validate_validate.isWindows() ? path.replace(/\\/g, '/') : path;
};
exports.normalizePath = normalizePath;