File tree 1 file changed +8
-2
lines changed
packages/svelte/src/reactivity
1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 1
1
import { source } from '../internal/client/reactivity/sources' ;
2
2
import { get , set } from '../internal/client/runtime' ;
3
3
4
+ /** @type {Array<keyof Date> } */
4
5
const read = [
5
6
'getDate' ,
6
7
'getDay' ,
@@ -20,18 +21,20 @@ const read = [
20
21
'getUTCMinutes' ,
21
22
'getUTCMonth' ,
22
23
'getUTCSeconds' ,
24
+ // @ts -expect-error this is deprecated
23
25
'getYear' ,
24
26
'toDateString' ,
25
27
'toISOString' ,
26
28
'toJSON' ,
27
29
'toLocaleDateString' ,
28
- 'toLocalString ' ,
29
- 'toLocalTimeString ' ,
30
+ 'toLocaleString ' ,
31
+ 'toLocaleTimeString ' ,
30
32
'toString' ,
31
33
'toTimeString' ,
32
34
'toUTCString'
33
35
] ;
34
36
37
+ /** @type {Array<keyof Date> } */
35
38
const write = [
36
39
'setDate' ,
37
40
'setFullYear' ,
@@ -48,6 +51,7 @@ const write = [
48
51
'setUTCMinutes' ,
49
52
'setUTCMonth' ,
50
53
'setUTCSeconds' ,
54
+ // @ts -expect-error this is deprecated
51
55
'setYear'
52
56
] ;
53
57
@@ -61,6 +65,7 @@ class ReactiveDate extends Date {
61
65
ReactiveDate . #inited = true ;
62
66
const proto = ReactiveDate . prototype ;
63
67
const date_proto = Date . prototype ;
68
+
64
69
for ( const method of read ) {
65
70
// @ts -ignore
66
71
proto [ method ] = function ( ) {
@@ -69,6 +74,7 @@ class ReactiveDate extends Date {
69
74
return date_proto [ method ] . call ( this ) ;
70
75
} ;
71
76
}
77
+
72
78
for ( const method of write ) {
73
79
// @ts -ignore
74
80
proto [ method ] = function ( /** @type {any } */ ...args ) {
You can’t perform that action at this time.
0 commit comments