* Synchronously renames file at `oldPath` to * the pathname provided as `newPath`. * @param {string | Buffer | URL} oldPath * @param {string | Buffer | URL} newPath * @returns {void}
(oldPath, newPath)
| 1240 | * @returns {void} |
| 1241 | */ |
| 1242 | function renameSync(oldPath, newPath) { |
| 1243 | const h = vfsState.handlers; |
| 1244 | if (h !== null) { |
| 1245 | const result = h.renameSync(oldPath, newPath); |
| 1246 | if (result !== undefined) return; |
| 1247 | } |
| 1248 | binding.rename( |
| 1249 | getValidatedPath(oldPath, 'oldPath'), |
| 1250 | getValidatedPath(newPath, 'newPath'), |
| 1251 | ); |
| 1252 | } |
| 1253 | |
| 1254 | /** |
| 1255 | * Truncates the file. |
no test coverage detected
searching dependent graphs…