@buenos-nachos/time-sync 0.3.0 → 0.3.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @buenos-nachos/time-sync
2
2
 
3
+ ## 0.3.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 5fce018: switched internal implementations to use Date.now more often to reduce memory usage
8
+
3
9
  ## 0.3.0
4
10
 
5
11
  ### Minor Changes
package/package.json CHANGED
@@ -1,13 +1,10 @@
1
1
  {
2
2
  "name": "@buenos-nachos/time-sync",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "author": "Michael Smith <hello@nachos.dev> (https://www.nachos.dev)",
7
7
  "description": "The base package for the time-sync set of packages.",
8
- "publishConfig": {
9
- "access": "public"
10
- },
11
8
  "repository": {
12
9
  "type": "git",
13
10
  "url": "git+https://github.com/buenos-nachos/time-sync.git",
@@ -20,6 +17,12 @@
20
17
  ],
21
18
  "sideEffects": false,
22
19
  "main": "./dist/index.js",
20
+ "publishConfig": {
21
+ "access": "public"
22
+ },
23
+ "scripts": {
24
+ "check:types": "tsc --noEmit"
25
+ },
23
26
  "module": "./dist/index.mjs",
24
27
  "types": "./dist/index.d.ts"
25
28
  }
@@ -151,8 +151,8 @@ export class ReadonlyDate extends Date implements ReadonlyDateApi {
151
151
  */
152
152
  if (initValue === undefined) {
153
153
  super();
154
- const constructorOverrideForTestCorrectness = new Date();
155
- super.setTime(constructorOverrideForTestCorrectness.getTime());
154
+ const overrideForTestCorrectness = Date.now();
155
+ super.setTime(overrideForTestCorrectness);
156
156
  return;
157
157
  }
158
158
 
package/src/TimeSync.ts CHANGED
@@ -498,7 +498,7 @@ export class TimeSync implements TimeSyncApi {
498
498
  return;
499
499
  }
500
500
 
501
- const elapsed = new ReadonlyDate().getTime() - date.getTime();
501
+ const elapsed = Date.now() - date.getTime();
502
502
  const timeBeforeNextUpdate = fastest - elapsed;
503
503
 
504
504
  // Clear previous interval sight unseen just to be on the safe side