0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-16 21:46:22 -05:00

Node 22 housekeeping (#12559)

This commit is contained in:
Chris Swithinbank 2024-12-03 00:16:53 +01:00 committed by GitHub
parent 3a76353248
commit 1dc8f5eb7c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 7 additions and 2 deletions

View file

@ -0,0 +1,5 @@
---
"@astrojs/internal-helpers": patch
---
Fixes usage of `fileURLToPath()` to anticipate the changed signature of this method in Node 22.1.0

View file

@ -45,8 +45,8 @@ export async function copyFilesToFolder(
outDir: URL, outDir: URL,
exclude: URL[] = [], exclude: URL[] = [],
): Promise<string> { ): Promise<string> {
const excludeList = exclude.map(fileURLToPath); const excludeList = exclude.map((url) => fileURLToPath(url));
const fileList = files.map(fileURLToPath).filter((f) => !excludeList.includes(f)); const fileList = files.map((url) => fileURLToPath(url)).filter((f) => !excludeList.includes(f));
if (files.length === 0) throw new Error('No files found to copy'); if (files.length === 0) throw new Error('No files found to copy');