File tree 2 files changed +13
-14
lines changed 2 files changed +13
-14
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ import {
27
27
goOffline
28
28
} from '../exp/Database' ;
29
29
import { ref , refFromURL } from '../exp/Reference_impl' ;
30
+ import { increment , serverTimestamp } from '../exp/ServerValue' ;
30
31
31
32
import { Reference } from './Reference' ;
32
33
@@ -35,16 +36,8 @@ import { Reference } from './Reference';
35
36
*/
36
37
export class Database implements FirebaseService , Compat < ExpDatabase > {
37
38
static readonly ServerValue = {
38
- TIMESTAMP : {
39
- '.sv' : 'timestamp'
40
- } ,
41
- increment : ( delta : number ) => {
42
- return {
43
- '.sv' : {
44
- 'increment' : delta
45
- }
46
- } ;
47
- }
39
+ TIMESTAMP : serverTimestamp ( ) ,
40
+ increment : ( delta : number ) => increment ( delta )
48
41
} ;
49
42
50
43
/**
Original file line number Diff line number Diff line change 15
15
* limitations under the License.
16
16
*/
17
17
18
+ const SERVER_TIMESTAMP = {
19
+ '.sv' : 'timestamp'
20
+ } ;
21
+
18
22
export function serverTimestamp ( ) : object {
19
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
20
- return { } as any ;
23
+ return SERVER_TIMESTAMP ;
21
24
}
22
25
23
26
export function increment ( delta : number ) : object {
24
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
25
- return { } as any ;
27
+ return {
28
+ '.sv' : {
29
+ 'increment' : delta
30
+ }
31
+ } ;
26
32
}
You can’t perform that action at this time.
0 commit comments