|
2 | 2 |
|
3 | 3 | > Auto-generated from test results by `doc-reporter.ts`. Do not edit manually. |
4 | 4 | > |
5 | | -> **Note:** Node.js compatibility tests (200+ vectors in [`node-compat.test.ts`](../src/__tests__/node-compat.test.ts)) |
6 | | -> are excluded from this document for brevity. Those tests verify that every proxied `path` function produces identical |
7 | | -> results to Node.js built-in `path`. |
| 5 | +> **Note:** Node.js compatibility tests (200+ vectors in [`node-compat.test.ts`](../src/__tests__/node-compat.test.ts)) are excluded from this document for brevity. Those tests verify that every proxied `path` function produces identical results to Node.js built-in `path`. |
8 | 6 |
|
9 | 7 | ## `upath.addExt(filename, ext)` |
10 | 8 |
|
|
128 | 126 | | `"fileWith/defaultExt.longExt", 'js', ['min', '.dev'], 8` | `"fileWith/defaultExt.longExt"` | |
129 | 127 | | `"fileWith/defaultExt.longRext", 'js', ['min', '.dev'], 8` | `"fileWith/defaultExt.longRext.js"` | |
130 | 128 |
|
131 | | -## `upath.normalize(path)` |
132 | | - |
133 | | -| Input | Output | |
134 | | -| --------------------------------- | -------------------------- | |
135 | | -| `"c:/windows/nodejs/path"` | `"c:/windows/nodejs/path"` | |
136 | | -| `"c:/windows/../nodejs/path"` | `"c:/nodejs/path"` | |
137 | | -| `"c:\\windows\\nodejs\\path"` | `"c:/windows/nodejs/path"` | |
138 | | -| `"c:\\windows\\..\\nodejs\\path"` | `"c:/nodejs/path"` | |
139 | | -| `"/windows\\unix/mixed"` | `"/windows/unix/mixed"` | |
140 | | -| `"\\windows//unix/mixed"` | `"/windows/unix/mixed"` | |
141 | | -| `"\\windows\\..\\unix/mixed/"` | `"/unix/mixed/"` | |
142 | | - |
143 | | -## `upath.join(paths...)` |
144 | | - |
145 | | -| Input | Output | |
146 | | -| ------------------------------------ | --------------------- | |
147 | | -| `["some/nodejs/deep","../path"]` | `"some/nodejs/path"` | |
148 | | -| `["some/nodejs\\windows","../path"]` | `"some/nodejs/path"` | |
149 | | -| `["some\\windows\\only","..\\path"]` | `"some/windows/path"` | |
150 | | - |
151 | | -## `upath.toUnix(path)` |
152 | | - |
153 | | -| Input | Output | |
154 | | -| ----------------------------------- | ---------------------------- | |
155 | | -| `".//windows\\//unix/\\/mixed////"` | `"./windows/unix/mixed/"` | |
156 | | -| `"..///windows\\..\\\\unix/mixed"` | `"../windows/../unix/mixed"` | |
157 | | -| `""` | `""` | |
158 | | -| `"/"` | `"/"` | |
159 | | -| `"\\\\server\\share"` | `"//server/share"` | |
160 | | -| `"already/forward/slashes"` | `"already/forward/slashes"` | |
161 | | -| `"\\"` | `"/"` | |
162 | | -| `"////multiple///slashes"` | `"//multiple/slashes"` | |
163 | | -| `"mixed\\back//and///slashes"` | `"mixed/back/and/slashes"` | |
164 | | -| `"a\\b\\c"` | `"a/b/c"` | |
165 | | -| `"C:\\Users\\test"` | `"C:/Users/test"` | |
166 | | - |
167 | | -## `upath.isAbsolute(path) — backslash normalization` |
168 | | - |
169 | | -| Input | Output | |
170 | | -| --------------------- | ------------------------------ | |
171 | | -| `"\\foo"` | `true (backslash normalized)` | |
172 | | -| `"\\\\server\\share"` | `true (backslash normalized)` | |
173 | | -| `"foo\\bar"` | `false (backslash normalized)` | |
174 | | - |
175 | 129 | ## `upath.normalizeSafe(path)` |
176 | 130 |
|
177 | 131 | ### equal to path.normalize |
|
246 | 200 | | `["//./c:/temp/file","../path"]` | `"//./c:/temp/path"` | |
247 | 201 | | `["",""]` | `"."` | |
248 | 202 | | `["./foo","","bar"]` | `"./foo/bar"` | |
| 203 | + |
| 204 | +## `upath.normalize(path)` |
| 205 | + |
| 206 | +| Input | Output | |
| 207 | +| --------------------------------- | -------------------------- | |
| 208 | +| `"c:/windows/nodejs/path"` | `"c:/windows/nodejs/path"` | |
| 209 | +| `"c:/windows/../nodejs/path"` | `"c:/nodejs/path"` | |
| 210 | +| `"c:\\windows\\nodejs\\path"` | `"c:/windows/nodejs/path"` | |
| 211 | +| `"c:\\windows\\..\\nodejs\\path"` | `"c:/nodejs/path"` | |
| 212 | +| `"/windows\\unix/mixed"` | `"/windows/unix/mixed"` | |
| 213 | +| `"\\windows//unix/mixed"` | `"/windows/unix/mixed"` | |
| 214 | +| `"\\windows\\..\\unix/mixed/"` | `"/unix/mixed/"` | |
| 215 | + |
| 216 | +## `upath.join(paths...)` |
| 217 | + |
| 218 | +| Input | Output | |
| 219 | +| ------------------------------------ | --------------------- | |
| 220 | +| `["some/nodejs/deep","../path"]` | `"some/nodejs/path"` | |
| 221 | +| `["some/nodejs\\windows","../path"]` | `"some/nodejs/path"` | |
| 222 | +| `["some\\windows\\only","..\\path"]` | `"some/windows/path"` | |
| 223 | + |
| 224 | +## `upath.toUnix(path)` |
| 225 | + |
| 226 | +| Input | Output | |
| 227 | +| ----------------------------------- | ---------------------------- | |
| 228 | +| `".//windows\\//unix/\\/mixed////"` | `"./windows/unix/mixed/"` | |
| 229 | +| `"..///windows\\..\\\\unix/mixed"` | `"../windows/../unix/mixed"` | |
| 230 | +| `""` | `""` | |
| 231 | +| `"/"` | `"/"` | |
| 232 | +| `"\\\\server\\share"` | `"//server/share"` | |
| 233 | +| `"already/forward/slashes"` | `"already/forward/slashes"` | |
| 234 | +| `"\\"` | `"/"` | |
| 235 | +| `"////multiple///slashes"` | `"//multiple/slashes"` | |
| 236 | +| `"mixed\\back//and///slashes"` | `"mixed/back/and/slashes"` | |
| 237 | +| `"a\\b\\c"` | `"a/b/c"` | |
| 238 | +| `"C:\\Users\\test"` | `"C:/Users/test"` | |
| 239 | + |
| 240 | +## `upath.isAbsolute(path) — backslash normalization` |
| 241 | + |
| 242 | +| Input | Output | |
| 243 | +| --------------------- | ------------------------------ | |
| 244 | +| `"\\foo"` | `true (backslash normalized)` | |
| 245 | +| `"\\\\server\\share"` | `true (backslash normalized)` | |
| 246 | +| `"foo\\bar"` | `false (backslash normalized)` | |
0 commit comments