excellentexport 3.7.0 → 3.8.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/.github/FUNDING.yml +1 -1
- package/.github/dependabot.yml +7 -0
- package/.github/workflows/webpack.yml +28 -0
- package/LICENSE.txt +20 -20
- package/README.md +286 -266
- package/bower.json +32 -32
- package/dist/excellentexport.d.ts +35 -33
- package/dist/excellentexport.js +2 -1
- package/dist/excellentexport.js.LICENSE.txt +3 -0
- package/dist/utils.d.ts +29 -0
- package/index.bigtable.html +80 -80
- package/index.filters.html +63 -63
- package/index.html +127 -127
- package/index.noanchor.html +31 -31
- package/index.rtl.html +69 -0
- package/jest.config.ts +203 -203
- package/package.json +60 -56
- package/src/excellentexport.ts +203 -335
- package/src/utils.ts +141 -0
- package/test/convert-filters.test.ts +70 -70
- package/test/convert-table.test.ts +71 -71
- package/test/fixdata.test.ts +74 -74
- package/test/utils.test.ts +29 -0
- package/test/utils_fixdata.test.ts +24 -0
- package/test/utils_removeColumns.test.ts +98 -0
- package/tsconfig.json +17 -17
- package/webpack.config.js +4 -1
- package/.travis.yml +0 -9
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
const assert = require('assert');
|
|
2
|
+
|
|
3
|
+
import { removeColumns } from '../src/utils';
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
describe('Test utility functions: removeColumns', () => {
|
|
7
|
+
|
|
8
|
+
it('should remove one column correctly', function() {
|
|
9
|
+
const columns = [
|
|
10
|
+
['a', 'b', 'c'],
|
|
11
|
+
['d', 'e', 'f'],
|
|
12
|
+
['g', 'h', 'i'],
|
|
13
|
+
];
|
|
14
|
+
|
|
15
|
+
removeColumns(columns, [0]);
|
|
16
|
+
expect(columns.length).toEqual(3)
|
|
17
|
+
expect(columns[0]).toStrictEqual(['b', 'c']);
|
|
18
|
+
expect(columns[1]).toStrictEqual(['e', 'f']);
|
|
19
|
+
expect(columns[2]).toStrictEqual(['h', 'i']);
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
it('should remove two columns', () => {
|
|
23
|
+
const columns = [
|
|
24
|
+
['a', 'b', 'c'],
|
|
25
|
+
['d', 'e', 'f'],
|
|
26
|
+
['g', 'h', 'i'],
|
|
27
|
+
];
|
|
28
|
+
|
|
29
|
+
removeColumns(columns, [0, 1]);
|
|
30
|
+
expect(columns.length).toEqual(3)
|
|
31
|
+
expect(columns[0]).toStrictEqual(['c']);
|
|
32
|
+
expect(columns[1]).toStrictEqual(['f']);
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
it('should remove the last column', () => {
|
|
36
|
+
const columns = [
|
|
37
|
+
['a', 'b', 'c'],
|
|
38
|
+
['d', 'e', 'f'],
|
|
39
|
+
['g', 'h', 'i'],
|
|
40
|
+
];
|
|
41
|
+
|
|
42
|
+
removeColumns(columns, [2]);
|
|
43
|
+
expect(columns.length).toEqual(3)
|
|
44
|
+
expect(columns[0]).toStrictEqual(['a', 'b']);
|
|
45
|
+
expect(columns[1]).toStrictEqual(['d', 'e']);
|
|
46
|
+
expect(columns[2]).toStrictEqual(['g', 'h']);
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
it('should skip if remove out of range', () => {
|
|
50
|
+
const columns = [
|
|
51
|
+
['a', 'b', 'c'],
|
|
52
|
+
['d', 'e', 'f'],
|
|
53
|
+
['g', 'h', 'i'],
|
|
54
|
+
];
|
|
55
|
+
|
|
56
|
+
removeColumns(columns, [99]);
|
|
57
|
+
expect(columns.length).toEqual(3);
|
|
58
|
+
expect(columns[0]).toEqual(['a', 'b', 'c']);
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
it('should skip if remove out of range', () => {
|
|
62
|
+
const columns = [
|
|
63
|
+
['a', 'b', 'c'],
|
|
64
|
+
['d', 'e', 'f'],
|
|
65
|
+
['g', 'h', 'i'],
|
|
66
|
+
];
|
|
67
|
+
|
|
68
|
+
removeColumns(columns, [0, 99]);
|
|
69
|
+
expect(columns.length).toEqual(3);
|
|
70
|
+
expect(columns[0]).toEqual(['b', 'c']);
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
it('should not remove repeated columns', () => {
|
|
74
|
+
const columns = [
|
|
75
|
+
['a', 'b', 'c'],
|
|
76
|
+
['d', 'e', 'f'],
|
|
77
|
+
['g', 'h', 'i'],
|
|
78
|
+
];
|
|
79
|
+
|
|
80
|
+
removeColumns(columns, [0, 0]);
|
|
81
|
+
expect(columns.length).toEqual(3);
|
|
82
|
+
expect(columns[0]).toEqual(['b', 'c']);
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
it('should remove columns in the correct order', () => {
|
|
86
|
+
const columns = [
|
|
87
|
+
['a', 'b', 'c'],
|
|
88
|
+
['d', 'e', 'f'],
|
|
89
|
+
['g', 'h', 'i'],
|
|
90
|
+
];
|
|
91
|
+
|
|
92
|
+
removeColumns(columns, [0, 2]);
|
|
93
|
+
expect(columns.length).toEqual(3);
|
|
94
|
+
expect(columns[0]).toEqual(['b']);
|
|
95
|
+
expect(columns[1]).toEqual(['e']);
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
});
|
package/tsconfig.json
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"outDir": "./dist",
|
|
4
|
-
"allowJs": true,
|
|
5
|
-
"target": "ESNext",
|
|
6
|
-
"sourceMap": true,
|
|
7
|
-
"removeComments": false,
|
|
8
|
-
"declaration": true,
|
|
9
|
-
"rootDir": "src",
|
|
10
|
-
"moduleResolution": "node",
|
|
11
|
-
"esModuleInterop": true
|
|
12
|
-
},
|
|
13
|
-
"include": [
|
|
14
|
-
"src
|
|
15
|
-
"test/**/*.{ts,js}"
|
|
16
|
-
]
|
|
17
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"outDir": "./dist",
|
|
4
|
+
"allowJs": true,
|
|
5
|
+
"target": "ESNext",
|
|
6
|
+
"sourceMap": true,
|
|
7
|
+
"removeComments": false,
|
|
8
|
+
"declaration": true,
|
|
9
|
+
"rootDir": "src",
|
|
10
|
+
"moduleResolution": "node",
|
|
11
|
+
"esModuleInterop": true
|
|
12
|
+
},
|
|
13
|
+
"include": [
|
|
14
|
+
"src/**/*.ts",
|
|
15
|
+
"test/**/*.{ts,js}"
|
|
16
|
+
]
|
|
17
|
+
}
|
package/webpack.config.js
CHANGED