mirror of
https://github.com/denoland/deno.git
synced 2025-09-27 04:39:10 +00:00
feat(runtime): support URL overloads for Deno.rename/Deno.renameSync (#10512)
This commit is contained in:
parent
844a1317ec
commit
dc69b03339
3 changed files with 55 additions and 5 deletions
10
cli/dts/lib.deno.ns.d.ts
vendored
10
cli/dts/lib.deno.ns.d.ts
vendored
|
@ -1322,7 +1322,10 @@ declare namespace Deno {
|
|||
* they are. It's always an error to rename anything to a non-empty directory.
|
||||
*
|
||||
* Requires `allow-read` and `allow-write` permissions. */
|
||||
export function renameSync(oldpath: string, newpath: string): void;
|
||||
export function renameSync(
|
||||
oldpath: string | URL,
|
||||
newpath: string | URL,
|
||||
): void;
|
||||
|
||||
/** Renames (moves) `oldpath` to `newpath`. Paths may be files or directories.
|
||||
* If `newpath` already exists and is not a directory, `rename()` replaces it.
|
||||
|
@ -1339,7 +1342,10 @@ declare namespace Deno {
|
|||
* they are. It's always an error to rename anything to a non-empty directory.
|
||||
*
|
||||
* Requires `allow-read` and `allow-write` permission. */
|
||||
export function rename(oldpath: string, newpath: string): Promise<void>;
|
||||
export function rename(
|
||||
oldpath: string | URL,
|
||||
newpath: string | URL,
|
||||
): Promise<void>;
|
||||
|
||||
/** Synchronously reads and returns the entire contents of a file as utf8
|
||||
* encoded string. Reading a directory throws an error.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue