@agoric/time 0.3.3-u16.0 → 0.3.3-u17.0

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": "@agoric/time",
3
- "version": "0.3.3-u16.0",
3
+ "version": "0.3.3-u17.0",
4
4
  "description": "Timestamps, time math, timer service API definition",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -31,13 +31,14 @@
31
31
  },
32
32
  "homepage": "https://github.com/Agoric/agoric-sdk#readme",
33
33
  "dependencies": {
34
- "@agoric/assert": "^0.6.1-u16.0",
35
- "@endo/nat": "^5.0.7",
36
- "@endo/patterns": "^1.4.0"
34
+ "@agoric/store": "^0.9.3-u17.0",
35
+ "@endo/errors": "^1.2.5",
36
+ "@endo/nat": "^5.0.10",
37
+ "@endo/patterns": "^1.4.3"
37
38
  },
38
39
  "devDependencies": {
39
- "@endo/far": "^1.1.2",
40
- "@endo/init": "^1.1.2",
40
+ "@endo/far": "^1.1.5",
41
+ "@endo/init": "^1.1.4",
41
42
  "ava": "^5.3.0"
42
43
  },
43
44
  "ava": {
@@ -57,7 +58,7 @@
57
58
  "access": "public"
58
59
  },
59
60
  "typeCoverage": {
60
- "atLeast": 87.29
61
+ "atLeast": 88.72
61
62
  },
62
- "gitHead": "bbdf652c3f413381cb352a8a360db1063974fafd"
63
+ "gitHead": "515c4c0efccfc91b97da30037c10fc4b076851e2"
63
64
  }
package/src/timeMath.js CHANGED
@@ -1,10 +1,11 @@
1
1
  import { Nat } from '@endo/nat';
2
- import { mustMatch } from '@endo/patterns';
2
+ import { Fail, q } from '@endo/errors';
3
+ import { mustMatch } from '@agoric/store';
3
4
  import { RelativeTimeRecordShape, TimestampRecordShape } from './typeGuards.js';
4
5
 
5
- /** @import {RelativeTime, RelativeTimeValue, TimerBrand, TimeMathType, Timestamp, TimestampRecord, TimestampValue} from './types.js' */
6
-
7
- const { Fail, quote: q } = assert;
6
+ /**
7
+ * @import {RelativeTime, RelativeTimeValue, TimerBrand, TimeMathType, Timestamp, TimestampRecord, TimestampValue} from './types.js';
8
+ */
8
9
 
9
10
  /**
10
11
  * `agreedTimerBrand` is internal to this module.
package/src/typeGuards.js CHANGED
@@ -1,20 +1,31 @@
1
1
  import { M } from '@endo/patterns';
2
2
 
3
+ /**
4
+ * @import {TypedPattern} from '@agoric/internal';
5
+ * @import {TimestampRecord, TimestampValue, RelativeTimeValue, RelativeTimeRecord} from './types.js';
6
+ */
7
+
3
8
  export const TimerBrandShape = M.remotable('TimerBrand');
9
+ /** @type {TypedPattern<bigint>} */
4
10
  export const TimestampValueShape = M.nat();
11
+ /** @type {TypedPattern<bigint>} */
5
12
  export const RelativeTimeValueShape = M.nat(); // Should we allow negatives?
6
13
 
14
+ /** @type {TypedPattern<TimestampRecord>} */
7
15
  export const TimestampRecordShape = harden({
8
16
  timerBrand: TimerBrandShape,
9
17
  absValue: TimestampValueShape,
10
18
  });
11
19
 
20
+ /** @type {TypedPattern<RelativeTimeRecord>} */
12
21
  export const RelativeTimeRecordShape = harden({
13
22
  timerBrand: TimerBrandShape,
14
23
  relValue: RelativeTimeValueShape,
15
24
  });
16
25
 
26
+ /** @type {TypedPattern<TimestampRecord | TimestampValue>} */
17
27
  export const TimestampShape = M.or(TimestampRecordShape, TimestampValueShape);
28
+ /** @type {TypedPattern<RelativeTimeRecord | RelativeTimeValue>} */
18
29
  export const RelativeTimeShape = M.or(
19
30
  RelativeTimeRecordShape,
20
31
  RelativeTimeValueShape,