Gitter migration: Setup redirects (rollout pt. 3)
[gitter.git] / modules / uri-resolver / lib / normalise-uri.js
blobcceb8a6d9f046b6fd78c140e9563c08afa4398f9
1 'use strict';
3 function toParts(uri) {
4 if (!uri) return [];
6 var parts = uri.split('/');
8 var i;
9 for (i = parts.length; i >= 1 && !parts[i - 1]; i--);
10 parts.length = i;
12 return parts;
15 function toPath(uri) {
16 return toParts(uri).join('/');
19 module.exports = {
20 toParts: toParts,
21 toPath: toPath