mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-29 07:04:09 +08:00
existsSync and the fs.promises functions accept a file: URL wherever they accept a path. They convert it after their arguments are evaluated, and a URL that does not convert gives false from existsSync and a promise rejected with fileURLToPath's error from fs.promises, as in Node. copyFileSync and renameSync check a string source for null bytes before they convert a URL destination, and readFileSync checks a runtime encoding before it converts a URL path, so the error Node reports first is the one thrown. Refs #1616 Co-authored-by: jlucaso1 <55464917+jlucaso1@users.noreply.github.com>