From aa080696e0952abff416dd9088d519eaf2587a3a Mon Sep 17 00:00:00 2001 From: Zihan Hu Date: Wed, 1 May 2024 00:03:49 +0800 Subject: [PATCH] fix(core): fix incorrect `isTauri` return type (#9618) --- .changes/api-isTauri-type.md | 5 +++++ tooling/api/src/core.ts | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 .changes/api-isTauri-type.md diff --git a/.changes/api-isTauri-type.md b/.changes/api-isTauri-type.md new file mode 100644 index 000000000..22422f0c6 --- /dev/null +++ b/.changes/api-isTauri-type.md @@ -0,0 +1,5 @@ +--- +"@tauri-apps/api": "patch:bug" +--- + +Fix `isTauri` incorrect return type. \ No newline at end of file diff --git a/tooling/api/src/core.ts b/tooling/api/src/core.ts index e6a92e2a3..9beca856d 100644 --- a/tooling/api/src/core.ts +++ b/tooling/api/src/core.ts @@ -238,8 +238,8 @@ export class Resource { } } -function isTauri() { - return 'isTauri' in window && window.isTauri +function isTauri(): boolean { + return 'isTauri' in window && !!window.isTauri } export type { InvokeArgs, InvokeOptions }