Skip to content

Commit 56de55b

Browse files
authored
fix: improve unstate type definition (#9895)
* fix: improve unstate type definition * tweak * tweak
1 parent daa1917 commit 56de55b

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

.changeset/purple-dragons-peel.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'svelte': patch
3+
---
4+
5+
fix: improve unstate type definition

packages/svelte/src/internal/client/proxy/proxy.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,12 +100,12 @@ function unwrap(value, already_unwrapped = new Map()) {
100100
}
101101

102102
/**
103-
* @template {StateObject} T
103+
* @template T
104104
* @param {T} value
105-
* @returns {Record<string | symbol, any>}
105+
* @returns {T}
106106
*/
107107
export function unstate(value) {
108-
return unwrap(value);
108+
return /** @type {T} */ (unwrap(/** @type {StateObject} */ (value)));
109109
}
110110

111111
/**

0 commit comments

Comments
 (0)