Last change
on this file since 76712b2 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
621 bytes
|
Line | |
---|
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 and don't contain any non-ascii characters.
|
---|
5 |
|
---|
6 | @param path - A Windows backslash path.
|
---|
7 | @returns A path with forward slashes.
|
---|
8 |
|
---|
9 | @example
|
---|
10 | ```
|
---|
11 | import * as path from 'path';
|
---|
12 | import slash = require('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 | declare function slash(path: string): string;
|
---|
24 |
|
---|
25 | export = slash;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.