electron-info 1.32.2 → 1.32.4

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.
@@ -10,3 +10,4 @@ export declare class FileService {
10
10
  private isPathReadable;
11
11
  private loadReleasesFile;
12
12
  }
13
+ export declare function isWithinLastDay(date: Date, now?: Date): boolean;
@@ -1,4 +1,3 @@
1
- import { isAfter as isAfterDate, sub as subtractDate } from 'date-fns';
2
1
  import logdown from 'logdown';
3
2
  import { promises as fs, constants as fsConstants } from 'node:fs';
4
3
  import os from 'node:os';
@@ -68,8 +67,7 @@ export class FileService {
68
67
  async isFileFromToday(fileName) {
69
68
  const { mtime: fileModifiedDate } = await fs.stat(fileName);
70
69
  this.logger.log(`File "${fileName}" is from "${fileModifiedDate.toString()}"`);
71
- const yesterday = subtractDate(new Date(), { days: 1 });
72
- return isAfterDate(fileModifiedDate, yesterday);
70
+ return isWithinLastDay(fileModifiedDate);
73
71
  }
74
72
  async isPathReadable(filePath) {
75
73
  try {
@@ -91,3 +89,8 @@ export class FileService {
91
89
  return releases;
92
90
  }
93
91
  }
92
+ export function isWithinLastDay(date, now = new Date()) {
93
+ const yesterday = new Date(now);
94
+ yesterday.setUTCDate(yesterday.getUTCDate() - 1);
95
+ return date > yesterday;
96
+ }
package/package.json CHANGED
@@ -3,10 +3,9 @@
3
3
  "bin": "dist/cli.js",
4
4
  "dependencies": {
5
5
  "chalk": "5.6.2",
6
- "commander": "14.0.3",
7
- "date-fns": "4.1.0",
6
+ "commander": "15.0.0",
8
7
  "logdown": "3.3.1",
9
- "semver": "7.8.0",
8
+ "semver": "7.8.1",
10
9
  "table": "6.9.0"
11
10
  },
12
11
  "description": "Get useful data about Electron releases.",
@@ -14,12 +13,12 @@
14
13
  "@types/semver": "7.7.1",
15
14
  "http-status-codes": "2.3.0",
16
15
  "nock": "14.0.15",
17
- "tsx": "4.21.0",
16
+ "tsx": "4.22.3",
18
17
  "typescript": "6.0.3",
19
- "vitest": "4.1.6"
18
+ "vitest": "4.1.7"
20
19
  },
21
20
  "engines": {
22
- "node": ">= 21"
21
+ "node": ">= 22.12.0"
23
22
  },
24
23
  "exports": "./dist/index.js",
25
24
  "files": [
@@ -49,5 +48,5 @@
49
48
  "test": "vitest run"
50
49
  },
51
50
  "type": "module",
52
- "version": "1.32.2"
51
+ "version": "1.32.4"
53
52
  }