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 }