/**
 * @license Copyright (c) 2017-2025, CKSource Holding sp. z o.o. All rights reserved.
 * For licensing, see LICENSE.md.
 */

'use strict';

const dropInitSlash = require( './drop-init-slash' );
const dropTrailingSlash = require( './drop-trailing-slash' );
const pipe = require( './pipe' );

module.exports = function concatUrlParts( ...urls ) {
	return (
		urls
			.filter( Boolean )
			.map( pipe( dropTrailingSlash, dropInitSlash ) )
			.join( '/' )
	);
};
