From 51ba4c533036bb6016163bccee2c2514d1dbfaa1 Mon Sep 17 00:00:00 2001 From: Tony <68118705+Legend-Master@users.noreply.github.com> Date: Mon, 19 Feb 2024 20:48:22 +0800 Subject: [PATCH] fix(fs): make rename third parameter optional (#962) * Fix rename option can't be empty * change file --- .changes/fs-rename-optional-type.md | 5 +++++ plugins/fs/guest-js/index.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changes/fs-rename-optional-type.md diff --git a/.changes/fs-rename-optional-type.md b/.changes/fs-rename-optional-type.md new file mode 100644 index 00000000..48b42d6e --- /dev/null +++ b/.changes/fs-rename-optional-type.md @@ -0,0 +1,5 @@ +--- +"fs-js": patch +--- + +Make `rename` function third paramter optional as it was supposed to be. \ No newline at end of file diff --git a/plugins/fs/guest-js/index.ts b/plugins/fs/guest-js/index.ts index 793deb4e..3d9aca34 100644 --- a/plugins/fs/guest-js/index.ts +++ b/plugins/fs/guest-js/index.ts @@ -853,7 +853,7 @@ interface RenameOptions { async function rename( oldPath: string | URL, newPath: string | URL, - options: RenameOptions, + options?: RenameOptions, ): Promise { if ( (oldPath instanceof URL && oldPath.protocol !== "file:") ||