Debian Codegraph @

path2/posix/join.js

raw
1 'use strict';
2
3 var normalize = require('./normalize');
4
5 module.exports = function () {
6 var path = '', i, segment;
7 for (i = 0; i < arguments.length; i++) {
8 segment = arguments[i];
9 if (typeof segment !== 'string') {
10 throw new TypeError('Arguments to path.join must be strings');
11 }
12 if (segment) {
13 if (!path) {
14 path += segment;
15 } else {
16 path += '/' + segment;
17 }
18 }
19 }
20 return normalize(path);
21 };