-- Returns the common parts of the given paths or {} if no
-- common parts were found.

function Path:_commonParts(...: string)
	local common_parts: Array<string> = {}
	local paths: Array<string> = { ... }
	local split_paths = {}
	for _, path in ipairs(paths) do
		table.insert(split_paths, self:_splitBySeparators(path))
	end
	for part_i = 1, #split_paths[1] do
		local test_part = split_paths[1][part_i]
		for path_i = 2, #split_paths do
			local part = split_paths[path_i][part_i]
			if not self:pathsEqual(test_part, part) then
				return common_parts
			end
		end
		table.insert(common_parts, test_part)
	end
	return common_parts
end
