accessibility-checker 4.0.0 → 4.0.1

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.
Files changed (217) hide show
  1. package/bin/achecker.js +262 -213
  2. package/bin/achecker.js.map +1 -1
  3. package/index.js +63 -21
  4. package/index.js.map +1 -1
  5. package/lib/ACBrowserManager.js +203 -138
  6. package/lib/ACBrowserManager.js.map +1 -1
  7. package/lib/ACEngineManager.js +402 -395
  8. package/lib/ACEngineManager.js.map +1 -1
  9. package/lib/ACHelper.js +642 -581
  10. package/lib/ACHelper.js.map +1 -1
  11. package/lib/common/api-ext/Fetch.js +78 -58
  12. package/lib/common/api-ext/Fetch.js.map +1 -1
  13. package/lib/common/config/ACConfigManager.d.ts +1 -1
  14. package/lib/common/config/ACConfigManager.js +295 -285
  15. package/lib/common/config/ACConfigManager.js.map +1 -1
  16. package/lib/common/config/ACConstants.js +4 -38
  17. package/lib/common/config/ACConstants.js.map +1 -1
  18. package/lib/common/config/IConfig.d.ts +1 -1
  19. package/lib/common/engine/IChecker.d.ts +2 -2
  20. package/lib/common/engine/IEngine.d.ts +1 -1
  21. package/lib/common/engine/IGuideline.d.ts +1 -1
  22. package/lib/common/engine/IMapper.d.ts +1 -1
  23. package/lib/common/engine/IReport.d.ts +4 -4
  24. package/lib/common/engine/IRule.d.ts +4 -4
  25. package/lib/common/engine/IRuleset.d.ts +1 -1
  26. package/lib/common/report/ACReporterCSV.js +77 -42
  27. package/lib/common/report/ACReporterCSV.js.map +1 -1
  28. package/lib/common/report/ACReporterHTML.js +48 -15
  29. package/lib/common/report/ACReporterHTML.js.map +1 -1
  30. package/lib/common/report/ACReporterJSON.js +94 -59
  31. package/lib/common/report/ACReporterJSON.js.map +1 -1
  32. package/lib/common/report/ACReporterMetrics.js +108 -45
  33. package/lib/common/report/ACReporterMetrics.js.map +1 -1
  34. package/lib/common/report/ACReporterXLSX.js +300 -282
  35. package/lib/common/report/ACReporterXLSX.js.map +1 -1
  36. package/lib/common/report/BaselineManager.js +56 -82
  37. package/lib/common/report/BaselineManager.js.map +1 -1
  38. package/lib/common/report/ReporterManager.js +190 -125
  39. package/lib/common/report/ReporterManager.js.map +1 -1
  40. package/lib/common/report/genReport.js +2 -2
  41. package/package.json +4 -10
  42. package/cjs/bin/achecker.d.ts +0 -2
  43. package/cjs/bin/achecker.js +0 -306
  44. package/cjs/bin/achecker.js.map +0 -1
  45. package/cjs/index.d.ts +0 -319
  46. package/cjs/index.js +0 -402
  47. package/cjs/index.js.map +0 -1
  48. package/cjs/lib/ACBrowserManager.d.ts +0 -22
  49. package/cjs/lib/ACBrowserManager.js +0 -172
  50. package/cjs/lib/ACBrowserManager.js.map +0 -1
  51. package/cjs/lib/ACEngineManager.d.ts +0 -19
  52. package/cjs/lib/ACEngineManager.js +0 -457
  53. package/cjs/lib/ACEngineManager.js.map +0 -1
  54. package/cjs/lib/ACHelper.d.ts +0 -2
  55. package/cjs/lib/ACHelper.js +0 -678
  56. package/cjs/lib/ACHelper.js.map +0 -1
  57. package/cjs/lib/api/IChecker.d.ts +0 -28
  58. package/cjs/lib/api/IChecker.js +0 -11
  59. package/cjs/lib/api/IChecker.js.map +0 -1
  60. package/cjs/lib/api/IMapper.d.ts +0 -37
  61. package/cjs/lib/api/IMapper.js +0 -18
  62. package/cjs/lib/api/IMapper.js.map +0 -1
  63. package/cjs/lib/common/api-ext/Fetch.d.ts +0 -17
  64. package/cjs/lib/common/api-ext/Fetch.js +0 -95
  65. package/cjs/lib/common/api-ext/Fetch.js.map +0 -1
  66. package/cjs/lib/common/api-ext/IAbstractAPI.d.ts +0 -33
  67. package/cjs/lib/common/api-ext/IAbstractAPI.js +0 -18
  68. package/cjs/lib/common/api-ext/IAbstractAPI.js.map +0 -1
  69. package/cjs/lib/common/config/ACConfigManager.d.ts +0 -13
  70. package/cjs/lib/common/config/ACConfigManager.js +0 -483
  71. package/cjs/lib/common/config/ACConfigManager.js.map +0 -1
  72. package/cjs/lib/common/config/ACConstants.d.ts +0 -17
  73. package/cjs/lib/common/config/ACConstants.js +0 -111
  74. package/cjs/lib/common/config/ACConstants.js.map +0 -1
  75. package/cjs/lib/common/config/IArchive.d.ts +0 -37
  76. package/cjs/lib/common/config/IArchive.js +0 -18
  77. package/cjs/lib/common/config/IArchive.js.map +0 -1
  78. package/cjs/lib/common/config/IConfig.d.ts +0 -152
  79. package/cjs/lib/common/config/IConfig.js +0 -36
  80. package/cjs/lib/common/config/IConfig.js.map +0 -1
  81. package/cjs/lib/common/engine/IBounds.d.ts +0 -21
  82. package/cjs/lib/common/engine/IBounds.js +0 -18
  83. package/cjs/lib/common/engine/IBounds.js.map +0 -1
  84. package/cjs/lib/common/engine/IChecker.d.ts +0 -23
  85. package/cjs/lib/common/engine/IChecker.js +0 -18
  86. package/cjs/lib/common/engine/IChecker.js.map +0 -1
  87. package/cjs/lib/common/engine/IEngine.d.ts +0 -39
  88. package/cjs/lib/common/engine/IEngine.js +0 -18
  89. package/cjs/lib/common/engine/IEngine.js.map +0 -1
  90. package/cjs/lib/common/engine/IGuideline.d.ts +0 -53
  91. package/cjs/lib/common/engine/IGuideline.js +0 -37
  92. package/cjs/lib/common/engine/IGuideline.js.map +0 -1
  93. package/cjs/lib/common/engine/IMapper.d.ts +0 -32
  94. package/cjs/lib/common/engine/IMapper.js +0 -18
  95. package/cjs/lib/common/engine/IMapper.js.map +0 -1
  96. package/cjs/lib/common/engine/IReport.d.ts +0 -143
  97. package/cjs/lib/common/engine/IReport.js +0 -44
  98. package/cjs/lib/common/engine/IReport.js.map +0 -1
  99. package/cjs/lib/common/engine/IRule.d.ts +0 -100
  100. package/cjs/lib/common/engine/IRule.js +0 -87
  101. package/cjs/lib/common/engine/IRule.js.map +0 -1
  102. package/cjs/lib/common/engine/IRuleset.d.ts +0 -20
  103. package/cjs/lib/common/engine/IRuleset.js +0 -18
  104. package/cjs/lib/common/engine/IRuleset.js.map +0 -1
  105. package/cjs/lib/common/report/ACReporterCSV.d.ts +0 -28
  106. package/cjs/lib/common/report/ACReporterCSV.js +0 -75
  107. package/cjs/lib/common/report/ACReporterCSV.js.map +0 -1
  108. package/cjs/lib/common/report/ACReporterHTML.d.ts +0 -27
  109. package/cjs/lib/common/report/ACReporterHTML.js +0 -61
  110. package/cjs/lib/common/report/ACReporterHTML.js.map +0 -1
  111. package/cjs/lib/common/report/ACReporterJSON.d.ts +0 -36
  112. package/cjs/lib/common/report/ACReporterJSON.js +0 -109
  113. package/cjs/lib/common/report/ACReporterJSON.js.map +0 -1
  114. package/cjs/lib/common/report/ACReporterMetrics.d.ts +0 -78
  115. package/cjs/lib/common/report/ACReporterMetrics.js +0 -135
  116. package/cjs/lib/common/report/ACReporterMetrics.js.map +0 -1
  117. package/cjs/lib/common/report/ACReporterXLSX.d.ts +0 -38
  118. package/cjs/lib/common/report/ACReporterXLSX.js +0 -996
  119. package/cjs/lib/common/report/ACReporterXLSX.js.map +0 -1
  120. package/cjs/lib/common/report/BaselineManager.d.ts +0 -169
  121. package/cjs/lib/common/report/BaselineManager.js +0 -382
  122. package/cjs/lib/common/report/BaselineManager.js.map +0 -1
  123. package/cjs/lib/common/report/ReporterManager.d.ts +0 -79
  124. package/cjs/lib/common/report/ReporterManager.js +0 -469
  125. package/cjs/lib/common/report/ReporterManager.js.map +0 -1
  126. package/cjs/lib/common/report/genReport.d.ts +0 -1
  127. package/cjs/lib/common/report/genReport.js +0 -12
  128. package/cjs/lib/common/report/genReport.js.map +0 -1
  129. package/cjs/package.json +0 -3
  130. package/mjs/bin/achecker.d.ts +0 -2
  131. package/mjs/bin/achecker.js +0 -236
  132. package/mjs/bin/achecker.js.map +0 -1
  133. package/mjs/index.d.ts +0 -319
  134. package/mjs/index.js +0 -368
  135. package/mjs/index.js.map +0 -1
  136. package/mjs/lib/ACBrowserManager.d.ts +0 -22
  137. package/mjs/lib/ACBrowserManager.js +0 -121
  138. package/mjs/lib/ACBrowserManager.js.map +0 -1
  139. package/mjs/lib/ACEngineManager.d.ts +0 -19
  140. package/mjs/lib/ACEngineManager.js +0 -397
  141. package/mjs/lib/ACEngineManager.js.map +0 -1
  142. package/mjs/lib/ACHelper.d.ts +0 -2
  143. package/mjs/lib/ACHelper.js +0 -614
  144. package/mjs/lib/ACHelper.js.map +0 -1
  145. package/mjs/lib/api/IChecker.d.ts +0 -28
  146. package/mjs/lib/api/IChecker.js +0 -8
  147. package/mjs/lib/api/IChecker.js.map +0 -1
  148. package/mjs/lib/api/IMapper.d.ts +0 -37
  149. package/mjs/lib/api/IMapper.js +0 -17
  150. package/mjs/lib/api/IMapper.js.map +0 -1
  151. package/mjs/lib/common/api-ext/Fetch.d.ts +0 -17
  152. package/mjs/lib/common/api-ext/Fetch.js +0 -45
  153. package/mjs/lib/common/api-ext/Fetch.js.map +0 -1
  154. package/mjs/lib/common/api-ext/IAbstractAPI.d.ts +0 -33
  155. package/mjs/lib/common/api-ext/IAbstractAPI.js +0 -17
  156. package/mjs/lib/common/api-ext/IAbstractAPI.js.map +0 -1
  157. package/mjs/lib/common/config/ACConfigManager.d.ts +0 -13
  158. package/mjs/lib/common/config/ACConfigManager.js +0 -421
  159. package/mjs/lib/common/config/ACConfigManager.js.map +0 -1
  160. package/mjs/lib/common/config/ACConstants.d.ts +0 -17
  161. package/mjs/lib/common/config/ACConstants.js +0 -75
  162. package/mjs/lib/common/config/ACConstants.js.map +0 -1
  163. package/mjs/lib/common/config/IArchive.d.ts +0 -37
  164. package/mjs/lib/common/config/IArchive.js +0 -17
  165. package/mjs/lib/common/config/IArchive.js.map +0 -1
  166. package/mjs/lib/common/config/IConfig.d.ts +0 -152
  167. package/mjs/lib/common/config/IConfig.js +0 -33
  168. package/mjs/lib/common/config/IConfig.js.map +0 -1
  169. package/mjs/lib/common/engine/IBounds.d.ts +0 -21
  170. package/mjs/lib/common/engine/IBounds.js +0 -17
  171. package/mjs/lib/common/engine/IBounds.js.map +0 -1
  172. package/mjs/lib/common/engine/IChecker.d.ts +0 -23
  173. package/mjs/lib/common/engine/IChecker.js +0 -17
  174. package/mjs/lib/common/engine/IChecker.js.map +0 -1
  175. package/mjs/lib/common/engine/IEngine.d.ts +0 -39
  176. package/mjs/lib/common/engine/IEngine.js +0 -17
  177. package/mjs/lib/common/engine/IEngine.js.map +0 -1
  178. package/mjs/lib/common/engine/IGuideline.d.ts +0 -53
  179. package/mjs/lib/common/engine/IGuideline.js +0 -34
  180. package/mjs/lib/common/engine/IGuideline.js.map +0 -1
  181. package/mjs/lib/common/engine/IMapper.d.ts +0 -32
  182. package/mjs/lib/common/engine/IMapper.js +0 -17
  183. package/mjs/lib/common/engine/IMapper.js.map +0 -1
  184. package/mjs/lib/common/engine/IReport.d.ts +0 -143
  185. package/mjs/lib/common/engine/IReport.js +0 -36
  186. package/mjs/lib/common/engine/IReport.js.map +0 -1
  187. package/mjs/lib/common/engine/IRule.d.ts +0 -100
  188. package/mjs/lib/common/engine/IRule.js +0 -79
  189. package/mjs/lib/common/engine/IRule.js.map +0 -1
  190. package/mjs/lib/common/engine/IRuleset.d.ts +0 -20
  191. package/mjs/lib/common/engine/IRuleset.js +0 -17
  192. package/mjs/lib/common/engine/IRuleset.js.map +0 -1
  193. package/mjs/lib/common/report/ACReporterCSV.d.ts +0 -28
  194. package/mjs/lib/common/report/ACReporterCSV.js +0 -60
  195. package/mjs/lib/common/report/ACReporterCSV.js.map +0 -1
  196. package/mjs/lib/common/report/ACReporterHTML.d.ts +0 -27
  197. package/mjs/lib/common/report/ACReporterHTML.js +0 -46
  198. package/mjs/lib/common/report/ACReporterHTML.js.map +0 -1
  199. package/mjs/lib/common/report/ACReporterJSON.d.ts +0 -36
  200. package/mjs/lib/common/report/ACReporterJSON.js +0 -94
  201. package/mjs/lib/common/report/ACReporterJSON.js.map +0 -1
  202. package/mjs/lib/common/report/ACReporterMetrics.d.ts +0 -78
  203. package/mjs/lib/common/report/ACReporterMetrics.js +0 -122
  204. package/mjs/lib/common/report/ACReporterMetrics.js.map +0 -1
  205. package/mjs/lib/common/report/ACReporterXLSX.d.ts +0 -38
  206. package/mjs/lib/common/report/ACReporterXLSX.js +0 -948
  207. package/mjs/lib/common/report/ACReporterXLSX.js.map +0 -1
  208. package/mjs/lib/common/report/BaselineManager.d.ts +0 -169
  209. package/mjs/lib/common/report/BaselineManager.js +0 -348
  210. package/mjs/lib/common/report/BaselineManager.js.map +0 -1
  211. package/mjs/lib/common/report/ReporterManager.d.ts +0 -79
  212. package/mjs/lib/common/report/ReporterManager.js +0 -469
  213. package/mjs/lib/common/report/ReporterManager.js.map +0 -1
  214. package/mjs/lib/common/report/genReport.d.ts +0 -1
  215. package/mjs/lib/common/report/genReport.js +0 -9
  216. package/mjs/lib/common/report/genReport.js.map +0 -1
  217. package/mjs/package.json +0 -3
