mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 18:55:26 +00:00
27 lines
544 B
JavaScript
27 lines
544 B
JavaScript
(function(global) {
|
|
'use strict';
|
|
|
|
var PREFIX = '/join';
|
|
|
|
if (typeof module === 'object' && module.exports)
|
|
module.exports = join;
|
|
else
|
|
global.join = join;
|
|
|
|
function join(prefix, names) {
|
|
var url;
|
|
|
|
if (!names) {
|
|
names = prefix;
|
|
prefix = PREFIX;
|
|
}
|
|
|
|
if (!names)
|
|
throw(Error('names must be array!'));
|
|
|
|
url = prefix + ':' + names.join(':');
|
|
|
|
return url;
|
|
}
|
|
|
|
})(this);
|