Skip to content

Commit 1bb6f1d

Browse files
committed
Remove Path.normalize
1 parent c5a24a5 commit 1bb6f1d

File tree

3 files changed

+1
-28
lines changed

3 files changed

+1
-28
lines changed

modules/createRouter.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ function createRouter(options) {
172172
makePath: function (to, params, query) {
173173
var path;
174174
if (Path.isAbsolute(to)) {
175-
path = Path.normalize(to);
175+
path = to;
176176
} else {
177177
var route = (to instanceof Route) ? to : Route.findRouteByName(this.routes, to);
178178

modules/utils/Path.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -145,13 +145,6 @@ var Path = {
145145
return path.charAt(0) === '/';
146146
},
147147

148-
/**
149-
* Returns a normalized version of the given path.
150-
*/
151-
normalize: function (path, parentRoute) {
152-
return path.replace(/^\/*/, '/');
153-
},
154-
155148
/**
156149
* Joins two URL paths together.
157150
*/

modules/utils/__tests__/Path-test.js

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -319,23 +319,3 @@ describe('Path.withQuery', function () {
319319
expect(Path.withQuery('/path?a=b', { c: [ 'd', 'e' ] })).toEqual('/path?a=b&c=d&c=e');
320320
});
321321
});
322-
323-
describe('Path.normalize', function () {
324-
describe('on a path with no slashes at the beginning', function () {
325-
it('adds a slash', function () {
326-
expect(Path.normalize('a/b/c')).toEqual('/a/b/c');
327-
});
328-
});
329-
330-
describe('on a path with a single slash at the beginning', function () {
331-
it('preserves the slash', function () {
332-
expect(Path.normalize('/a/b/c')).toEqual('/a/b/c');
333-
});
334-
});
335-
336-
describe('on a path with many slashes at the beginning', function () {
337-
it('reduces them to a single slash', function () {
338-
expect(Path.normalize('//a/b/c')).toEqual('/a/b/c');
339-
});
340-
});
341-
});

0 commit comments

Comments
 (0)