Skip to content

Commit b1f409c

Browse files
committed
fix thing i definitely didn't just break
1 parent 1654449 commit b1f409c

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -990,15 +990,14 @@ function get_parent_context(component_context) {
990990
* @returns {T}
991991
*/
992992
export function update(signal, d = 1) {
993-
//@ts-ignore
994-
var value = +get(signal);
993+
var value = get(signal);
995994

996995
if(typeof value === "bigint") {
997996
//@ts-ignore
998997
set(signal, value + BigInt(d));
999998
}else {
1000999
//@ts-ignore
1001-
set(signal, value + d);
1000+
set(signal, +value + d);
10021001
}
10031002
//@ts-ignore
10041003
return value;
@@ -1011,12 +1010,14 @@ export function update(signal, d = 1) {
10111010
* @returns {T}
10121011
*/
10131012
export function update_pre(signal, d = 1) {
1014-
//@ts-ignore
1015-
var value = +get(signal);
1013+
var value = get(signal);
10161014

10171015
if(typeof value === "bigint") {
10181016
//@ts-ignore
10191017
d = BigInt(d);
1018+
}else{
1019+
//@ts-ignore
1020+
value = +value;
10201021
}
10211022
//@ts-ignore
10221023
return set(signal, value + d);

0 commit comments

Comments
 (0)