url-vir - v2.1.6
    Preparing search index...

    Function joinUrlPaths

    • Joins all given arguments together as if they were paths of a URL. Preserves trailing slashes and removes consecutive slashes in the path. For more complex URL building, use buildUrl.

      Parameters

      • ...urlParts: readonly string[]

      Returns string

      import {joinUrlPaths} from 'url-vir';

      joinUrlPaths('https://example.com', 'path1', 'path2/', '/path3/');
      // `'https://example.com/path1/path2/path3/'`