@aaronshaf/ger 1.2.8 → 1.2.9

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": "@aaronshaf/ger",
3
- "version": "1.2.8",
3
+ "version": "1.2.9",
4
4
  "description": "Gerrit CLI",
5
5
  "main": "src/ger.ts",
6
6
  "bin": {
@@ -100,7 +100,7 @@ function output(
100
100
  .filter(Boolean)
101
101
  .map((str) => `[${str}]`) as string[];
102
102
 
103
- const approvals = gerritData.currentPatchSet.approvals.map((a) => {
103
+ const approvals = (gerritData.currentPatchSet.approvals || []).map((a) => {
104
104
  let description = a.description;
105
105
  if (a.type === "SUBM" && !description) {
106
106
  description = "Submitted";
package/src/types.d.ts CHANGED
@@ -19,7 +19,7 @@ export type GerritApproval = {
19
19
 
20
20
  export type GerritData = {
21
21
  currentPatchSet: {
22
- approvals: GerritApproval[]
22
+ approvals?: GerritApproval[]
23
23
  }
24
24
  id: string;
25
25
  status: 'MERGED' | 'ABANDONED';
package/src/utils.ts CHANGED
@@ -12,22 +12,19 @@ export function bold(text: string) {
12
12
  return `\x1b[1m${text}\x1b[0m`;
13
13
  }
14
14
 
15
- // grey with transparent background
16
15
  export function grey(text: string) {
17
16
  return `\x1b[37m\x1b[40m${text}\x1b[0m`;
18
17
  }
19
18
 
20
- // brown with transparent background
21
19
  export function darkBrown(text: string) {
22
20
  // return `\x1b[43m\x1b[30m${text}\x1b[0m`;
23
21
  return `\x1b[33m${text}\x1b[0m`;
24
22
  }
25
23
 
26
24
  export function green(text: string) {
27
- return `\x1b[42m\x1b[30m${text}\x1b[0m`;
25
+ return `\x1b[32m${text}\x1b[0m`;
28
26
  }
29
27
 
30
- // yellow text with transparent background
31
28
  export function yellow(text: string) {
32
29
  // return `\x1b[33m\x1b[40m${text}\x1b[0m`;
33
30
  return `\x1b[33m${text}\x1b[0m`;