3a6869e380bb29e846f5815e60503f51148c7b88
[platform/framework/web/crosswalk-tizen.git] /
1 define(['../array/join', '../array/slice'], function(join, slice){
2
3     /**
4      * Group arguments as path segments, if any of the args is `null` or an
5      * empty string it will be ignored from resulting path.
6      */
7     function makePath(var_args){
8         var result = join(slice(arguments), '/');
9         // need to disconsider duplicate '/' after protocol (eg: 'http://')
10         return result.replace(/([^:\/]|^)\/{2,}/g, '$1/');
11     }
12
13     return makePath;
14 });