@@ -14,39 +14,6 @@
14
14
  See the License for the specific language governing permissions and
15
15
  limitations under the License.
16
16
  *****************************************************************************/
17
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
18
- if (k2 === undefined) k2 = k;
19
- var desc = Object.getOwnPropertyDescriptor(m, k);
20
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
21
- desc = { enumerable: true, get: function() { return m[k]; } };
22
- }
23
- Object.defineProperty(o, k2, desc);
24
- }) : (function(o, m, k, k2) {
25
- if (k2 === undefined) k2 = k;
26
- o[k2] = m[k];
27
- }));
28
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
29
- Object.defineProperty(o, "default", { enumerable: true, value: v });
30
- }) : function(o, v) {
31
- o["default"] = v;
32
- });
33
- var __importStar = (this && this.__importStar) || (function () {
34
- var ownKeys = function(o) {
35
- ownKeys = Object.getOwnPropertyNames || function (o) {
36
- var ar = [];
37
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
38
- return ar;
39
- };
40
- return ownKeys(o);
41
- };
42
- return function (mod) {
43
- if (mod && mod.__esModule) return mod;
44
- var result = {};
45
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
46
- __setModuleDefault(result, mod);
47
- return result;
48
- };
49
- })();
50
17
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
51
18
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
52
19
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -56,16 +23,43 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
56
23
  step((generator = generator.apply(thisArg, _arguments || [])).next());
57
24
  });
58
25
  };
26
+ var __generator = (this && this.__generator) || function (thisArg, body) {
27
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
28
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
29
+ function verb(n) { return function (v) { return step([n, v]); }; }
30
+ function step(op) {
31
+ if (f) throw new TypeError("Generator is already executing.");
32
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
33
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
34
+ if (y = 0, t) op = [op[0] & 2, t.value];
35
+ switch (op[0]) {
36
+ case 0: case 1: t = op; break;
37
+ case 4: _.label++; return { value: op[1], done: false };
38
+ case 5: _.label++; y = op[1]; op = [0]; continue;
39
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
40
+ default:
41
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
42
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
43
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
44
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
45
+ if (t[2]) _.ops.pop();
46
+ _.trys.pop(); continue;
47
+ }
48
+ op = body.call(thisArg, _);
49
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
50
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
51
+ }
52
+ };
59
53
  Object.defineProperty(exports, "__esModule", { value: true });
60
54
  exports.ACReporterXLSX = void 0;
