1 | /**
|
2 | Convert Windows backslash paths to slash paths: `foo\\bar` ➔ `foo/bar`.
|
3 |
|
4 | [Forward-slash paths can be used in Windows](http://superuser.com/a/176395/6877) as long as they're not extended-length paths.
|
5 |
|
6 | @param path - A Windows backslash path.
|
7 | @returns A path with forward slashes.
|
8 |
|
9 | @example
|
10 | ```
|
11 | import path from 'node:path';
|
12 | import slash from 'slash';
|
13 |
|
14 | const string = path.join('foo', 'bar');
|
15 | // Unix => foo/bar
|
16 | // Windows => foo\\bar
|
17 |
|
18 | slash(string);
|
19 | // Unix => foo/bar
|
20 | // Windows => foo/bar
|
21 | ```
|
22 | */
|
23 | export default function slash(path: string): string;
|