node
node copied to clipboard
fs: normalize cpSync and related methods to accept Buffer and URL paths (#58634)
This patch ensures that fs.cpSync and copyDir handle Buffer and URL types for the src and dest arguments by normalizing them to string paths using toString() and fileURLToPath() respectively.
Previously, these inputs would cause type errors when passed to path.join(), as the implementation assumed string paths.
Fixes: #58634