@teambit/cli-table 0.0.32 → 0.0.35

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/cli-table.ts CHANGED
@@ -14,6 +14,19 @@ export class CLITable {
14
14
  return table.toString();
15
15
  }
16
16
 
17
+ /**
18
+ * sort by the first column
19
+ */
20
+ sort() {
21
+ this.body.sort((a, b) => {
22
+ const aValue = a[0];
23
+ const bValue = b[0];
24
+ if (aValue < bValue) return -1;
25
+ if (aValue > bValue) return 1;
26
+ return 0;
27
+ });
28
+ }
29
+
17
30
  static fromObject(header: { value: string }[], data: Record<string, string>[]) {
18
31
  const headers = Object.values(header).map((d) => colors.cyan(d.value));
19
32
  return new CLITable(
@@ -4,6 +4,10 @@ export declare class CLITable {
4
4
  private options?;
5
5
  constructor(headers: any, body: string[][], options?: Record<string, any>);
6
6
  render(): string;
7
+ /**
8
+ * sort by the first column
9
+ */
10
+ sort(): void;
7
11
  static fromObject(header: {
8
12
  value: string;
9
13
  }[], data: Record<string, string>[]): CLITable;
package/dist/cli-table.js CHANGED
@@ -22,6 +22,20 @@ class CLITable {
22
22
  });
23
23
  return table.toString();
24
24
  }
25
+ /**
26
+ * sort by the first column
27
+ */
28
+ sort() {
29
+ this.body.sort((a, b) => {
30
+ const aValue = a[0];
31
+ const bValue = b[0];
32
+ if (aValue < bValue)
33
+ return -1;
34
+ if (aValue > bValue)
35
+ return 1;
36
+ return 0;
37
+ });
38
+ }
25
39
  static fromObject(header, data) {
26
40
  const headers = Object.values(header).map((d) => colors_1.default.cyan(d.value));
27
41
  return new CLITable(headers, data.map((value) => Object.values(value)), { color: 'white' });
@@ -1 +1 @@
1
- {"version":3,"file":"cli-table.js","sourceRoot":"","sources":["../cli-table.ts"],"names":[],"mappings":";;;;;;AAAA,0DAA8B;AAC9B,oDAA4B;AAE5B,MAAa,QAAQ;IACnB,YAAoB,OAAY,EAAU,IAAgB,EAAU,OAA6B;QAA7E,YAAO,GAAP,OAA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EAAE,EAAE,CAAC,gBAAM,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;QACvE,OAAO,IAAI,QAAQ,CACjB,OAAO,EACP,IAAI,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EACzC,EAAE,KAAK,EAAE,OAAO,EAAE,CACnB,CAAC;IACJ,CAAC;CACF;AAlCD,4BAkCC"}
@@ -0,0 +1,32 @@
1
+ {
2
+ "compilerOptions": {
3
+ "lib": [
4
+ "es2019",
5
+ "DOM",
6
+ "ES6",
7
+ "DOM.Iterable"
8
+ ],
9
+ "target": "es2015",
10
+ "module": "CommonJS",
11
+ "jsx": "react",
12
+ "allowJs": true,
13
+ "composite": true,
14
+ "declaration": true,
15
+ "sourceMap": true,
16
+ "skipLibCheck": true,
17
+ "experimentalDecorators": true,
18
+ "outDir": "dist",
19
+ "moduleResolution": "node",
20
+ "esModuleInterop": true,
21
+ "rootDir": ".",
22
+ "resolveJsonModule": true
23
+ },
24
+ "exclude": [
25
+ "dist",
26
+ "package.json"
27
+ ],
28
+ "include": [
29
+ "**/*",
30
+ "**/*.json"
31
+ ]
32
+ }
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@teambit/cli-table",
3
- "version": "0.0.32",
3
+ "version": "0.0.35",
4
4
  "homepage": "https://bit.dev/teambit/toolbox/cli-table",
5
5
  "main": "dist/index.js",
6
6
  "componentId": {
7
7
  "scope": "teambit.toolbox",
8
8
  "name": "cli-table",
9
- "version": "0.0.32"
9
+ "version": "0.0.35"
10
10
  },
11
11
  "dependencies": {
12
12
  "cli-table": "0.3.6",
@@ -14,34 +14,12 @@
14
14
  },
15
15
  "devDependencies": {
16
16
  "@types/cli-table": "^0.3.0",
17
- "@types/mocha": "5.2.7",
18
17
  "@babel/runtime": "7.12.18",
19
18
  "@types/node": "12.20.4",
20
19
  "@types/jest": "26.0.20"
21
20
  },
22
- "peerDependencies": {
23
- "@teambit/legacy": "1.0.196"
24
- },
21
+ "peerDependencies": {},
25
22
  "license": "Apache-2.0",
26
- "bit": {
27
- "bindingPrefix": "@teambit",
28
- "env": {},
29
- "overrides": {
30
- "dependencies": {
31
- "@teambit/legacy": "-"
32
- },
33
- "devDependencies": {
34
- "@teambit/legacy": "-",
35
- "@types/mocha": "5.2.7",
36
- "@babel/runtime": "7.12.18",
37
- "@types/node": "12.20.4",
38
- "@types/jest": "26.0.20"
39
- },
40
- "peerDependencies": {
41
- "@teambit/legacy": "1.0.196"
42
- }
43
- }
44
- },
45
23
  "private": false,
46
24
  "engines": {
47
25
  "node": ">=12.22.0"
@@ -59,8 +37,6 @@
59
37
  "react",
60
38
  "react-components",
61
39
  "angular",
62
- "angular-components",
63
- "vue",
64
- "vue-components"
40
+ "angular-components"
65
41
  ]
66
42
  }
@@ -0,0 +1,5 @@
1
+ ;
2
+ ;
3
+
4
+ export const compositions = [];
5
+ export const overview = [];
package/tsconfig.json CHANGED
@@ -7,13 +7,14 @@
7
7
  "DOM.Iterable"
8
8
  ],
9
9
  "target": "es2015",
10
- "module": "commonjs",
10
+ "module": "CommonJS",
11
11
  "jsx": "react",
12
12
  "allowJs": true,
13
13
  "composite": true,
14
14
  "declaration": true,
15
15
  "sourceMap": true,
16
16
  "skipLibCheck": true,
17
+ "experimentalDecorators": true,
17
18
  "outDir": "dist",
18
19
  "moduleResolution": "node",
19
20
  "esModuleInterop": true,
@@ -21,6 +22,11 @@
21
22
  "resolveJsonModule": true
22
23
  },
23
24
  "exclude": [
24
- "dist"
25
+ "dist",
26
+ "package.json"
27
+ ],
28
+ "include": [
29
+ "**/*",
30
+ "**/*.json"
25
31
  ]
26
32
  }