mybase 1.1.37 → 1.1.38

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mybase",
3
- "version": "1.1.37",
3
+ "version": "1.1.38",
4
4
  "description": "",
5
5
  "main": "mybase.js",
6
6
  "scripts": {
@@ -15,4 +15,8 @@ export declare class Timespan {
15
15
  static days(days: number): Timespan;
16
16
  static weeks(weeks: number): Timespan;
17
17
  static months(months: number): Timespan;
18
+ toJSON(): {
19
+ __type: string;
20
+ value: number;
21
+ };
18
22
  }
@@ -47,6 +47,12 @@ class Timespan {
47
47
  static months(months) {
48
48
  return new Timespan(months * 30 * 24 * 60 * 60 * 1000);
49
49
  }
50
+ toJSON() {
51
+ return {
52
+ __type: 'Timespan',
53
+ value: this.ms
54
+ };
55
+ }
50
56
  }
51
57
  exports.Timespan = Timespan;
52
58
  //# sourceMappingURL=Timespan.js.map
@@ -59,5 +59,10 @@ export class Timespan {
59
59
  }
60
60
 
61
61
 
62
-
62
+ toJSON() {
63
+ return {
64
+ __type:'Timespan',
65
+ value:this.ms
66
+ }
67
+ }
63
68
  }
@@ -8,6 +8,10 @@ export declare class Unixtime {
8
8
  isEmpty(): boolean;
9
9
  lessThan(other: Unixtime): boolean;
10
10
  get elapsed(): Timespan;
11
+ toJSON(): {
12
+ __type: string;
13
+ value: number;
14
+ };
11
15
  constructor(value: Date | string | number);
12
16
  addTimespan(timespan: Timespan): Unixtime;
13
17
  subtractTimespan(timespan: Timespan): Unixtime;
@@ -22,6 +22,12 @@ class Unixtime {
22
22
  get elapsed() {
23
23
  return new Timespan_1.Timespan(Date.now() - this.toLongUnixtime());
24
24
  }
25
+ toJSON() {
26
+ return {
27
+ __type: 'Unixtime',
28
+ value: this.toLongUnixtime()
29
+ };
30
+ }
25
31
  constructor(value) {
26
32
  if (typeof value === 'string') {
27
33
  this.value = new Date(value);
@@ -31,6 +31,13 @@ export class Unixtime {
31
31
  return new Timespan(Date.now() - this.toLongUnixtime())
32
32
  }
33
33
 
34
+ toJSON() {
35
+ return {
36
+ __type:'Unixtime',
37
+ value:this.toLongUnixtime()
38
+ }
39
+ }
40
+
34
41
 
35
42
  constructor(value: Date | string | number) {
36
43
  if (typeof value === 'string') {