binary-collections 2.0.9 → 2.0.10

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 (253) hide show
  1. package/binaries/binary-executor.cjs +43 -0
  2. package/{bin → binaries}/clean-nodemodule +0 -0
  3. package/binaries/clean-nodemodule.cjs +43 -0
  4. package/binaries/clean-nodemodule.cmd +4 -0
  5. package/{bin → binaries}/clean-nodemodules +0 -0
  6. package/binaries/clean-nodemodules.cjs +43 -0
  7. package/binaries/clean-nodemodules.cmd +5 -0
  8. package/{bin → binaries}/dev +0 -0
  9. package/binaries/dev.cjs +43 -0
  10. package/{bin → binaries}/empty +0 -0
  11. package/binaries/empty.cjs +43 -0
  12. package/{bin → binaries}/git-reduce-size +0 -0
  13. package/binaries/git-reduce-size.cjs +43 -0
  14. package/binaries/javakill.cjs +43 -0
  15. package/{bin → binaries}/javakill.cmd +0 -0
  16. package/{bin → binaries}/kill-process +0 -0
  17. package/binaries/kill-process.cjs +43 -0
  18. package/binaries/nodekill.cjs +43 -0
  19. package/{bin → binaries}/nodekill.ps1 +0 -0
  20. package/{bin → binaries}/prod +0 -0
  21. package/binaries/prod.cjs +43 -0
  22. package/{bin → binaries}/rmfind +0 -0
  23. package/binaries/rmfind.cjs +43 -0
  24. package/{bin → binaries}/rmx +0 -0
  25. package/binaries/rmx.cjs +43 -0
  26. package/{bin → binaries}/submodule-token +0 -0
  27. package/binaries/submodule-token.cjs +43 -0
  28. package/docs-src/clean-github-actions-caches.md +26 -0
  29. package/docs-src/free-chatgpt.md +26 -0
  30. package/lib/binary-collections-config.cjs +3 -2
  31. package/lib/binary-collections-config.mjs +2 -2
  32. package/lib/binary-collections.cjs +452 -105
  33. package/lib/binary-collections.mjs +131 -84
  34. package/lib/changelog.cjs +3 -3
  35. package/lib/changelog.mjs +177 -171
  36. package/lib/chunk-4EWQC6GZ.mjs +382 -0
  37. package/lib/chunk-4ZI7BQKQ.mjs +381 -0
  38. package/lib/chunk-5J2BEPY5.mjs +83 -0
  39. package/lib/{chunk-4BYBVEYC.mjs → chunk-66PAU5PS.mjs} +5 -4
  40. package/lib/chunk-6HHJRKFB.mjs +59 -0
  41. package/lib/chunk-6S4NXESK.mjs +26 -0
  42. package/lib/{chunk-ZYAQRPUL.mjs → chunk-7YD7IPFF.mjs} +2 -2
  43. package/lib/{chunk-SH3L6HHV.mjs → chunk-A2JQXI5Z.mjs} +2 -2
  44. package/lib/{chunk-EGSSKVDH.mjs → chunk-A3VUZEJK.mjs} +1 -1
  45. package/lib/chunk-AGZYRDC2.mjs +323 -0
  46. package/lib/{chunk-VVEZVNIV.mjs → chunk-AI4CVPJ7.mjs} +6 -6
  47. package/lib/chunk-BDCHCWHD.mjs +136 -0
  48. package/lib/chunk-BEZKJ25G.mjs +140 -0
  49. package/lib/chunk-DI5MDPSN.mjs +386 -0
  50. package/lib/{chunk-ONIBBBQ3.mjs → chunk-E6FDDAOO.mjs} +4 -3
  51. package/lib/chunk-FKI7IEB5.mjs +172 -0
  52. package/lib/chunk-GJTGHXRA.mjs +356 -0
  53. package/lib/{chunk-YV7DO3YV.mjs → chunk-HLGOWBEO.mjs} +1 -1
  54. package/lib/chunk-HMRMTYZM.mjs +40 -0
  55. package/lib/chunk-HN52G2YL.mjs +305 -0
  56. package/lib/chunk-HO6GHCOB.mjs +385 -0
  57. package/lib/chunk-LEM5OMRP.mjs +384 -0
  58. package/lib/{chunk-YX5U7XDR.mjs → chunk-M3YIYRHT.mjs} +6 -5
  59. package/lib/chunk-O6SWBEOQ.mjs +81 -0
  60. package/lib/{chunk-JGR2NW6D.mjs → chunk-PDSXF5HY.mjs} +3 -3
  61. package/lib/{chunk-AASHBCRW.mjs → chunk-QQ4A6DLD.mjs} +8 -0
  62. package/lib/chunk-RCP7DHVY.mjs +190 -0
  63. package/lib/chunk-SBNDSKG5.mjs +136 -0
  64. package/lib/chunk-U6SO4QEV.mjs +320 -0
  65. package/lib/{chunk-APBWENF6.mjs → chunk-V3N3JEUF.mjs} +3 -3
  66. package/lib/chunk-XD6BJK6Q.mjs +351 -0
  67. package/lib/chunk-XVBFFVCJ.mjs +209 -0
  68. package/lib/chunk-YXSFGA2D.mjs +383 -0
  69. package/lib/clean-github-actions-caches.cjs +243 -148
  70. package/lib/clean-github-actions-caches.mjs +3 -2
  71. package/lib/del-gradle.cjs +2 -2
  72. package/lib/del-gradle.js +1 -1
  73. package/lib/del-gradle.mjs +2 -2
  74. package/lib/del-node-modules.cjs +2 -2
  75. package/lib/del-node-modules.js +1 -1
  76. package/lib/del-node-modules.mjs +2 -2
  77. package/lib/del-ps.cjs +29 -8
  78. package/lib/del-ps.js +2 -2
  79. package/lib/del-ps.mjs +7 -5
  80. package/lib/del-yarn-caches.cjs +26 -5
  81. package/lib/del-yarn-caches.js +38 -3
  82. package/lib/del-yarn-caches.mjs +6 -6
  83. package/lib/find-node-modules-cli.cjs +5 -4
  84. package/lib/find-node-modules-cli.js +1 -1
  85. package/lib/find-node-modules-cli.mjs +2 -2
  86. package/lib/find-node-modules.cjs +4 -3
  87. package/lib/{find-node-modules.d.ts → find-node-modules.d.cts} +1 -1
  88. package/lib/find-node-modules.mjs +2 -2
  89. package/lib/free-chatgpt.cjs +548 -0
  90. package/lib/free-chatgpt.js +51 -0
  91. package/lib/free-chatgpt.mjs +50 -0
  92. package/lib/git/gitattributes.cjs +1 -1
  93. package/lib/git/{gitattributes.d.mts → gitattributes.d.cts} +5 -7
  94. package/lib/git/gitattributes.mjs +2 -2
  95. package/lib/git/line-endings.cjs +297 -64
  96. package/lib/git/line-endings.mjs +4 -4
  97. package/lib/git/normalize.cjs +26 -36
  98. package/lib/git/normalize.mjs +2 -2
  99. package/lib/git/permissions.cjs +77 -11
  100. package/lib/git/permissions.mjs +3 -3
  101. package/lib/git/pull-strategy.cjs +76 -9
  102. package/lib/git/pull-strategy.mjs +3 -3
  103. package/lib/git/user-config.cjs +266 -83
  104. package/lib/git/user-config.mjs +4 -4
  105. package/lib/git/utils.cjs +40 -60
  106. package/lib/git/utils.mjs +2 -2
  107. package/lib/git-diff-cli.cjs +651 -0
  108. package/lib/git-diff-cli.d.ts +1 -0
  109. package/lib/git-diff-cli.js +15 -0
  110. package/lib/git-diff-cli.mjs +16 -0
  111. package/lib/git-diff.cjs +657 -58
  112. package/lib/git-diff.d.ts +38 -83
  113. package/lib/git-diff.js +152 -0
  114. package/lib/git-diff.mjs +23 -85
  115. package/lib/git-fix.cjs +685 -97
  116. package/lib/git-fix.mjs +14 -13
  117. package/lib/git-purge.cjs +3 -3
  118. package/lib/git-purge.d.cts +1 -0
  119. package/lib/git-purge.mjs +43 -37
  120. package/lib/index.cjs +7 -6
  121. package/lib/index.d.ts +1 -1
  122. package/lib/index.js +2 -5
  123. package/lib/index.mjs +4 -4
  124. package/lib/npm-run-series.cjs +3 -3
  125. package/lib/npm-run-series.mjs +42 -36
  126. package/lib/package-resolutions-updater.cjs +5 -5
  127. package/lib/package-resolutions-updater.mjs +266 -309
  128. package/lib/print-directory-tree.cjs +275 -210
  129. package/lib/print-directory-tree.mjs +2 -2
  130. package/lib/ps/connected-domain.cjs +25 -2
  131. package/lib/ps/connected-domain.d.ts +10 -2
  132. package/lib/ps/connected-domain.js +5 -2
  133. package/lib/ps/connected-domain.mjs +8 -4
  134. package/lib/ps/index.cjs +345 -322
  135. package/lib/ps/index.d.mjs +1 -1
  136. package/lib/ps/index.js +1 -1
  137. package/lib/ps/index.mjs +179 -182
  138. package/lib/ps/isWin.cjs +24 -1
  139. package/lib/ps/isWin.d.ts +1 -1
  140. package/lib/ps/isWin.js +3 -1
  141. package/lib/ps/isWin.mjs +8 -4
  142. package/lib/ps/table-parser.cjs +167 -159
  143. package/lib/ps/table-parser.d.ts +5 -0
  144. package/lib/ps/table-parser.js +10 -4
  145. package/lib/ps/table-parser.mjs +9 -5
  146. package/lib/remove-module.cjs +262 -0
  147. package/lib/remove-module.d.mts +1 -0
  148. package/lib/remove-module.mjs +111 -0
  149. package/lib/rmpath.cjs +274 -0
  150. package/lib/rmpath.d.mts +3 -0
  151. package/lib/rmpath.mjs +108 -0
  152. package/lib/submodule-install.cjs +264 -86
  153. package/lib/submodule-install.mjs +51 -3
  154. package/lib/submodule-remove-cli.cjs +103 -0
  155. package/lib/submodule-remove-cli.d.ts +1 -0
  156. package/lib/submodule-remove-cli.js +31 -0
  157. package/lib/submodule-remove-cli.mjs +28 -0
  158. package/lib/submodule-remove.cjs +43 -0
  159. package/lib/submodule-remove.d.cts +2 -0
  160. package/lib/submodule-remove.mjs +6 -0
  161. package/lib/utils/chatgpt.cjs +383 -0
  162. package/lib/utils/chatgpt.d.ts +31 -0
  163. package/lib/utils/chatgpt.js +541 -0
  164. package/lib/utils/chatgpt.mjs +8 -0
  165. package/lib/{utils.cjs → utils/index.cjs} +1 -1
  166. package/lib/{utils.mjs → utils/index.mjs} +2 -2
  167. package/lib/yarn-reinstall.cjs +172 -38
  168. package/lib/yarn-reinstall.mjs +2 -2
  169. package/package.json +91 -71
  170. package/readme.md +43 -69
  171. package/releases/readme.md +36 -0
  172. package/test/README.md +101 -0
  173. package/test/package.json +2 -1
  174. package/test-project/readme.md +26 -0
  175. package/tmp/test-repo/README.md +35 -0
  176. package/tmp/test-repo/package.json +1 -1
  177. package/tmp/typedoc/readme.md +320 -0
  178. package/bin/bash-dummy +0 -56
  179. package/bin/bash-dummy.cmd +0 -25
  180. package/bin/dir-tree.cmd +0 -7
  181. package/bin/git-diff +0 -4
  182. package/bin/git-diff.cmd +0 -7
  183. package/bin/git-fix +0 -36
  184. package/bin/git-fix.cmd +0 -7
  185. package/bin/rmpath +0 -70
  186. package/bin/submodule-install.txt +0 -118
  187. package/bin/submodule-remove +0 -46
  188. package/bin/submodule.txt +0 -172
  189. package/lib/binary-collections-config.d.mts +0 -18
  190. package/lib/binary-collections-config.js +0 -39
  191. package/lib/binary-collections.d.mts +0 -137
  192. package/lib/binary-collections.d.ts +0 -137
  193. package/lib/changelog.d.mts +0 -2
  194. package/lib/changelog.js +0 -226
  195. package/lib/chunk-DPKAJKFO.mjs +0 -171
  196. package/lib/chunk-G3THLIDT.mjs +0 -200
  197. package/lib/chunk-W3ENOM53.mjs +0 -18
  198. package/lib/clean-github-actions-caches.d.mts +0 -169
  199. package/lib/clean-github-actions-caches.d.ts +0 -169
  200. package/lib/del-gradle.d.mts +0 -2
  201. package/lib/del-node-modules.d.mts +0 -2
  202. package/lib/del-ps.d.mts +0 -2
  203. package/lib/del-yarn-caches.d.mts +0 -2
  204. package/lib/find-node-modules-cli.d.mts +0 -1
  205. package/lib/find-node-modules.d.mts +0 -13
  206. package/lib/find-node-modules.js +0 -53
  207. package/lib/git/line-endings.d.mts +0 -83
  208. package/lib/git/line-endings.d.ts +0 -83
  209. package/lib/git/normalize.d.mts +0 -43
  210. package/lib/git/normalize.d.ts +0 -43
  211. package/lib/git/permissions.d.mts +0 -17
  212. package/lib/git/permissions.d.ts +0 -17
  213. package/lib/git/pull-strategy.d.mts +0 -15
  214. package/lib/git/pull-strategy.d.ts +0 -15
  215. package/lib/git/user-config.d.mts +0 -105
  216. package/lib/git/user-config.d.ts +0 -105
  217. package/lib/git/utils.d.mts +0 -69
  218. package/lib/git/utils.d.ts +0 -69
  219. package/lib/git-diff.d.mts +0 -84
  220. package/lib/git-fix.d.mts +0 -141
  221. package/lib/git-fix.d.ts +0 -141
  222. package/lib/git-purge.d.mts +0 -2
  223. package/lib/git-purge.js +0 -59
  224. package/lib/index.d.mts +0 -1
  225. package/lib/npm-run-series.d.mts +0 -1
  226. package/lib/npm-run-series.d.ts +0 -2
  227. package/lib/npm-run-series.js +0 -86
  228. package/lib/package-resolutions-updater.d.ts +0 -352
  229. package/lib/print-directory-tree.d.mts +0 -234
  230. package/lib/print-directory-tree.d.ts +0 -234
  231. package/lib/ps/connected-domain.d.mts +0 -3
  232. package/lib/ps/index.d.d.mts +0 -26
  233. package/lib/ps/index.d.d.ts +0 -26
  234. package/lib/ps/index.d.mts +0 -26
  235. package/lib/ps/isWin.d.mts +0 -3
  236. package/lib/ps/table-parser.d.mts +0 -3
  237. package/lib/submodule-install.d.mts +0 -121
  238. package/lib/submodule-install.d.ts +0 -121
  239. package/lib/utils.d.mts +0 -40
  240. package/lib/utils.js +0 -181
  241. package/lib/yarn-reinstall.d.mts +0 -49
  242. package/lib/yarn-reinstall.d.ts +0 -49
  243. package/src/package-resolutions-updater.mjs +0 -350
  244. package/src/print-directory-tree.cjs +0 -234
  245. package/src/ps/index.js +0 -286
  246. package/src/yarn-reinstall.cjs +0 -49
  247. /package/{bin → binaries}/nodekill +0 -0
  248. /package/{bin → binaries}/nodekill.cmd +0 -0
  249. /package/lib/{binary-collections-config.d.ts → binary-collections-config.d.cts} +0 -0
  250. /package/lib/{changelog.d.ts → changelog.d.cts} +0 -0
  251. /package/lib/{git-purge.d.ts → free-chatgpt.d.ts} +0 -0
  252. /package/lib/{git-diff.d.cts → npm-run-series.d.cts} +0 -0
  253. /package/lib/{utils.d.ts → utils/index.d.cts} +0 -0
