Repository: withastro/astro
File: packages/integrations/netlify/src/index.ts (TypeScript)

Code before:
		}

		const fallback = finalBuildOutput === 'static' ? '/.netlify/static' : '/.netlify/functions/ssr';
		const redirects = createRedirectsFromAstroRoutes({
			config: _config,
			dir,
			routeToDynamicTargetMap: new Map(staticRedirects.map((route) => [route, fallback])),
			buildOutput,
			assets,
		});

		if (!redirects.empty()) {
			await appendFile(new URL('_redirects', outDir), `\n${redirects.print()}\n`);
		}
	}

	async function getFilesByGlob(
		include: Array<string> = [],
		exclude: Array<string> = [],
	): Promise<Array<URL>> {
		const files = await glob(include, {
			cwd: fileURLToPath(rootDir),
			absolute: true,
			ignore: exclude,
		});
		return files.map((file) => new URL(pathToFileURL(file)));
	}

	async function writeSSRFunction({
		notFoundContent,
		logger,
		root,
	}: {
		notFoundContent?: string;
		logger: AstroIntegrationLogger;
		root: URL;
	}) {
		const entry = new URL('./entry.mjs', ssrBuildDir());

		const _includeFiles = integrationConfig?.includeFiles || [];
		const _excludeFiles = integrationConfig?.excludeFiles || [];

		if (finalBuildOutput === 'server') {
			// Merge any includes from `vite.assetsInclude
			if (_config.vite.assetsInclude) {
				const mergeGlobbedIncludes = (globPattern: unknown) => {
					if (typeof globPattern === 'string') {
						const entries = glob.sync(globPattern).map((p) => pathToFileURL(p));
						extraFilesToInclude.push(...entries);
					} else if (Array.isArray(globPattern)) {
						for (const pattern of globPattern) {

Review comment (suggestion):
```suggestion
		return files.map((file) => pathToFileURL(file));
```
`pathToFileURL` already return a URL object

Code after:
		}

		const fallback = finalBuildOutput === 'static' ? '/.netlify/static' : '/.netlify/functions/ssr';
		const redirects = createRedirectsFromAstroRoutes({
			config: _config,
			dir,
			routeToDynamicTargetMap: new Map(staticRedirects.map((route) => [route, fallback])),
			buildOutput,
			assets,
		});

		if (!redirects.empty()) {
			await appendFile(new URL('_redirects', outDir), `\n${redirects.print()}\n`);
		}
	}

	async function getFilesByGlob(
		include: Array<string> = [],
		exclude: Array<string> = [],
	): Promise<Array<URL>> {
		const files = await glob(include, {
			cwd: fileURLToPath(rootDir),
			absolute: true,
			ignore: exclude,
		});
		return files.map((file) => pathToFileURL(file));
	}

	async function writeSSRFunction({
		notFoundContent,
		logger,
		root,
	}: {
		notFoundContent?: string;
		logger: AstroIntegrationLogger;
		root: URL;
	}) {
		const entry = new URL('./entry.mjs', ssrBuildDir());

		const _includeFiles = integrationConfig?.includeFiles || [];
		const _excludeFiles = integrationConfig?.excludeFiles || [];

		if (finalBuildOutput === 'server') {
			// Merge any includes from `vite.assetsInclude
			if (_config.vite.assetsInclude) {
				const mergeGlobbedIncludes = (globPattern: unknown) => {
					if (typeof globPattern === 'string') {
						const entries = glob.sync(globPattern).map((p) => pathToFileURL(p));
						extraFilesToInclude.push(...entries);
					} else if (Array.isArray(globPattern)) {
						for (const pattern of globPattern) {