61
- const IConfig_js_1 = require("../config/IConfig.js");
62
- const IGuideline_js_1 = require("../engine/IGuideline.js");
63
- const IRule_js_1 = require("../engine/IRule.js");
64
- const ReporterManager_js_1 = require("./ReporterManager.js");
65
- const ExcelJS = __importStar(require("exceljs"));
55
+ var IConfig_js_1 = require("../config/IConfig.js");
56
+ var IGuideline_js_1 = require("../engine/IGuideline.js");
57
+ var IRule_js_1 = require("../engine/IRule.js");
58
+ var ReporterManager_js_1 = require("./ReporterManager.js");
59
+ var ExcelJS = require("exceljs");
66
60
  function dropDupes(arr) {
67
- let dupes = {};
68
- return arr.filter(item => {
61
+ var dupes = {};
62
+ return arr.filter(function (item) {
69
63
  if (item.toString() in dupes) {
70
64
  return false;
71
65
  }
@@ -74,99 +68,111 @@ function dropDupes(arr) {
74
68
  }
75
69
  });
76
70
  }
77
- class ACReporterXLSX {
78
- name() {
79
- return "xlsx";
80
- }
81
- generateReport(_reportData) {
71
+ var ACReporterXLSX = /** @class */ (function () {
72
+ function ACReporterXLSX() {
82
73
  }
83
- generateSummary(config, rulesets, endReport, summaryData) {
84
- return __awaiter(this, void 0, void 0, function* () {
85
- let storedReport = ReporterManager_js_1.ReporterManager.uncompressReport(summaryData[0]);
86
- let cfgRulesets = rulesets.filter(rs => config.policies.includes(rs.id));
87
- let policyInfo = {};
88
- for (const rs of cfgRulesets) {
89
- for (const cp of rs.checkpoints) {
90
- for (const rule of cp.rules) {
91
- policyInfo[rule.id] = policyInfo[rule.id] || {
92
- tkLevels: [],
93
- cps: []
94
- };
95
- policyInfo[rule.id].tkLevels.push(rule.toolkitLevel);
96
- policyInfo[rule.id].cps.push(cp);
74
+ ACReporterXLSX.prototype.name = function () {
75
+ return "xlsx";
76
+ };
77
+ ACReporterXLSX.prototype.generateReport = function (_reportData) {
78
+ };
79
+ ACReporterXLSX.prototype.generateSummary = function (config, rulesets, endReport, summaryData) {
80
+ return __awaiter(this, void 0, void 0, function () {
81
+ var storedReport, cfgRulesets, policyInfo, _i, cfgRulesets_1, rs, _a, _b, cp, _c, _d, rule, ruleId, startScan, reportFilename;
82
+ var _this = this;
83
+ return __generator(this, function (_e) {
84
+ storedReport = ReporterManager_js_1.ReporterManager.uncompressReport(summaryData[0]);
85
+ cfgRulesets = rulesets.filter(function (rs) { return config.policies.includes(rs.id); });
86
+ policyInfo = {};
87
+ for (_i = 0, cfgRulesets_1 = cfgRulesets; _i < cfgRulesets_1.length; _i++) {
88
+ rs = cfgRulesets_1[_i];
89
+ for (_a = 0, _b = rs.checkpoints; _a < _b.length; _a++) {
90
+ cp = _b[_a];
91
+ for (_c = 0, _d = cp.rules; _c < _d.length; _c++) {
92
+ rule = _d[_c];
93
+ policyInfo[rule.id] = policyInfo[rule.id] || {
94
+ tkLevels: [],
95
+ cps: []
96
+ };
97
+ policyInfo[rule.id].tkLevels.push(rule.toolkitLevel);
98
+ policyInfo[rule.id].cps.push(cp);
99
+ }
97
100
  }
98
101
  }
99
- }
100
- for (const ruleId in policyInfo) {
101
- policyInfo[ruleId].tkLevels = dropDupes(policyInfo[ruleId].tkLevels);
102
- policyInfo[ruleId].tkLevels.sort();
103
- }
104
- // const buffer: any = await workbook.xlsx.writeBuffer();
105
- let startScan = new Date(storedReport.engineReport.summary.startScan);
106
- let reportFilename = `results_${startScan.toISOString().replace(/:/g, "-")}.xlsx`;
107
- if (config.outputFilenameTimestamp === false) {
108
- reportFilename = `results.xlsx`;
109
- }
110
- return {
111
- summaryPath: reportFilename,
112
- summary: (filename) => __awaiter(this, void 0, void 0, function* () {
113
- // @ts-ignore
114
- const workbook = new ExcelJS.stream.xlsx.WorkbookWriter({ filename, useStyles: true });
115
- // const workbook = new ExcelJS.Workbook({ useStyles: true });
116
- ACReporterXLSX.createOverviewSheet(config, summaryData, workbook);
117
- ACReporterXLSX.createScanSummarySheet(config, summaryData, workbook);
118
- ACReporterXLSX.createIssueSummarySheet(config, policyInfo, summaryData, workbook);
119
- ACReporterXLSX.createIssuesSheet(config, policyInfo, summaryData, workbook);
120
- ACReporterXLSX.createDefinitionsSheet(workbook);
121
- workbook.commit();
122
- })
123
- };
102
+ for (ruleId in policyInfo) {
103
+ policyInfo[ruleId].tkLevels = dropDupes(policyInfo[ruleId].tkLevels);
104
+ policyInfo[ruleId].tkLevels.sort();
105
+ }
106
+ startScan = new Date(storedReport.engineReport.summary.startScan);
107
+ reportFilename = "results_".concat(startScan.toISOString().replace(/:/g, "-"), ".xlsx");
108
+ if (config.outputFilenameTimestamp === false) {
109
+ reportFilename = "results.xlsx";
110
+ }
111
+ return [2 /*return*/, {
112
+ summaryPath: reportFilename,
113
+ summary: function (filename) { return __awaiter(_this, void 0, void 0, function () {
114
+ var workbook;
115
+ return __generator(this, function (_a) {
116
+ workbook = new ExcelJS.stream.xlsx.WorkbookWriter({ filename: filename, useStyles: true });
117
+ // const workbook = new ExcelJS.Workbook({ useStyles: true });
118
+ ACReporterXLSX.createOverviewSheet(config, summaryData, workbook);
119
+ ACReporterXLSX.createScanSummarySheet(config, summaryData, workbook);
120
+ ACReporterXLSX.createIssueSummarySheet(config, policyInfo, summaryData, workbook);
121
+ ACReporterXLSX.createIssuesSheet(config, policyInfo, summaryData, workbook);
122
+ ACReporterXLSX.createDefinitionsSheet(workbook);
123
+ workbook.commit();
124
+ return [2 /*return*/];
125
+ });
126
+ }); }
127
+ }];
128
+ });
124
129
  });
125
- }
126
- static createOverviewSheet(config, compressedScans, workbook) {
127
- let violations = 0;
128
- let needsReviews = 0;
129
- let recommendations = 0;
130
- let archived = 0;
131
- let totalIssues = 0;
132
- let startScan = 0;
130
+ };
131
+ ACReporterXLSX.createOverviewSheet = function (config, compressedScans, workbook) {
132
+ var violations = 0;
133
+ var needsReviews = 0;
134
+ var recommendations = 0;
135
+ var archived = 0;
136
+ var totalIssues = 0;
137
+ var startScan = 0;
133
138
  // BIG QUESTION: is report
134
139
  // 1. for current scan (from menu)
135
140
  // 2. all stored scans (from menu)
136
141
  // 3. selected stored scans (from scan manager)
137
- for (const compressedScan of compressedScans) {
138
- let storedScan = ReporterManager_js_1.ReporterManager.uncompressReport(compressedScan);
142
+ for (var _i = 0, compressedScans_1 = compressedScans; _i < compressedScans_1.length; _i++) {
143
+ var compressedScan = compressedScans_1[_i];
144
+ var storedScan = ReporterManager_js_1.ReporterManager.uncompressReport(compressedScan);
139
145
  if (startScan === 0)
140
146
  startScan = storedScan.engineReport.summary.startScan;
141
- const counts = storedScan.engineReport.summary.counts;
147
+ var counts = storedScan.engineReport.summary.counts;
142
148
  violations += counts.violation;
143
149
  needsReviews += counts.potentialviolation + counts.manual;
144
150
  recommendations += counts.recommendation + counts.potentialrecommendation;
145
151
  archived += counts.ignored;
146
152
  }
147
153
  totalIssues = violations + needsReviews + recommendations + archived;
148
- const worksheet = workbook.addWorksheet("Overview");
154
+ var worksheet = workbook.addWorksheet("Overview");
149
155
  // Report Title
150
156
  worksheet.mergeCells('A1', "E1");
151
- const titleRow = worksheet.getRow(1);
157
+ var titleRow = worksheet.getRow(1);
152
158
  titleRow.height = 27;
153
- const cellA1 = worksheet.getCell('A1');
159
+ var cellA1 = worksheet.getCell('A1');
154
160
  cellA1.value = "Accessibility Scan Report";
155
161
  cellA1.alignment = { vertical: "middle", horizontal: "left" };
156
162
  cellA1.font = { name: "Calibri", color: { argb: "FFFFFFFF" }, size: 16 };
157
163
  cellA1.fill = { type: 'pattern', pattern: 'solid', fgColor: { argb: 'FF403151' } };
158
164
  // what are column widths - can't get it till you set it
159
- const colWidthData = [
165
+ var colWidthData = [
160
166
  { col: 'A', width: 15.1 },
161
167
  { col: 'B', width: 15.9 },
162
168
  { col: 'C', width: 16.23 },
163
169
  { col: 'D', width: 19.4 },
164
170
  ];
165
- for (let i = 0; i < 4; i++) {
171
+ for (var i = 0; i < 4; i++) {
166
172
  worksheet.getColumn(colWidthData[i].col).width = colWidthData[i].width;
167
173
  }
168
174
  // note except for Report Date this is the same for all scans
169
- const rowData = [
175
+ var rowData = [
170
176
  { key1: 'Tool:', key2: 'IBM Equal Access Accessibility Checker' },
171
177
  // {key1: 'Version:', key2: "chrome.runtime.getManifest().version"},
172
178
  { key1: 'Version:', key2: config.toolID },
@@ -178,9 +184,9 @@ class ACReporterXLSX {
178
184
  { key1: 'Scans:', key2: "" + compressedScans.length }, // *** NEED TO FIX FOR selected
179
185
  // { key1: 'Pages:', key2: "" }
180
186
  ];
181
- for (let idx = 0; idx < rowData.length; ++idx) {
182
- worksheet.mergeCells(`B${idx + 2}`, `E${idx + 2}`);
183
- let i = idx + 2;
187
+ for (var idx = 0; idx < rowData.length; ++idx) {
188
+ worksheet.mergeCells("B".concat(idx + 2), "E".concat(idx + 2));
189
+ var i = idx + 2;
184
190
  worksheet.getRow(i).height = 12; // results in a row height of 16
185
191
  worksheet.getRow(i).getCell(1).font = { name: "Calibri", color: { argb: "FF000000" }, size: 12 };
186
192
  worksheet.getRow(i).getCell(2).font = { name: "Calibri", color: { argb: "FF000000" }, size: 12 };
@@ -195,27 +201,27 @@ class ACReporterXLSX {
195
201
  }
196
202
  // Summary Title
197
203
  worksheet.mergeCells('A11', "E11");
198
- const summaryRow = worksheet.getRow(11);
204
+ var summaryRow = worksheet.getRow(11);
199
205
  summaryRow.height = 27;
200
- const cellA11 = worksheet.getCell('A11');
206
+ var cellA11 = worksheet.getCell('A11');
201
207
  cellA11.value = "Summary";
202
208
  cellA11.alignment = { vertical: "middle", horizontal: "left" };
203
209
  cellA11.font = { name: "Calibri", color: { argb: "FFFFFFFF" }, size: 16 };
204
210
  cellA11.fill = { type: 'pattern', pattern: 'solid', fgColor: { argb: 'FF403151' } };
205
211
  // Scans info Headers
206
212
  worksheet.getRow(12).height = 16; // actual height is
207
- const cellA12 = worksheet.getCell('A12');
213
+ var cellA12 = worksheet.getCell('A12');
208
214
  cellA12.value = "Total issues";
209
- const cellB12 = worksheet.getCell('B12');
215
+ var cellB12 = worksheet.getCell('B12');
210
216
  cellB12.value = "Violations";
211
- const cellC12 = worksheet.getCell('C12');
217
+ var cellC12 = worksheet.getCell('C12');
212
218
  cellC12.value = "Needs review";
213
- const cellD12 = worksheet.getCell('D12');
219
+ var cellD12 = worksheet.getCell('D12');
214
220
  cellD12.value = "Recommendations";
215
- const cellE12 = worksheet.getCell('E12');
221
+ var cellE12 = worksheet.getCell('E12');
216
222
  cellE12.value = "Archived";
217
- const cellObjects1 = [cellA12, cellB12, cellC12, cellD12, cellE12];
218
- for (let i = 0; i < cellObjects1.length; i++) {
223
+ var cellObjects1 = [cellA12, cellB12, cellC12, cellD12, cellE12];
224
+ for (var i = 0; i < cellObjects1.length; i++) {
219
225
  cellObjects1[i].alignment = { vertical: "middle", horizontal: "center" };
220
226
  if (i == 1 || i == 2 || i == 3 || i === 4) {
221
227
  cellObjects1[i].font = { name: "Calibri", color: { argb: "FF000000" }, size: 12 };
@@ -237,18 +243,18 @@ class ACReporterXLSX {
237
243
  cellD12.fill = { type: 'pattern', pattern: 'solid', fgColor: { argb: 'FF96A9D7' } };
238
244
  // Scans info Values
239
245
  worksheet.getRow(13).height = 27; // actual height is
240
- const cellA13 = worksheet.getCell('A13');
246
+ var cellA13 = worksheet.getCell('A13');
241
247
  cellA13.value = totalIssues;
242
- const cellB13 = worksheet.getCell('B13');
248
+ var cellB13 = worksheet.getCell('B13');
243
249
  cellB13.value = violations;
244
- const cellC13 = worksheet.getCell('C13');
250
+ var cellC13 = worksheet.getCell('C13');
245
251
  cellC13.value = needsReviews;
246
- const cellD13 = worksheet.getCell('D13');
252
+ var cellD13 = worksheet.getCell('D13');
247
253
  cellD13.value = recommendations;
248
- const cellE13 = worksheet.getCell('E13');
254
+ var cellE13 = worksheet.getCell('E13');
249
255
  cellE13.value = archived;
250
- const cellObjects2 = [cellA13, cellB13, cellC13, cellD13, cellE13];
251
- for (let i = 0; i < cellObjects2.length; i++) {
256
+ var cellObjects2 = [cellA13, cellB13, cellC13, cellD13, cellE13];
257
+ for (var i = 0; i < cellObjects2.length; i++) {
252
258
  cellObjects2[i].alignment = { vertical: "middle", horizontal: "center" };
253
259
  cellObjects2[i].font = { name: "Calibri", color: { argb: "FF000000" }, size: 12 };
254
260
  // cellObjects2[i].fill = { type: 'pattern', pattern: 'solid', fgColor:{argb:'FFf8cbad'} };
@@ -259,12 +265,12 @@ class ACReporterXLSX {
259
265
  right: { style: 'thin', color: { argb: 'FFA6A6A6' } }
260
266
  };
261
267
  }
262
- }
263
- static createScanSummarySheet(config, compressedScans, workbook) {
264
- const worksheet = workbook.addWorksheet("Scan summary");
268
+ };
269
+ ACReporterXLSX.createScanSummarySheet = function (config, compressedScans, workbook) {
270
+ var worksheet = workbook.addWorksheet("Scan summary");
265
271
  // Scans info Headers
266
272
  worksheet.getRow(1).height = 39; // actual height is 52
267
- const colWidthData = [
273
+ var colWidthData = [
268
274
  { col: 'A', width: 27.0 },
269
275
  { col: 'B', width: 46.0 },
270
276
  { col: 'C', width: 20.17 },
@@ -275,17 +281,17 @@ class ACReporterXLSX {
275
281
  { col: 'H', width: 17.17 },
276
282
  { col: 'I', width: 17.17 },
277
283
  ];
278
- for (let i = 0; i < 9; i++) {
284
+ for (var i = 0; i < 9; i++) {
279
285
  worksheet.getColumn(colWidthData[i].col).width = colWidthData[i].width;
280
286
  }
281
- const cellA1 = worksheet.getCell('A1');
287
+ var cellA1 = worksheet.getCell('A1');
282
288
  cellA1.value = "Page title";
283
- const cellB1 = worksheet.getCell('B1');
289
+ var cellB1 = worksheet.getCell('B1');
284
290
  cellB1.value = "Page url";
285
- const cellC1 = worksheet.getCell('C1');
291
+ var cellC1 = worksheet.getCell('C1');
286
292
  cellC1.value = "Scan label";
287
- const cellObjects1 = [cellA1, cellB1, cellC1];
288
- for (let i = 0; i < cellObjects1.length; i++) {
293
+ var cellObjects1 = [cellA1, cellB1, cellC1];
294
+ for (var i = 0; i < cellObjects1.length; i++) {
289
295
  cellObjects1[i].alignment = { vertical: "middle", horizontal: "left" };
290
296
  cellObjects1[i].font = { name: "Calibri", color: { argb: "FFFFFFFF" }, size: 12 };
291
297
  cellObjects1[i].fill = { type: 'pattern', pattern: 'solid', fgColor: { argb: 'FF403151' } };
@@ -296,20 +302,20 @@ class ACReporterXLSX {
296
302
  right: { style: 'thin', color: { argb: 'FFA6A6A6' } }
297
303
  };
298
304
  }
299
- const cellD1 = worksheet.getCell('D1');
305
+ var cellD1 = worksheet.getCell('D1');
300
306
  cellD1.value = "Violations";
301
- const cellE1 = worksheet.getCell('E1');
307
+ var cellE1 = worksheet.getCell('E1');
302
308
  cellE1.value = "Needs review";
303
- const cellF1 = worksheet.getCell('F1');
309
+ var cellF1 = worksheet.getCell('F1');
304
310
  cellF1.value = "Recommendations";
305
- const cellG1 = worksheet.getCell('G1');
311
+ var cellG1 = worksheet.getCell('G1');
306
312
  cellG1.value = "Archived";
307
- const cellH1 = worksheet.getCell('H1');
313
+ var cellH1 = worksheet.getCell('H1');
308
314
  cellH1.value = "% elements without violations";
309
- const cellI1 = worksheet.getCell('I1');
315
+ var cellI1 = worksheet.getCell('I1');
310
316
  cellI1.value = "% elements without violations or items to review";
311
- const cellObjects2 = [cellD1, cellE1, cellF1, cellG1, cellH1, cellI1];
312
- for (let i = 0; i < cellObjects2.length; i++) {
317
+ var cellObjects2 = [cellD1, cellE1, cellF1, cellG1, cellH1, cellI1];
318
+ for (var i = 0; i < cellObjects2.length; i++) {
313
319
  cellObjects2[i].alignment = { vertical: "middle", horizontal: "center", wrapText: true };
314
320
  if (i == 0 || i == 1 || i == 2 || i == 3) {
315
321
  cellObjects2[i].font = { name: "Calibri", color: { argb: "FF000000" }, size: 12 };
@@ -331,10 +337,11 @@ class ACReporterXLSX {
331
337
  cellG1.fill = { type: 'pattern', pattern: 'solid', fgColor: { argb: 'FFFFFFFF' } };
332
338
  cellH1.fill = { type: 'pattern', pattern: 'solid', fgColor: { argb: 'FF000000' } };
333
339
  cellI1.fill = { type: 'pattern', pattern: 'solid', fgColor: { argb: 'FF000000' } };
334
- for (const compressedScan of compressedScans) {
335
- let storedScan = ReporterManager_js_1.ReporterManager.uncompressReport(compressedScan);
336
- let counts = storedScan.engineReport.summary.counts;
337
- let row = worksheet.addRow([
340
+ for (var _i = 0, compressedScans_2 = compressedScans; _i < compressedScans_2.length; _i++) {
341
+ var compressedScan = compressedScans_2[_i];
342
+ var storedScan = ReporterManager_js_1.ReporterManager.uncompressReport(compressedScan);
343
+ var counts = storedScan.engineReport.summary.counts;
344
+ var row = worksheet.addRow([
338
345
  storedScan.pageTitle,
339
346
  storedScan.engineReport.summary.URL,
340
347
  storedScan.label,
@@ -346,11 +353,11 @@ class ACReporterXLSX {
346
353
  (100 * (counts.elements - counts.elementsViolationReview) / counts.elements).toFixed(0),
347
354
  ]);
348
355
  row.height = 37; // actual height is
349
- for (let i = 1; i < 4; i++) {
356
+ for (var i = 1; i < 4; i++) {
350
357
  row.getCell(i).alignment = { vertical: "middle", horizontal: "left", wrapText: true };
351
358
  row.getCell(i).font = { name: "Calibri", color: { argb: "00000000" }, size: 12 };
352
359
  }
353
- for (let i = 4; i < 10; i++) {
360
+ for (var i = 4; i < 10; i++) {
354
361
  row.getCell(i).alignment = { vertical: "middle", horizontal: "center", wrapText: true };
355
362
  row.getCell(i).font = { name: "Calibri", color: { argb: "00000000" }, size: 12 };
356
363
  // row.getCell(i).fill = { type: 'pattern', pattern: 'solid', fgColor:{argb:'FFf8cbad'} };
@@ -364,13 +371,13 @@ class ACReporterXLSX {
364
371
  row.commit();
365
372
  }
366
373
  worksheet.commit();
367
- }
368
- static buildIssueSummaryLevel(worksheet, fillColor, title, levelCount, levelrowValues) {
374
+ };
375
+ ACReporterXLSX.buildIssueSummaryLevel = function (worksheet, fillColor, title, levelCount, levelrowValues) {
369
376
  // Level 1 Violation title
370
- const level1ViolationRow = worksheet.addRow(["", 0]);
377
+ var level1ViolationRow = worksheet.addRow(["", 0]);
371
378
  level1ViolationRow.height = 18; // target is 21
372
- const cellA6 = level1ViolationRow.getCell(1);
373
- cellA6.value = ` ${title}`;
379
+ var cellA6 = level1ViolationRow.getCell(1);
380
+ cellA6.value = " ".concat(title);
374
381
  cellA6.alignment = { vertical: "middle", horizontal: "left" };
375
382
  cellA6.font = { name: "Calibri", color: { argb: "FF000000" }, size: 12 };
376
383
  cellA6.fill = { type: 'pattern', pattern: 'solid', fgColor: { argb: fillColor } };
@@ -380,7 +387,7 @@ class ACReporterXLSX {
380
387
  bottom: { style: 'thin', color: { argb: 'FFA6A6A6' } },
381
388
  // right: {style:'thin', color: {argb: 'FFA6A6A6'}}
382
389
  };
383
- const cellB6 = level1ViolationRow.getCell(2);
390
+ var cellB6 = level1ViolationRow.getCell(2);
384
391
  cellB6.value = levelCount; // total level violations
385
392
  cellB6.alignment = { vertical: "middle", horizontal: "right" };
386
393
  cellB6.font = { name: "Calibri", color: { argb: "FF000000" }, size: 12 };
@@ -393,18 +400,19 @@ class ACReporterXLSX {
393
400
  };
394
401
  // Level 1 Violation Rows
395
402
  // build rows
396
- let rowArray = [];
403
+ var rowArray = [];
397
404
  // let row:any =[];
398
- for (const property in levelrowValues) {
399
- let row = [" " + `${property}`, parseInt(`${levelrowValues[property]}`)
405
+ for (var property in levelrowValues) {
406
+ var row = [" " + "".concat(property), parseInt("".concat(levelrowValues[property]))
400
407
  ];
401
408
  rowArray.push(row);
402
409
  }
403
410
  // sort array according to count
404
- rowArray.sort((a, b) => (a[1] < b[1]) ? 1 : -1);
411
+ rowArray.sort(function (a, b) { return (a[1] < b[1]) ? 1 : -1; });
405
412
  // add array of rows
406
- for (const rowInfo of rowArray) {
407
- const row = worksheet.addRow(rowInfo);
413
+ for (var _i = 0, rowArray_1 = rowArray; _i < rowArray_1.length; _i++) {
414
+ var rowInfo = rowArray_1[_i];
415
+ var row = worksheet.addRow(rowInfo);
408
416
  row.height = 14;
409
417
  row.getCell(1).alignment = { vertical: "middle", horizontal: "left" };
410
418
  row.getCell(2).alignment = { vertical: "middle", horizontal: "right" };
@@ -425,19 +433,19 @@ class ACReporterXLSX {
425
433
  };
426
434
  row.commit();
427
435
  }
428
- }
429
- static buildIssueSummaryTKLevel(worksheet, title, levelCounts, levelVrowValues, levelNRrowValues, levelRrowValues, levelArowValues) {
436
+ };
437
+ ACReporterXLSX.buildIssueSummaryTKLevel = function (worksheet, title, levelCounts, levelVrowValues, levelNRrowValues, levelRrowValues, levelArowValues) {
430
438
  /////////////////////////////
431
439
  // build Level title
432
440
  /////////////////////////////
433
- const level1Row = worksheet.addRow(["", 0]);
441
+ var level1Row = worksheet.addRow(["", 0]);
434
442
  level1Row.height = 27; // actual is 36
435
- const cellA5 = level1Row.getCell(1);
443
+ var cellA5 = level1Row.getCell(1);
436
444
  cellA5.value = title;
437
445
  cellA5.alignment = { vertical: "middle", horizontal: "left" };
438
446
  cellA5.font = { name: "Calibri", color: { argb: "FFFFFFFF" }, size: 16 };
439
447
  cellA5.fill = { type: 'pattern', pattern: 'solid', fgColor: { argb: 'FF403151' } };
440
- const cellB5 = level1Row.getCell(2);
448
+ var cellB5 = level1Row.getCell(2);
441
449
  cellB5.value = levelCounts[0]; // total Level 1 issues
442
450
  cellB5.alignment = { vertical: "middle", horizontal: "right" };
443
451
  cellB5.font = { name: "Calibri", color: { argb: "FFFFFFFF" }, size: 16 };
@@ -448,16 +456,16 @@ class ACReporterXLSX {
448
456
  if (levelCounts[4] > 0) {
449
457
  ACReporterXLSX.buildIssueSummaryLevel(worksheet, "FFCCCCCC", "Archived", levelCounts[4], levelArowValues);
450
458
  }
451
- }
452
- static createIssueSummarySheet(config, policyInfo, compressedScans, workbook) {
453
- let violations = 0;
454
- let needsReviews = 0;
455
- let recommendations = 0;
456
- let archive = 0;
457
- let totalIssues = 0;
458
- for (let i = 0; i < compressedScans.length; i++) {
459
- let storedScan = ReporterManager_js_1.ReporterManager.uncompressReport(compressedScans[i]);
460
- let counts = storedScan.engineReport.summary.counts;
459
+ };
460
+ ACReporterXLSX.createIssueSummarySheet = function (config, policyInfo, compressedScans, workbook) {
461
+ var violations = 0;
462
+ var needsReviews = 0;
463
+ var recommendations = 0;
464
+ var archive = 0;
465
+ var totalIssues = 0;
466
+ for (var i = 0; i < compressedScans.length; i++) {
467
+ var storedScan = ReporterManager_js_1.ReporterManager.uncompressReport(compressedScans[i]);
468
+ var counts = storedScan.engineReport.summary.counts;
461
469
  violations += counts.violation;
462
470
  needsReviews += counts.potentialviolation + counts.manual;
463
471
  recommendations += counts.recommendation + counts.potentialrecommendation;
@@ -465,37 +473,39 @@ class ACReporterXLSX {
465
473
  }
466
474
  totalIssues = violations + needsReviews + recommendations;
467
475
  // counts
468
- let level1Counts = [0, 0, 0, 0, 0]; // level 1 total issues, violations, needs reviews, recommendations
469
- let level2Counts = [0, 0, 0, 0, 0];
470
- let level3Counts = [0, 0, 0, 0, 0];
471
- let level4Counts = [0, 0, 0, 0, 0];
472
- let level1V = [];
473
- let level2V = [];
474
- let level3V = [];
475
- let level4V = [];
476
- let level1NR = [];
477
- let level2NR = [];
478
- let level3NR = [];
479
- let level4NR = [];
480
- let level1R = [];
481
- let level2R = [];
482
- let level3R = [];
483
- let level4R = [];
484
- let level1A = [];
485
- let level2A = [];
486
- let level3A = [];
487
- let level4A = [];
488
- for (const compressedScan of compressedScans) {
489
- let scan = ReporterManager_js_1.ReporterManager.uncompressReport(compressedScan);
490
- for (const issue of scan.engineReport.results) {
476
+ var level1Counts = [0, 0, 0, 0, 0]; // level 1 total issues, violations, needs reviews, recommendations
477
+ var level2Counts = [0, 0, 0, 0, 0];
478
+ var level3Counts = [0, 0, 0, 0, 0];
479
+ var level4Counts = [0, 0, 0, 0, 0];
480
+ var level1V = [];
481
+ var level2V = [];
482
+ var level3V = [];
483
+ var level4V = [];
484
+ var level1NR = [];
485
+ var level2NR = [];
486
+ var level3NR = [];
487
+ var level4NR = [];
488
+ var level1R = [];
489
+ var level2R = [];
490
+ var level3R = [];
491
+ var level4R = [];
492
+ var level1A = [];
493
+ var level2A = [];
494
+ var level3A = [];
495
+ var level4A = [];
496
+ for (var _i = 0, compressedScans_3 = compressedScans; _i < compressedScans_3.length; _i++) {
497
+ var compressedScan = compressedScans_3[_i];
498
+ var scan = ReporterManager_js_1.ReporterManager.uncompressReport(compressedScan);
499
+ for (var _a = 0, _b = scan.engineReport.results; _a < _b.length; _a++) {
500
+ var issue = _b[_a];
491
501
  if (!(issue.ruleId in policyInfo)) {
492
502
  policyInfo[issue.ruleId] = {
493
503
  tkLevels: [],
494
504
  cps: []
495
505
  };
496
506
  }
497
- let levelCounts, levelV, levelNR, levelR, levelA;
498
- const issuePolicyInfo = policyInfo[issue.ruleId];
507
+ var levelCounts = void 0, levelV = void 0, levelNR = void 0, levelR = void 0, levelA = void 0;
508
+ var issuePolicyInfo = policyInfo[issue.ruleId];
499
509
  if (issuePolicyInfo.tkLevels.includes(IGuideline_js_1.eToolkitLevel.LEVEL_ONE)) {
500
510
  levelCounts = level1Counts;
501
511
  levelV = level1V;
@@ -546,38 +556,38 @@ class ACReporterXLSX {
546
556
  }
547
557
  }
548
558
  // @ts-ignore
549
- let level1VrowValues = this.countDuplicatesInArray(level1V); // note this returns an object
559
+ var level1VrowValues = this.countDuplicatesInArray(level1V); // note this returns an object
550
560
  // @ts-ignore
551
- let level1NRrowValues = this.countDuplicatesInArray(level1NR);
561
+ var level1NRrowValues = this.countDuplicatesInArray(level1NR);
552
562
  // @ts-ignore
553
- let level1RrowValues = this.countDuplicatesInArray(level1R);
563
+ var level1RrowValues = this.countDuplicatesInArray(level1R);
554
564
  // @ts-ignore
555
- let level1ArowValues = this.countDuplicatesInArray(level1A);
565
+ var level1ArowValues = this.countDuplicatesInArray(level1A);
556
566
  // @ts-ignore
557
- let level2VrowValues = this.countDuplicatesInArray(level2V); // note this returns an object
567
+ var level2VrowValues = this.countDuplicatesInArray(level2V); // note this returns an object
558
568
  // @ts-ignore
559
- let level2NRrowValues = this.countDuplicatesInArray(level2NR);
569
+ var level2NRrowValues = this.countDuplicatesInArray(level2NR);
560
570
  // @ts-ignore
561
- let level2RrowValues = this.countDuplicatesInArray(level2R);
571
+ var level2RrowValues = this.countDuplicatesInArray(level2R);
562
572
  // @ts-ignore
563
- let level2ArowValues = this.countDuplicatesInArray(level2A);
573
+ var level2ArowValues = this.countDuplicatesInArray(level2A);
564
574
  // @ts-ignore
565
- let level3VrowValues = this.countDuplicatesInArray(level3V); // note this returns an object
575
+ var level3VrowValues = this.countDuplicatesInArray(level3V); // note this returns an object
566
576
  // @ts-ignore
567
- let level3NRrowValues = this.countDuplicatesInArray(level3NR);
577
+ var level3NRrowValues = this.countDuplicatesInArray(level3NR);
568
578
  // @ts-ignore
569
- let level3RrowValues = this.countDuplicatesInArray(level3R);
579
+ var level3RrowValues = this.countDuplicatesInArray(level3R);
570
580
  // @ts-ignore
571
- let level3ArowValues = this.countDuplicatesInArray(level3A);
581
+ var level3ArowValues = this.countDuplicatesInArray(level3A);
572
582
  // @ts-ignore
573
- let level4VrowValues = this.countDuplicatesInArray(level4V); // note this returns an object
583
+ var level4VrowValues = this.countDuplicatesInArray(level4V); // note this returns an object
574
584
  // @ts-ignore
575
- let level4NRrowValues = this.countDuplicatesInArray(level4NR);
585
+ var level4NRrowValues = this.countDuplicatesInArray(level4NR);
576
586
  // @ts-ignore
577
- let level4RrowValues = this.countDuplicatesInArray(level4R);
587
+ var level4RrowValues = this.countDuplicatesInArray(level4R);
578
588
  // @ts-ignore
579
- let level4ArowValues = this.countDuplicatesInArray(level4A);
580
- const worksheet = workbook.addWorksheet("Issue summary");
589
+ var level4ArowValues = this.countDuplicatesInArray(level4A);
590
+ var worksheet = workbook.addWorksheet("Issue summary");
581
591
  // Approach:
582
592
  // 1. sort by levels
583
593
  // 2. for each level sort by V, NR and R
@@ -585,47 +595,47 @@ class ACReporterXLSX {
585
595
  // 4. build the rows
586
596
  // build Issue summary title
587
597
  worksheet.mergeCells('A1', "B1");
588
- const titleRow = worksheet.getRow(1);
598
+ var titleRow = worksheet.getRow(1);
589
599
  titleRow.height = 27; // actual is 36
590
- const cellA1 = worksheet.getCell('A1');
600
+ var cellA1 = worksheet.getCell('A1');
591
601
  cellA1.value = "Issue summary";
592
602
  cellA1.alignment = { vertical: "middle", horizontal: "left" };
593
603
  cellA1.font = { name: "Calibri", color: { argb: "FFFFFFFF" }, size: 16 };
594
604
  cellA1.fill = { type: 'pattern', pattern: 'solid', fgColor: { argb: 'FF403151' } };
595
- const colWidthData = [
605
+ var colWidthData = [
596
606
  { col: 'A', width: 155.51 }, // note .84 added to actual width
597
607
  { col: 'B', width: 21.16 },
598
608
  ];
599
- for (let i = 0; i < 2; i++) {
609
+ for (var i = 0; i < 2; i++) {
600
610
  worksheet.getColumn(colWidthData[i].col).width = colWidthData[i].width;
601
611
  }
602
612
  // build Description title
603
613
  worksheet.mergeCells('A2', "B2");
604
- const descriptionRow = worksheet.getRow(2);
614
+ var descriptionRow = worksheet.getRow(2);
605
615
  descriptionRow.height = 20.25; // actual is 27
606
- const cellA2 = worksheet.getCell("A2");
616
+ var cellA2 = worksheet.getCell("A2");
607
617
  cellA2.value = " In the IBM Equal Access Toolkit, issues are divided into three levels (1-3). Tackle the levels in order to address some of the most impactful issues first.";
608
618
  cellA2.alignment = { vertical: "middle", horizontal: "left" };
609
619
  cellA2.font = { name: "Calibri", color: { argb: "FF000000" }, size: 12 };
610
620
  // cellA2.fill = { type: 'pattern', pattern: 'solid', fgColor:{argb:'FFCCC0DA'} };
611
621
  // build Total issues found: title
612
622
  // worksheet.mergeCells('A3', "B3");
613
- const totalIssuesRow = worksheet.getRow(3);
623
+ var totalIssuesRow = worksheet.getRow(3);
614
624
  totalIssuesRow.height = 27; // actual is 36
615
- const cellA3 = worksheet.getCell("A3");
625
+ var cellA3 = worksheet.getCell("A3");
616
626
  cellA3.value = "Total issues found:";
617
627
  cellA3.alignment = { vertical: "middle", horizontal: "left" };
618
628
  cellA3.font = { name: "Calibri", color: { argb: "FFFFFFFF" }, size: 16 };
619
629
  cellA3.fill = { type: 'pattern', pattern: 'solid', fgColor: { argb: 'FF000000' } };
620
- const cellB3 = worksheet.getCell("B3");
630
+ var cellB3 = worksheet.getCell("B3");
621
631
  cellB3.value = totalIssues;
622
632
  cellB3.alignment = { vertical: "middle", horizontal: "right" };
623
633
  cellB3.font = { name: "Calibri", color: { argb: "FFFFFFFF" }, size: 16 };
624
634
  cellB3.fill = { type: 'pattern', pattern: 'solid', fgColor: { argb: 'FF000000' } };
625
635
  // build Number of issues title
626
- const numberOfIssuesRow = worksheet.getRow(4);
636
+ var numberOfIssuesRow = worksheet.getRow(4);
627
637
  numberOfIssuesRow.height = 20.25; // actual is 27
628
- const cellA4 = worksheet.getCell("A4");
638
+ var cellA4 = worksheet.getCell("A4");
629
639
  // no value
630
640
  cellA4.alignment = { vertical: "middle", horizontal: "left" };
631
641
  cellA4.border = {
@@ -634,7 +644,7 @@ class ACReporterXLSX {
634
644
  bottom: { style: 'thin', color: { argb: 'FFA6A6A6' } },
635
645
  right: { style: 'thin', color: { argb: 'FFFFFFFF' } }
636
646
  };
637
- const cellB4 = worksheet.getCell("B4");
647
+ var cellB4 = worksheet.getCell("B4");
638
648
  cellB4.value = "Number of issues";
639
649
  cellB4.alignment = { vertical: "middle", horizontal: "right" };
640
650
  cellB4.font = { name: "Calibri", color: { argb: "FF000000" }, size: 12 };
@@ -649,9 +659,9 @@ class ACReporterXLSX {
649
659
  ACReporterXLSX.buildIssueSummaryTKLevel(worksheet, "Level 3 - necessary to meet requirements", level3Counts, level3VrowValues, level3NRrowValues, level3RrowValues, level3ArowValues);
650
660
  ACReporterXLSX.buildIssueSummaryTKLevel(worksheet, "Level 4 - further recommended improvements to accessibility", level4Counts, level4VrowValues, level4NRrowValues, level4RrowValues, level4ArowValues);
651
661
  worksheet.commit();
652
- }
653
- static createIssuesSheet(config, policyInfo, compressedScans, workbook) {
654
- const valueMap = {
662
+ };
663
+ ACReporterXLSX.createIssuesSheet = function (config, policyInfo, compressedScans, workbook) {
664
+ var valueMap = {
655
665
  "VIOLATION": {
656
666
  "POTENTIAL": "Needs review",
657
667
  "FAIL": "Violation",
@@ -671,39 +681,40 @@ class ACReporterXLSX {
671
681
  "MANUAL": "Recommendation"
672
682
  }
673
683
  };
674
- const worksheet = workbook.addWorksheet("Issues");
684
+ var worksheet = workbook.addWorksheet("Issues");
675
685
  // build rows
676
- let rowArray = [];
677
- for (const compressedScan of compressedScans) {
678
- let storedScan = ReporterManager_js_1.ReporterManager.uncompressReport(compressedScan);
679
- for (const item of storedScan.engineReport.results) {
686
+ var rowArray = [];
687
+ for (var _i = 0, compressedScans_4 = compressedScans; _i < compressedScans_4.length; _i++) {
688
+ var compressedScan = compressedScans_4[_i];
689
+ var storedScan = ReporterManager_js_1.ReporterManager.uncompressReport(compressedScan);
690
+ var _loop_1 = function (item) {
680
691
  if (!(item.ruleId in policyInfo)) {
681
692
  policyInfo[item.ruleId] = {
682
693
  tkLevels: [],
683
694
  cps: []
684
695
  };
685
696
  }
686
- let polInfo = policyInfo[item.ruleId];
687
- let cps = polInfo.cps.filter(cp => {
688
- let ruleInfo = cp.rules.find(ruleInfo => ruleInfo.id === item.ruleId && (!ruleInfo.reasonCodes || ruleInfo.reasonCodes.includes("" + item.reasonId)));
697
+ var polInfo = policyInfo[item.ruleId];
698
+ var cps = polInfo.cps.filter(function (cp) {
699
+ var ruleInfo = cp.rules.find(function (ruleInfo) { return ruleInfo.id === item.ruleId && (!ruleInfo.reasonCodes || ruleInfo.reasonCodes.includes("" + item.reasonId)); });
689
700
  return !!ruleInfo;
690
701
  });
691
- let wcagLevels = dropDupes(cps.map(cp => cp.wcagLevel));
702
+ var wcagLevels = dropDupes(cps.map(function (cp) { return cp.wcagLevel; }));
692
703
  wcagLevels.sort();
693
- let cpStrs = dropDupes(cps.map(cp => `${cp.num} ${cp.name}`));
704
+ var cpStrs = dropDupes(cps.map(function (cp) { return "".concat(cp.num, " ").concat(cp.name); }));
694
705
  cpStrs.sort();
695
- let row = [
706
+ var row = [
696
707
  storedScan.pageTitle,
697
708
  storedScan.engineReport.summary.URL,
698
709
  storedScan.label,
699
- this.stringHash(item.ruleId + item.path.dom),
700
- `${valueMap[item.value[0]][item.value[1]]}${item.ignored ? ` (Archived)` : ``}`,
710
+ this_1.stringHash(item.ruleId + item.path.dom),
711
+ "".concat(valueMap[item.value[0]][item.value[1]]).concat(item.ignored ? " (Archived)" : ""),
701
712
  polInfo.tkLevels.join(", "),
702
713
  cpStrs.join("; "),
703
714
  wcagLevels.join(", "),
704
715
  item.ruleId,
705
716
  item.message.substring(0, 32767), //max ength for MS Excel 32767 characters
706
- this.get_element(item.snippet),
717
+ this_1.get_element(item.snippet),
707
718
  item.snippet.substring(0, 32767),
708
719
  item.path.dom,
709
720
  item.help
@@ -716,10 +727,15 @@ class ACReporterXLSX {
716
727
  // myStoredData[i][12], myStoredData[i][13]
717
728
  // ];
718
729
  rowArray.push(row);
730
+ };
731
+ var this_1 = this;
732
+ for (var _a = 0, _b = storedScan.engineReport.results; _a < _b.length; _a++) {
733
+ var item = _b[_a];
734
+ _loop_1(item);
719
735
  }
720
736
  }
721
737
  // column widths
722
- const colWidthData = [
738
+ var colWidthData = [
723
739
  { col: 'A', width: 18.0, alignment: { vertical: "middle", horizontal: "left" } },
724
740
  { col: 'B', width: 20.5, alignment: { vertical: "middle", horizontal: "left" } },
725
741
  { col: 'C', width: 21.0, alignment: { vertical: "middle", horizontal: "center" } },
@@ -735,12 +751,12 @@ class ACReporterXLSX {
735
751
  { col: 'M', width: 43.00, alignment: { vertical: "middle", horizontal: "left" } },
736
752
  { col: 'N', width: 17.17, alignment: { vertical: "middle", horizontal: "fill" } },
737
753
  ];
738
- for (let i = 0; i < 14; i++) {
754
+ for (var i = 0; i < 14; i++) {
739
755
  worksheet.getColumn(colWidthData[i].col).width = colWidthData[i].width;
740
756
  worksheet.getColumn(colWidthData[i].col).alignment = colWidthData[i].alignment;
741
757
  }
742
758
  // add table to a sheet
743
- let headRow = worksheet.addRow([
759
+ var headRow = worksheet.addRow([
744
760
  "Page title",
745
761
  "Page URL",
746
762
  "Scan label",
@@ -758,7 +774,7 @@ class ACReporterXLSX {
758
774
  ""
759
775
  ]);
760
776
  // set font and alignment for the header cells
761
- for (let i = 1; i < 15; i++) {
777
+ for (var i = 1; i < 15; i++) {
762
778
  headRow.getCell(i).alignment = { vertical: "middle", horizontal: "center", wrapText: true };
763
779
  headRow.getCell(i).font = { name: "Calibri", color: { argb: "FFFFFFFF" }, size: 12 };
764
780
  headRow.getCell(i).fill = { type: 'pattern', pattern: 'solid', fgColor: { argb: 'FF403151' } };
@@ -772,10 +788,11 @@ class ACReporterXLSX {
772
788
  // height for header row
773
789
  headRow.height = 24;
774
790
  headRow.commit();
775
- for (const rowInfo of rowArray) {
776
- const row = worksheet.addRow(rowInfo);
791
+ for (var _c = 0, rowArray_2 = rowArray; _c < rowArray_2.length; _c++) {
792
+ var rowInfo = rowArray_2[_c];
793
+ var row = worksheet.addRow(rowInfo);
777
794
  row.height = 14;
778
- for (let j = 1; j <= 14; j++) {
795
+ for (var j = 1; j <= 14; j++) {
779
796
  row.getCell(j).border = {
780
797
  top: { style: 'thin', color: { argb: 'FFA6A6A6' } },
781
798
  left: { style: 'thin', color: { argb: 'FFA6A6A6' } },
@@ -785,7 +802,7 @@ class ACReporterXLSX {
785
802
  }
786
803
  row.commit();
787
804
  }
788
- for (const key in worksheet) {
805
+ for (var key in worksheet) {
789
806
  if (typeof worksheet[key] === "function") {
790
807
  console.log(key);
791
808
  }
@@ -830,38 +847,38 @@ class ACReporterXLSX {
830
847
  // worksheet.getRow(i).commit();
831
848
  // }
832
849
  worksheet.commit();
833
- }
834
- static createDefinitionsSheet(workbook) {
835
- const worksheet = workbook.addWorksheet("Definition of fields");
850
+ };
851
+ ACReporterXLSX.createDefinitionsSheet = function (workbook) {
852
+ var worksheet = workbook.addWorksheet("Definition of fields");
836
853
  // "Definition of fields" title
837
854
  worksheet.mergeCells('A1', "B1");
838
- const titleRow = worksheet.getRow(1);
855
+ var titleRow = worksheet.getRow(1);
839
856
  titleRow.height = 36; // actual is 48
840
857
  titleRow.getCell(1).value = "Definition of fields";
841
858
  titleRow.getCell(1).alignment = { vertical: "middle", horizontal: "left" };
842
859
  titleRow.getCell(1).font = { name: "Calibri", color: { argb: "FFFFFFFF" }, size: "20" };
843
860
  titleRow.getCell(1).fill = { type: 'pattern', pattern: 'solid', fgColor: { argb: 'FF403151' } };
844
- const colWidthData = [
861
+ var colWidthData = [
845
862
  { col: 'A', width: '41.51' }, // note .84 added to actual width
846
863
  { col: 'B', width: '119.51' },
847
864
  ];
848
- for (let i = 0; i < 2; i++) {
865
+ for (var i = 0; i < 2; i++) {
849
866
  worksheet.getColumn(colWidthData[i].col).width = colWidthData[i].width;
850
867
  }
851
868
  // blank row
852
869
  worksheet.mergeCells('A2', "B2");
853
- const blankRow = worksheet.getRow(2);
870
+ var blankRow = worksheet.getRow(2);
854
871
  blankRow.height = 12; // actual is 16
855
872
  // "Scan summary and Issue summary" title
856
873
  worksheet.mergeCells('A3', "B3");
857
- const summaryRow = worksheet.getRow(3);
874
+ var summaryRow = worksheet.getRow(3);
858
875
  summaryRow.height = 20; // actual is 26.75
859
876
  summaryRow.getCell(1).value = "Scan summary and Issue summary";
860
877
  summaryRow.getCell(1).alignment = { vertical: "middle", horizontal: "left" };
861
878
  summaryRow.getCell(1).font = { name: "Calibri", color: { argb: "FFFFFFFF" }, size: 16 };
862
879
  summaryRow.getCell(1).fill = { type: 'pattern', pattern: 'solid', fgColor: { argb: 'FF403151' } };
863
880
  // row 4 Field / Definition
864
- const row4 = worksheet.getRow(4);
881
+ var row4 = worksheet.getRow(4);
865
882
  row4.height = 16; // actual is
866
883
  row4.getCell(1).value = "Field";
867
884
  row4.getCell(2).value = "Definition";
@@ -876,10 +893,10 @@ class ACReporterXLSX {
876
893
  };
877
894
  // rows 5-13
878
895
  // set row height for rows 5-13
879
- for (let i = 5; i < 14; i++) {
896
+ for (var i = 5; i < 14; i++) {
880
897
  worksheet.getRow(i).height = 12; // results in a row height of 16
881
898
  }
882
- let rowData = [
899
+ var rowData = [
883
900
  { key1: 'Page', key2: 'Identifies the page or html file that was scanned.' },
884
901
  { key1: 'Scan label', key2: 'Label for the scan. Default values can be edited in the Accessibility Checker before saving this report, or programmatically assigned in automated testing.' },
885
902
  { key1: 'Violations', key2: 'Accessibility failures that need to be corrected.' },
@@ -889,24 +906,24 @@ class ACReporterXLSX {
889
906
  { key1: '% elements without violations or items to review', key2: 'Percentage of elements on the page that had no violations found and no items to review.' },
890
907
  { key1: 'Level 1,2,3', key2: 'Priority level defined by the IBM Equal Access Toolkit. See https://www.ibm.com/able/toolkit/plan/overview#pace-of-completion for details.' }
891
908
  ];
892
- for (let i = 5; i < rowData.length + 5; i++) {
909
+ for (var i = 5; i < rowData.length + 5; i++) {
893
910
  worksheet.getRow(i).getCell(1).font = worksheet.getRow(i).getCell(2).font = { name: "Calibri", color: { argb: "FF000000" }, size: 12 };
894
911
  worksheet.getRow(i).getCell(1).alignment = worksheet.getRow(i).getCell(2).alignment = { horizontal: "left" };
895
912
  }
896
- for (let i = 5; i < rowData.length + 5; i++) {
913
+ for (var i = 5; i < rowData.length + 5; i++) {
897
914
  worksheet.getRow(i).getCell(1).value = rowData[i - 5].key1;
898
915
  worksheet.getRow(i).getCell(2).value = rowData[i - 5].key2;
899
916
  }
900
917
  // "Scan summary and Issue summary" title
901
918
  worksheet.mergeCells('A14', "B14");
902
- const issuesRow = worksheet.getRow(14);
919
+ var issuesRow = worksheet.getRow(14);
903
920
  issuesRow.height = 20; // actual is 26.75
904
921
  issuesRow.getCell(1).value = "Issues";
905
922
  issuesRow.getCell(1).alignment = { vertical: "middle", horizontal: "left" };
906
923
  issuesRow.getCell(1).font = { name: "Calibri", color: { argb: "FFFFFFFF" }, size: 16 };
907
924
  issuesRow.getCell(1).fill = { type: 'pattern', pattern: 'solid', fgColor: { argb: 'FF403151' } };
908
925
  // row 15 Field / Definition
909
- const row15 = worksheet.getRow(15);
926
+ var row15 = worksheet.getRow(15);
910
927
  row15.height = 16; // actual is
911
928
  row15.getCell(1).value = "Field";
912
929
  row15.getCell(2).value = "Definition";
@@ -921,7 +938,7 @@ class ACReporterXLSX {
921
938
  };
922
939
  // rows 16-28
923
940
  // set row height for rows 16-28
924
- for (let i = 16; i < 29; i++) {
941
+ for (var i = 16; i < 29; i++) {
925
942
  worksheet.getRow(i).height = 12; // results in a row height of 16
926
943
  }
927
944
  rowData = [];
@@ -940,20 +957,20 @@ class ACReporterXLSX {
940
957
  { key1: 'Xpath', key2: 'Xpath of the HTML element where the issue is found.' },
941
958
  { key1: 'Help', key2: 'Link to a more detailed description of the issue and suggested solutions.' },
942
959
  ];
943
- for (let i = 16; i < 29; i++) {
960
+ for (var i = 16; i < 29; i++) {
944
961
  worksheet.getRow(i).getCell(1).font = worksheet.getRow(i).getCell(2).font = { name: "Calibri", color: { argb: "FF000000" }, size: 12 };
945
962
  worksheet.getRow(i).getCell(1).alignment = worksheet.getRow(i).getCell(2).alignment = { horizontal: "left" };
946
963
  }
947
- for (let i = 16; i < 29; i++) {
964
+ for (var i = 16; i < 29; i++) {
948
965
  worksheet.getRow(i).getCell(1).value = rowData[i - 16].key1;
949
966
  worksheet.getRow(i).getCell(2).value = rowData[i - 16].key2;
950
967
  }
951
968
  worksheet.commit();
952
- }
953
- static countDuplicatesInArray(array) {
954
- let count = {};
969
+ };
970
+ ACReporterXLSX.countDuplicatesInArray = function (array) {
971
+ var count = {};
955
972
  // let result = [];
956
- array.forEach(item => {
973
+ array.forEach(function (item) {
957
974
  if (count[item]) {
958
975
  //@ts-ignore
959
976
  count[item] += 1;
@@ -963,25 +980,25 @@ class ACReporterXLSX {
963
980
  count[item] = 1;
964
981
  });
965
982
  return count;
966
- }
967
- static get_element(code) {
983
+ };
984
+ ACReporterXLSX.get_element = function (code) {
968
985
  if (code) {
969
- const ind_s = code.indexOf(' ');
970
- const ind_br = code.indexOf('>');
986
+ var ind_s = code.indexOf(' ');
987
+ var ind_br = code.indexOf('>');
971
988
  return (ind_s > 0 && ind_s < ind_br) ? code.substring(1, ind_s) : code.substring(1, ind_br);
972
989
  }
973
990
  return '';
974
- }
975
- static format_date(timestamp) {
991
+ };
992
+ ACReporterXLSX.format_date = function (timestamp) {
976
993
  var date = new Date(timestamp);
977
994
  return date.getFullYear() + '-' + ("00" + (date.getMonth() + 1)).slice(-2) + "-" +
978
995
  ("00" + date.getDate()).slice(-2) + "-" +
979
996
  ("00" + date.getHours()).slice(-2) + "-" +
980
997
  ("00" + date.getMinutes()).slice(-2) + "-" +
981
998
  ("00" + date.getSeconds()).slice(-2);
982
- }
999
+ };
983
1000
  // From https://github.com/darkskyapp/string-hash/blob/master/index.js
984
- static stringHash(str) {
1001
+ ACReporterXLSX.stringHash = function (str) {
985
1002
  var hash = 5381, i = str.length;
986
1003
  while (i) {
987
1004
  hash = (hash * 33) ^ str.charCodeAt(--i);
@@ -990,7 +1007,8 @@ class ACReporterXLSX {
990
1007
  * integers. Since we want the results to be always positive, convert the
991
1008
  * signed int to an unsigned by doing an unsigned bitshift. */
992
1009
  return hash >>> 0;
993
- }
994
- }
1010
+ };
1011
+ return ACReporterXLSX;
1012
+ }());
995
1013
  exports.ACReporterXLSX = ACReporterXLSX;
996
1014
  //# sourceMappingURL=ACReporterXLSX.js.map