package/lib/ps/index.cjs CHANGED
@@ -1,10 +1,23 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
1
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
2
5
  var __esm = (fn, res) => function __init() {
3
6
  return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
4
7
  };
5
- var __commonJS = (cb, mod) => function __require() {
6
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
7
11
  };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
8
21
 
9
22
  // node_modules/tsup/assets/cjs_shims.js
10
23
  var init_cjs_shims = __esm({
@@ -13,369 +26,379 @@ var init_cjs_shims = __esm({
13
26
  });
14
27
 
15
28
  // src/ps/isWin.js
16
- var require_isWin = __commonJS({
17
- "src/ps/isWin.js"(exports2, module2) {
29
+ var isWin_exports = {};
30
+ __export(isWin_exports, {
31
+ default: () => isWin_default
32
+ });
33
+ var isWin, isWin_default;
34
+ var init_isWin = __esm({
35
+ "src/ps/isWin.js"() {
18
36
  init_cjs_shims();
19
- var isWin = process.platform === "win32";
20
- module2.exports = isWin;
37
+ isWin = process.platform === "win32";
38
+ isWin_default = isWin;
21
39
  }
22
40
  });
23
41
 
24
42
  // src/ps/connected-domain.js
25
- var require_connected_domain = __commonJS({
26
- "src/ps/connected-domain.js"(exports2, module2) {
27
- init_cjs_shims();
28
- module2.exports = function(tdArray, indicator, hardlink) {
29
- hardlink = hardlink || false;
30
- if (!tdArray) {
31
- throw new Error("tdArray must be provided");
43
+ function connected_domain_default(tdArray, indicator, hardlink) {
44
+ hardlink = hardlink || false;
45
+ if (!tdArray) {
46
+ throw new Error("tdArray must be provided");
47
+ }
48
+ if (!indicator) {
49
+ throw new Error("indicator must be provided");
50
+ }
51
+ tdArray = JSON.parse(JSON.stringify(tdArray));
52
+ var domains = {};
53
+ var domainUUID = 0;
54
+ var pointsHash = {};
55
+ tdArray.forEach(function(row, y) {
56
+ row.forEach(function(colItem, x) {
57
+ var identifier2 = indicator(colItem, x, y);
58
+ var neighbours = [];
59
+ if (tdArray[y - 1] && tdArray[y - 1][x] !== void 0) {
60
+ neighbours.push(pointsHash[x + "_" + (y - 1)]);
32
61
  }
33
- if (!indicator) {
34
- throw new Error("indicator must be provided");
62
+ if (row[x - 1] !== void 0) {
63
+ neighbours.push(pointsHash[x - 1 + "_" + y]);
35
64
  }
36
- tdArray = JSON.parse(JSON.stringify(tdArray));
37
- var domains = {};
38
- var domainUUID = 0;
39
- var pointsHash = {};
40
- tdArray.forEach(function(row, y) {
41
- row.forEach(function(colItem, x) {
42
- var identifier2 = indicator(colItem, x, y);
43
- var neighbours = [];
44
- if (tdArray[y - 1] && tdArray[y - 1][x] !== void 0) {
45
- neighbours.push(pointsHash[x + "_" + (y - 1)]);
46
- }
47
- if (row[x - 1] !== void 0) {
48
- neighbours.push(pointsHash[x - 1 + "_" + y]);
49
- }
50
- if (!hardlink) {
51
- if (tdArray[y - 1] && tdArray[y - 1][x - 1] !== void 0) {
52
- neighbours.push(pointsHash[x - 1 + "_" + (y - 1)]);
53
- }
54
- if (tdArray[y - 1] && tdArray[y - 1][x + 1] !== void 0) {
55
- neighbours.push(pointsHash[x + 1 + "_" + (y - 1)]);
56
- }
57
- }
58
- if (neighbours.length) {
59
- var matched = false;
60
- neighbours.forEach(function(neighbour) {
61
- if (neighbour.identifier == identifier2) {
62
- if (!matched) {
63
- addPointToDomain(colItem, x, y, neighbour.domainId);
64
- matched = true;
65
- } else {
66
- var colItemPoint = pointsHash[x + "_" + y];
67
- if (neighbour.domainId != colItemPoint.domainId) {
68
- mergeDomains(neighbour.domainId, colItemPoint.domainId);
69
- }
70
- }
71
- }
72
- });
65
+ if (!hardlink) {
66
+ if (tdArray[y - 1] && tdArray[y - 1][x - 1] !== void 0) {
67
+ neighbours.push(pointsHash[x - 1 + "_" + (y - 1)]);
68
+ }
69
+ if (tdArray[y - 1] && tdArray[y - 1][x + 1] !== void 0) {
70
+ neighbours.push(pointsHash[x + 1 + "_" + (y - 1)]);
71
+ }
72
+ }
73
+ if (neighbours.length) {
74
+ var matched = false;
75
+ neighbours.forEach(function(neighbour) {
76
+ if (neighbour.identifier == identifier2) {
73
77
  if (!matched) {
74
- addNewDomain(colItem, x, y, identifier2);
78
+ addPointToDomain(colItem, x, y, neighbour.domainId);
79
+ matched = true;
80
+ } else {
81
+ var colItemPoint = pointsHash[x + "_" + y];
82
+ if (neighbour.domainId != colItemPoint.domainId) {
83
+ mergeDomains(neighbour.domainId, colItemPoint.domainId);
84
+ }
75
85
  }
76
- } else {
77
- addNewDomain(colItem, x, y, identifier2);
78
86
  }
79
87
  });
80
- });
81
- var result = {
82
- domains: [],
83
- totalDomains: 0,
84
- groupByIdentifier: {},
85
- totalIdentifiers: 0
86
- };
87
- var domainId = null;
88
- var identifier = null;
89
- var domain = null;
90
- for (domainId in domains) {
91
- domain = domains[domainId];
92
- domain.bounding = calculateBounding(domain.points);
93
- identifier = domain.identifier;
94
- result.domains.push(domain);
95
- result.totalDomains++;
96
- if (!(identifier in result.groupByIdentifier)) {
97
- result.groupByIdentifier[identifier] = [];
98
- result.totalIdentifiers++;
88
+ if (!matched) {
89
+ addNewDomain(colItem, x, y, identifier2);
99
90
  }
100
- result.groupByIdentifier[identifier].push(domain);
91
+ } else {
92
+ addNewDomain(colItem, x, y, identifier2);
101
93
  }
102
- function calculateBounding(points) {
103
- var minX = null;
104
- var minY = null;
105
- var maxX = null;
106
- var maxY = null;
107
- points.forEach(function(point) {
108
- if (minX === null || point.x < minX) {
109
- minX = point.x;
110
- }
111
- if (minY === null || point.y < minY) {
112
- minY = point.y;
113
- }
114
- if (maxX === null || point.x > maxX) {
115
- maxX = point.x;
116
- }
117
- if (maxY === null || point.y > maxY) {
118
- maxY = point.y;
119
- }
120
- });
121
- var w = maxX - minX;
122
- var h = maxY - minY;
123
- return {
124
- x: minX,
125
- y: minY,
126
- w,
127
- h
128
- };
94
+ });
95
+ });
96
+ var result = {
97
+ domains: [],
98
+ totalDomains: 0,
99
+ groupByIdentifier: {},
100
+ totalIdentifiers: 0
101
+ };
102
+ var domainId = null;
103
+ var identifier = null;
104
+ var domain = null;
105
+ for (domainId in domains) {
106
+ domain = domains[domainId];
107
+ domain.bounding = calculateBounding(domain.points);
108
+ identifier = domain.identifier;
109
+ result.domains.push(domain);
110
+ result.totalDomains++;
111
+ if (!(identifier in result.groupByIdentifier)) {
112
+ result.groupByIdentifier[identifier] = [];
113
+ result.totalIdentifiers++;
114
+ }
115
+ result.groupByIdentifier[identifier].push(domain);
116
+ }
117
+ function calculateBounding(points) {
118
+ var minX = null;
119
+ var minY = null;
120
+ var maxX = null;
121
+ var maxY = null;
122
+ points.forEach(function(point) {
123
+ if (minX === null || point.x < minX) {
124
+ minX = point.x;
129
125
  }
130
- function addNewDomain(point, x, y, identifier2) {
131
- var newDomain = {
132
- identifier: identifier2,
133
- domainId: ++domainUUID,
134
- bounding: {},
135
- points: []
136
- };
137
- var newPoint = {
138
- value: point,
139
- x,
140
- y,
141
- identifier: identifier2,
142
- domainId: newDomain.domainId
143
- };
144
- pointsHash[x + "_" + y] = {
145
- value: point,
146
- identifier: identifier2,
147
- domainId: newDomain.domainId
148
- };
149
- newDomain.points.push(newPoint);
150
- domains[newDomain.domainId] = newDomain;
126
+ if (minY === null || point.y < minY) {
127
+ minY = point.y;
151
128
  }
152
- function addPointToDomain(point, x, y, domainId2) {
153
- var domain2 = domains[domainId2];
154
- var newPoint = {
155
- value: point,
156
- x,
157
- y,
158
- identifier: domain2.identifier,
159
- domainId: domainId2
160
- };
161
- pointsHash[x + "_" + y] = {
162
- value: point,
163
- identifier: domain2.identifier,
164
- domainId: domainId2
165
- };
166
- domain2.points.push(newPoint);
129
+ if (maxX === null || point.x > maxX) {
130
+ maxX = point.x;
167
131
  }
168
- function mergeDomains(domainAId, domainBId) {
169
- var domainA = domains[domainAId];
170
- var domainB = domains[domainBId];
171
- if (domainA.identifier == domainB.identifier) {
172
- domainB.domainId = domainA.domainId;
173
- domainB.points.forEach(function(point) {
174
- point.domainId = domainA.domainId;
175
- pointsHash[point.x + "_" + point.y].domainId = domainA.domainId;
176
- });
177
- domainA.points = domainA.points.concat(domainB.points);
178
- delete domains[domainBId];
179
- }
132
+ if (maxY === null || point.y > maxY) {
133
+ maxY = point.y;
180
134
  }
181
- return result;
135
+ });
136
+ var w = maxX - minX;
137
+ var h = maxY - minY;
138
+ return {
139
+ x: minX,
140
+ y: minY,
141
+ w,
142
+ h
182
143
  };
183
144
  }
145
+ function addNewDomain(point, x, y, identifier2) {
146
+ var newDomain = {
147
+ identifier: identifier2,
148
+ domainId: ++domainUUID,
149
+ bounding: {},
150
+ points: []
151
+ };
152
+ var newPoint = {
153
+ value: point,
154
+ x,
155
+ y,
156
+ identifier: identifier2,
157
+ domainId: newDomain.domainId
158
+ };
159
+ pointsHash[x + "_" + y] = {
160
+ value: point,
161
+ identifier: identifier2,
162
+ domainId: newDomain.domainId
163
+ };
164
+ newDomain.points.push(newPoint);
165
+ domains[newDomain.domainId] = newDomain;
166
+ }
167
+ function addPointToDomain(point, x, y, domainId2) {
168
+ var domain2 = domains[domainId2];
169
+ var newPoint = {
170
+ value: point,
171
+ x,
172
+ y,
173
+ identifier: domain2.identifier,
174
+ domainId: domainId2
175
+ };
176
+ pointsHash[x + "_" + y] = {
177
+ value: point,
178
+ identifier: domain2.identifier,
179
+ domainId: domainId2
180
+ };
181
+ domain2.points.push(newPoint);
182
+ }
183
+ function mergeDomains(domainAId, domainBId) {
184
+ var domainA = domains[domainAId];
185
+ var domainB = domains[domainBId];
186
+ if (domainA.identifier == domainB.identifier) {
187
+ domainB.domainId = domainA.domainId;
188
+ domainB.points.forEach(function(point) {
189
+ point.domainId = domainA.domainId;
190
+ pointsHash[point.x + "_" + point.y].domainId = domainA.domainId;
191
+ });
192
+ domainA.points = domainA.points.concat(domainB.points);
193
+ delete domains[domainBId];
194
+ }
195
+ }
196
+ return result;
197
+ }
198
+ var init_connected_domain = __esm({
199
+ "src/ps/connected-domain.js"() {
200
+ init_cjs_shims();
201
+ }
184
202
  });
185
203
 
186
204
  // src/ps/table-parser.js
187
- var require_table_parser = __commonJS({
188
- "src/ps/table-parser.js"(exports2, module2) {
189
- init_cjs_shims();
190
- var ConnectedDomain = require_connected_domain();
191
- var EMPTY_EX = /\s/;
192
- module2.exports.parse = function(output) {
193
- var linesTmp = output.split(/(\r\n)|(\n\r)|\n|\r/);
194
- var lines = [];
195
- var titleInfo = {};
196
- var twoDimArray = [];
197
- linesTmp.forEach(function(line) {
198
- if (line && line.trim()) {
199
- lines.push(line);
200
- }
201
- });
202
- lines.forEach(function(line, index) {
203
- if (index == 0) {
204
- var fields = line.split(/\s+/);
205
- var currentIndex = 0;
206
- fields.forEach(function(field, idx) {
207
- if (field) {
208
- var info = titleInfo[field] = {};
209
- var indexBegin = line.indexOf(field, currentIndex);
210
- var indexEnd = currentIndex = indexBegin + field.length;
211
- if (idx == 0) {
212
- info.titleBegin = 0;
213
- } else {
214
- info.titleBegin = indexBegin;
215
- }
216
- if (idx == fields.length - 1) {
217
- info.titleEnd = line.length - 1;
218
- } else {
219
- info.titleEnd = indexEnd;
220
- }
221
- }
222
- });
223
- } else {
224
- twoDimArray[index - 1] = line.split("");
225
- }
226
- });
227
- var connectedDomains = ConnectedDomain(
228
- twoDimArray,
229
- function(value) {
230
- if (EMPTY_EX.test(value)) {
231
- return -1;
205
+ var table_parser_exports = {};
206
+ __export(table_parser_exports, {
207
+ parse: () => parse
208
+ });
209
+ function parse(output) {
210
+ var linesTmp = output.split(/(\r\n)|(\n\r)|\n|\r/);
211
+ var lines = [];
212
+ var titleInfo = {};
213
+ var twoDimArray = [];
214
+ linesTmp.forEach(function(line) {
215
+ if (line && line.trim()) {
216
+ lines.push(line);
217
+ }
218
+ });
219
+ lines.forEach(function(line, index) {
220
+ if (index == 0) {
221
+ var fields = line.split(/\s+/);
222
+ var currentIndex = 0;
223
+ fields.forEach(function(field, idx) {
224
+ if (field) {
225
+ var info = titleInfo[field] = {};
226
+ var indexBegin = line.indexOf(field, currentIndex);
227
+ var indexEnd = currentIndex = indexBegin + field.length;
228
+ if (idx == 0) {
229
+ info.titleBegin = 0;
232
230
  } else {
233
- return 1;
231
+ info.titleBegin = indexBegin;
234
232
  }
235
- },
236
- true
237
- );
238
- var valuesDomainsVerticalGroups = [];
239
- connectedDomains.domains.sort(function(a, b) {
240
- return a.bounding.x - b.bounding.x;
241
- });
242
- connectedDomains.domains.forEach(function(domain) {
243
- if (domain.identifier === 1) {
244
- var overlapped = false;
245
- valuesDomainsVerticalGroups.forEach(function(group) {
246
- var bounding = domain.bounding;
247
- var left = bounding.x;
248
- var right = bounding.x + bounding.w;
249
- if (overlap(left, right, group.begin, group.end)) {
250
- overlapped = true;
251
- group.domains.push(domain);
252
- group.begin = group.begin > left ? left : group.begin;
253
- group.end = group.end < right ? right : group.end;
254
- }
255
- });
256
- if (!overlapped) {
257
- valuesDomainsVerticalGroups.push({
258
- begin: domain.bounding.x,
259
- end: domain.bounding.x + domain.bounding.w,
260
- domains: [domain]
261
- });
233
+ if (idx == fields.length - 1) {
234
+ info.titleEnd = line.length - 1;
235
+ } else {
236
+ info.titleEnd = indexEnd;
262
237
  }
263
238
  }
264
239
  });
240
+ } else {
241
+ twoDimArray[index - 1] = line.split("");
242
+ }
243
+ });
244
+ var connectedDomains = connected_domain_default(
245
+ twoDimArray,
246
+ function(value) {
247
+ if (EMPTY_EX.test(value)) {
248
+ return -1;
249
+ } else {
250
+ return 1;
251
+ }
252
+ },
253
+ true
254
+ );
255
+ var valuesDomainsVerticalGroups = [];
256
+ connectedDomains.domains.sort(function(a, b) {
257
+ return a.bounding.x - b.bounding.x;
258
+ });
259
+ connectedDomains.domains.forEach(function(domain) {
260
+ if (domain.identifier === 1) {
261
+ var overlapped = false;
265
262
  valuesDomainsVerticalGroups.forEach(function(group) {
266
- var title = null;
267
- var info = null;
268
- var overlapped = false;
269
- var minimunLeftDistance = null;
270
- var nearestLeftTitle = null;
271
- var distance = null;
272
- for (title in titleInfo) {
273
- info = titleInfo[title];
274
- if (group.begin > info.titleBegin) {
275
- distance = group.begin - info.titleBegin;
276
- if (!nearestLeftTitle || distance < minimunLeftDistance) {
277
- nearestLeftTitle = title;
278
- minimunLeftDistance = distance;
279
- }
280
- }
281
- if (overlap(group.begin, group.end, info.titleBegin, info.titleEnd)) {
282
- overlapped = true;
283
- info.titleBegin = info.titleBegin > group.begin ? group.begin : info.titleBegin;
284
- info.titleEnd = info.titleEnd < group.end ? group.end : info.titleEnd;
285
- }
286
- }
287
- if (!overlapped && nearestLeftTitle) {
288
- var nearestTitleField = titleInfo[nearestLeftTitle];
289
- nearestTitleField.titleBegin = nearestTitleField.titleBegin > group.begin ? group.begin : nearestTitleField.titleBegin;
290
- nearestTitleField.titleEnd = nearestTitleField.titleEnd < group.end ? group.end : nearestTitleField.titleEnd;
263
+ var bounding = domain.bounding;
264
+ var left = bounding.x;
265
+ var right = bounding.x + bounding.w;
266
+ if (overlap(left, right, group.begin, group.end)) {
267
+ overlapped = true;
268
+ group.domains.push(domain);
269
+ group.begin = group.begin > left ? left : group.begin;
270
+ group.end = group.end < right ? right : group.end;
291
271
  }
292
272
  });
293
- var result = [];
294
- lines.forEach(function(line, index) {
295
- if (index > 0) {
296
- var lineItem = {};
297
- var title = null;
298
- var info = null;
299
- var value = null;
300
- for (title in titleInfo) {
301
- info = titleInfo[title];
302
- value = line.substring(info.titleBegin, info.titleEnd + 1);
303
- lineItem[title] = splitValue(value.trim());
304
- }
305
- result.push(lineItem);
273
+ if (!overlapped) {
274
+ valuesDomainsVerticalGroups.push({
275
+ begin: domain.bounding.x,
276
+ end: domain.bounding.x + domain.bounding.w,
277
+ domains: [domain]
278
+ });
279
+ }
280
+ }
281
+ });
282
+ valuesDomainsVerticalGroups.forEach(function(group) {
283
+ var title = null;
284
+ var info = null;
285
+ var overlapped = false;
286
+ var minimunLeftDistance = null;
287
+ var nearestLeftTitle = null;
288
+ var distance = null;
289
+ for (title in titleInfo) {
290
+ info = titleInfo[title];
291
+ if (group.begin > info.titleBegin) {
292
+ distance = group.begin - info.titleBegin;
293
+ if (!nearestLeftTitle || distance < minimunLeftDistance) {
294
+ nearestLeftTitle = title;
295
+ minimunLeftDistance = distance;
306
296
  }
307
- });
308
- return result;
309
- };
310
- function overlap(begin1, end1, begin2, end2) {
311
- return begin1 > begin2 && begin1 < end2 || // 2--1--2--1 or 2--1--1--2
312
- end1 > begin2 && end1 < end2 || // 1--2--1--2 or 2--1--1--2
313
- begin1 <= begin2 && end1 >= end2;
297
+ }
298
+ if (overlap(group.begin, group.end, info.titleBegin, info.titleEnd)) {
299
+ overlapped = true;
300
+ info.titleBegin = info.titleBegin > group.begin ? group.begin : info.titleBegin;
301
+ info.titleEnd = info.titleEnd < group.end ? group.end : info.titleEnd;
302
+ }
314
303
  }
315
- function splitValue(value) {
316
- var match = value.match(/"/g);
317
- if (!match || match.length == 1) {
318
- return value.split(/\s+/);
319
- } else {
320
- var result = [];
321
- var chunk = null;
322
- var ifInWrappedChunk = false;
323
- var ifInPureWrappedChunk = false;
324
- var quotaCount = 0;
325
- var maxQuotaCount = match.length % 2 == 0 ? match.length : match.length - 1;
326
- var previousItem = null;
327
- var values = value.split("");
328
- values.forEach(function(item, index) {
329
- if (item !== " ") {
330
- if (item === '"') {
331
- if (ifInWrappedChunk === false && quotaCount <= maxQuotaCount) {
332
- ifInWrappedChunk = true;
333
- quotaCount++;
334
- if (previousItem === " " || previousItem === null) {
335
- ifInPureWrappedChunk = true;
336
- chunk = "";
337
- } else {
338
- chunk += item;
339
- }
340
- } else if (ifInWrappedChunk === true) {
341
- ifInWrappedChunk = false;
342
- quotaCount++;
343
- if (ifInPureWrappedChunk === true) {
344
- ifInPureWrappedChunk = false;
345
- result.push(chunk);
346
- chunk = null;
347
- } else {
348
- chunk += item;
349
- }
350
- }
351
- } else if (ifInWrappedChunk === false && (previousItem === " " || previousItem === null)) {
352
- chunk = item;
304
+ if (!overlapped && nearestLeftTitle) {
305
+ var nearestTitleField = titleInfo[nearestLeftTitle];
306
+ nearestTitleField.titleBegin = nearestTitleField.titleBegin > group.begin ? group.begin : nearestTitleField.titleBegin;
307
+ nearestTitleField.titleEnd = nearestTitleField.titleEnd < group.end ? group.end : nearestTitleField.titleEnd;
308
+ }
309
+ });
310
+ var result = [];
311
+ lines.forEach(function(line, index) {
312
+ if (index > 0) {
313
+ var lineItem = {};
314
+ var title = null;
315
+ var info = null;
316
+ var value = null;
317
+ for (title in titleInfo) {
318
+ info = titleInfo[title];
319
+ value = line.substring(info.titleBegin, info.titleEnd + 1);
320
+ lineItem[title] = splitValue(value.trim());
321
+ }
322
+ result.push(lineItem);
323
+ }
324
+ });
325
+ return result;
326
+ }
327
+ function overlap(begin1, end1, begin2, end2) {
328
+ return begin1 > begin2 && begin1 < end2 || // 2--1--2--1 or 2--1--1--2
329
+ end1 > begin2 && end1 < end2 || // 1--2--1--2 or 2--1--1--2
330
+ begin1 <= begin2 && end1 >= end2;
331
+ }
332
+ function splitValue(value) {
333
+ var match = value.match(/"/g);
334
+ if (!match || match.length == 1) {
335
+ return value.split(/\s+/);
336
+ } else {
337
+ var result = [];
338
+ var chunk = null;
339
+ var ifInWrappedChunk = false;
340
+ var ifInPureWrappedChunk = false;
341
+ var quotaCount = 0;
342
+ var maxQuotaCount = match.length % 2 == 0 ? match.length : match.length - 1;
343
+ var previousItem = null;
344
+ var values = value.split("");
345
+ values.forEach(function(item, index) {
346
+ if (item !== " ") {
347
+ if (item === '"') {
348
+ if (ifInWrappedChunk === false && quotaCount <= maxQuotaCount) {
349
+ ifInWrappedChunk = true;
350
+ quotaCount++;
351
+ if (previousItem === " " || previousItem === null) {
352
+ ifInPureWrappedChunk = true;
353
+ chunk = "";
354
+ } else {
355
+ chunk += item;
356
+ }
357
+ } else if (ifInWrappedChunk === true) {
358
+ ifInWrappedChunk = false;
359
+ quotaCount++;
360
+ if (ifInPureWrappedChunk === true) {
361
+ ifInPureWrappedChunk = false;
362
+ result.push(chunk);
363
+ chunk = null;
353
364
  } else {
354
365
  chunk += item;
355
366
  }
356
- } else if (ifInWrappedChunk) {
357
- chunk += item;
358
- } else if (chunk !== null) {
359
- result.push(chunk);
360
- chunk = null;
361
- }
362
- previousItem = item;
363
- if (index == values.length - 1 && chunk !== null) {
364
- result.push(chunk);
365
- chunk = null;
366
367
  }
367
- });
368
- return result;
368
+ } else if (ifInWrappedChunk === false && (previousItem === " " || previousItem === null)) {
369
+ chunk = item;
370
+ } else {
371
+ chunk += item;
372
+ }
373
+ } else if (ifInWrappedChunk) {
374
+ chunk += item;
375
+ } else if (chunk !== null) {
376
+ result.push(chunk);
377
+ chunk = null;
369
378
  }
370
- }
379
+ previousItem = item;
380
+ if (index == values.length - 1 && chunk !== null) {
381
+ result.push(chunk);
382
+ chunk = null;
383
+ }
384
+ });
385
+ return result;
386
+ }
387
+ }
388
+ var EMPTY_EX;
389
+ var init_table_parser = __esm({
390
+ "src/ps/table-parser.js"() {
391
+ init_cjs_shims();
392
+ init_connected_domain();
393
+ EMPTY_EX = /\s/;
371
394
  }
372
395
  });
373
396
 
374
397
  // src/ps/index.js
375
398
  init_cjs_shims();
376
399
  var ChildProcess = require("child_process");
377
- var IS_WIN = require_isWin();
378
- var TableParser = require_table_parser();
400
+ var IS_WIN = (init_isWin(), __toCommonJS(isWin_exports)).default;
401
+ var TableParser = (init_table_parser(), __toCommonJS(table_parser_exports));
379
402
  var EOL = /(\r\n)|(\n\r)|\n|\r/;
380
403
  var SystemEOL = require("os").EOL;
381
404
  var Exec = module.exports = exports = function(args, callback) {