@stacksjs/git 0.59.11 → 0.61.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/dist/index.js +6 -3
- package/package.json +9 -9
- package/src/index.ts +7 -5
- package/dist/index.d.ts +0 -6
package/dist/index.js
CHANGED
|
@@ -13,13 +13,16 @@ function useGitHub() {
|
|
|
13
13
|
const weeksDifference = Math.floor(daysDifference / 7);
|
|
14
14
|
if (secondsDifference < 60) {
|
|
15
15
|
return `${secondsDifference}s`;
|
|
16
|
-
}
|
|
16
|
+
}
|
|
17
|
+
if (minutesDifference < 60) {
|
|
17
18
|
const remainingSeconds = secondsDifference % 60;
|
|
18
19
|
return `${minutesDifference}m ${remainingSeconds}s`;
|
|
19
|
-
}
|
|
20
|
+
}
|
|
21
|
+
if (hoursDifference < 24) {
|
|
20
22
|
const remainingMinutes = minutesDifference % 60;
|
|
21
23
|
return `${hoursDifference}h ${remainingMinutes}m`;
|
|
22
|
-
}
|
|
24
|
+
}
|
|
25
|
+
if (weeksDifference < 7) {
|
|
23
26
|
const remainingHours = hoursDifference % 24;
|
|
24
27
|
return `${daysDifference}d ${remainingHours}h`;
|
|
25
28
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacksjs/git",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.61.0",
|
|
5
5
|
"description": "The Stacks git utilities & conventions.",
|
|
6
6
|
"author": "Chris Breuer",
|
|
7
7
|
"license": "MIT",
|
|
@@ -48,20 +48,20 @@
|
|
|
48
48
|
"prepublishOnly": "bun run build"
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
51
|
-
"bumpp": "^9.4.
|
|
51
|
+
"bumpp": "^9.4.1",
|
|
52
52
|
"changelogen": "^0.5.5",
|
|
53
53
|
"commitizen": "^4.3.0",
|
|
54
|
-
"cz-git": "^1.9.
|
|
55
|
-
"giget": "^1.2.
|
|
56
|
-
"simple-git-hooks": "^2.
|
|
54
|
+
"cz-git": "^1.9.1",
|
|
55
|
+
"giget": "^1.2.3",
|
|
56
|
+
"simple-git-hooks": "^2.11.1"
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
|
-
"bumpp": "^9.4.
|
|
59
|
+
"bumpp": "^9.4.1",
|
|
60
60
|
"changelogen": "^0.5.5",
|
|
61
61
|
"commitizen": "^4.3.0",
|
|
62
|
-
"cz-git": "^1.9.
|
|
63
|
-
"giget": "^1.2.
|
|
64
|
-
"simple-git-hooks": "^2.
|
|
62
|
+
"cz-git": "^1.9.1",
|
|
63
|
+
"giget": "^1.2.3",
|
|
64
|
+
"simple-git-hooks": "^2.11.1"
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
67
67
|
"@stacksjs/development": "latest"
|
package/src/index.ts
CHANGED
|
@@ -22,17 +22,20 @@ export function useGitHub() {
|
|
|
22
22
|
// If less than 60 seconds, return seconds only
|
|
23
23
|
return `${secondsDifference}s`
|
|
24
24
|
}
|
|
25
|
-
|
|
25
|
+
|
|
26
|
+
if (minutesDifference < 60) {
|
|
26
27
|
// If less than 60 minutes, return minutes and remaining seconds
|
|
27
28
|
const remainingSeconds = secondsDifference % 60
|
|
28
29
|
return `${minutesDifference}m ${remainingSeconds}s`
|
|
29
30
|
}
|
|
30
|
-
|
|
31
|
+
|
|
32
|
+
if (hoursDifference < 24) {
|
|
31
33
|
// If less than 24 hours, return hours and remaining minutes
|
|
32
34
|
const remainingMinutes = minutesDifference % 60
|
|
33
35
|
return `${hoursDifference}h ${remainingMinutes}m`
|
|
34
36
|
}
|
|
35
|
-
|
|
37
|
+
|
|
38
|
+
if (weeksDifference < 7) {
|
|
36
39
|
const remainingHours: number = hoursDifference % 24
|
|
37
40
|
|
|
38
41
|
return `${daysDifference}d ${remainingHours}h`
|
|
@@ -45,8 +48,7 @@ export function useGitHub() {
|
|
|
45
48
|
const minutes = Math.floor(durationInSeconds / 60)
|
|
46
49
|
const seconds = durationInSeconds % 60
|
|
47
50
|
|
|
48
|
-
if (minutes > 1)
|
|
49
|
-
return `${minutes}m ${seconds}s`
|
|
51
|
+
if (minutes > 1) return `${minutes}m ${seconds}s`
|
|
50
52
|
|
|
51
53
|
return `${seconds}s`
|
|
52
54
|
}
|
package/dist/index.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export * as changelog from 'changelogen';
|
|
2
|
-
export declare function useGitHub(): {
|
|
3
|
-
getTimeDifference: (givenDateString: string) => string;
|
|
4
|
-
formatDuration: (durationInSeconds: number) => string;
|
|
5
|
-
getActionRunDuration: (startTime: Date, endTime: Date) => string;
|
|
6
|
-
};
|