UNPKG

@planjs/utils

Version:

🔧 Common tools collection

15 lines (12 loc) 279 B
/** * 接受Windows反斜杠路径,并返回带有正斜杠的路径 * @param path */ function slash(path) { var isExtendedLengthPath = /^\\\\\?\\/.test(path); if (isExtendedLengthPath) { return path; } return path.replace(/\\/g, '/'); } export default slash;