UNPKG

338 BJavaScriptView Raw
1// @flow strict-local
2
3import type {FilePath} from '@parcel/types';
4import path from 'path';
5
6const COMMON_SEPARATORS = ['/', '\\'];
7
8export function normalizeSeparators(filePath: FilePath): FilePath {
9 let ret = filePath;
10
11 for (let separator of COMMON_SEPARATORS) {
12 ret = ret.split(separator).join(path.sep);
13 }
14
15 return ret;
16}