Skip to content

Commit aa08069

Browse files
fix(core): fix incorrect isTauri return type (#9618)
1 parent 1bb87a3 commit aa08069

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

.changes/api-isTauri-type.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@tauri-apps/api": "patch:bug"
3+
---
4+
5+
Fix `isTauri` incorrect return type.

tooling/api/src/core.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,8 +238,8 @@ export class Resource {
238238
}
239239
}
240240

241-
function isTauri() {
242-
return 'isTauri' in window && window.isTauri
241+
function isTauri(): boolean {
242+
return 'isTauri' in window && !!window.isTauri
243243
}
244244

245245
export type { InvokeArgs, InvokeOptions }

0 commit comments

Comments
 (0)