瀏覽代碼

fix(api): fs/exists return type previously set to void when it should be boolean (#5252)

Rafael Keramidas 2 年之前
父節點
當前提交
ca3cd8b3d1
共有 2 個文件被更改,包括 6 次插入1 次删除
  1. 5 0
      .changes/api-fs-exists-return-type.md
  2. 1 1
      tooling/api/src/fs.ts

+ 5 - 0
.changes/api-fs-exists-return-type.md

@@ -0,0 +1,5 @@
+---
+"api": patch
+---
+
+Fix incorrect return type on `fs/exists`

+ 1 - 1
tooling/api/src/fs.ts

@@ -569,7 +569,7 @@ async function renameFile(
  *
  * @since 1.1.0
  */
-async function exists(path: string, options: FsOptions = {}): Promise<void> {
+async function exists(path: string, options: FsOptions = {}): Promise<boolean> {
   return invokeTauriCommand({
     __tauriModule: 'Fs',
     message: {