Converts a file system path to the current platform-specific format.
This replaces both forward slashes (/) and backslashes (\) with the platform's separator (path.sep).
/
\
path.sep
The path to convert
The path using the current OS separator.
toPlatformPath('src/utils/file.ts')// On Windows: 'src\\utils\\file.ts'// On POSIX: 'src/utils/file.ts' Copy
toPlatformPath('src/utils/file.ts')// On Windows: 'src\\utils\\file.ts'// On POSIX: 'src/utils/file.ts'
Converts a file system path to the current platform-specific format.
This replaces both forward slashes (
/) and backslashes (\) with the platform's separator (path.sep).\/