protected function mapCustomInstallPaths(array $paths, string $name, string $type, string $vendor = ''): string
    {
        foreach ($paths as $path => $names) {
            if (in_array($name, $names) || in_array('type:' . $type, $names)) {
                return $path;
            }

            if (!empty($vendor) && in_array('vendor:' . $vendor, $names)) {
                return $path;
            }
        }

        return '';
    }