binary-collections 2.0.6 → 2.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/git-diff.cmd +4 -0
- package/bin/git-fix-encoding.cmd +0 -0
- package/bin/nodekill.cmd +0 -0
- package/bin/nodekill.ps1 +0 -0
- package/bin/submodule-install +0 -0
- package/lib/{chunk-GA4DDV65.mjs → chunk-3LOB2P54.mjs} +3 -3
- package/lib/{chunk-M4IBUK4H.mjs → chunk-4LEXWIIF.mjs} +2 -2
- package/lib/chunk-BSD5CIRU.mjs +52 -0
- package/lib/chunk-FB6YIQYR.mjs +42 -0
- package/lib/{chunk-E75HJFJO.mjs → chunk-JL32QDSH.mjs} +2 -2
- package/lib/{chunk-LPLPQBYP.mjs → chunk-OKYLF2MU.mjs} +14 -14
- package/lib/chunk-VXZQNLPU.mjs +23 -0
- package/lib/del-gradle.cjs +12 -12
- package/lib/del-gradle.d.ts +1 -2
- package/lib/del-gradle.js +12 -69
- package/lib/del-gradle.mjs +3 -3
- package/lib/del-node-modules.cjs +12 -12
- package/lib/del-node-modules.d.ts +1 -2
- package/lib/del-node-modules.js +11 -68
- package/lib/del-node-modules.mjs +3 -3
- package/lib/del-ps.cjs +13 -626
- package/lib/del-ps.d.ts +1 -2
- package/lib/del-ps.js +27 -702
- package/lib/del-ps.mjs +5 -8
- package/lib/del-yarn-caches.cjs +12 -12
- package/lib/del-yarn-caches.d.ts +1 -2
- package/lib/del-yarn-caches.js +6 -63
- package/lib/del-yarn-caches.mjs +3 -3
- package/lib/find-node-modules-cli.cjs +59 -0
- package/lib/find-node-modules-cli.d.mts +1 -0
- package/lib/find-node-modules-cli.d.ts +2 -0
- package/lib/find-node-modules-cli.js +3 -0
- package/lib/find-node-modules-cli.mjs +14 -0
- package/lib/find-node-modules.cjs +31 -9
- package/lib/find-node-modules.d.mts +9 -1
- package/lib/find-node-modules.d.ts +9 -2
- package/lib/find-node-modules.js +41 -12
- package/lib/find-node-modules.mjs +5 -19
- package/lib/git-diff.cjs +74 -0
- package/lib/git-diff.d.cts +2 -0
- package/lib/git-diff.d.mts +87 -0
- package/lib/git-diff.d.ts +87 -0
- package/lib/git-diff.mjs +83 -0
- package/lib/git-purge.cjs +13 -626
- package/lib/git-purge.d.ts +1 -2
- package/lib/git-purge.js +53 -698
- package/lib/git-purge.mjs +4 -7
- package/lib/index.cjs +91 -1
- package/lib/index.d.mts +1 -2
- package/lib/index.d.ts +2 -2
- package/lib/index.js +8 -2
- package/lib/index.mjs +12 -3
- package/lib/npm-run-series.d.ts +1 -0
- package/lib/npm-run-series.js +80 -56
- package/lib/npm-run-series.mjs +2 -2
- package/lib/package-resolutions.mjs +1 -1
- package/lib/ps/connected-domain.cjs +0 -0
- package/lib/ps/connected-domain.d.ts +1 -2
- package/lib/ps/connected-domain.js +196 -150
- package/lib/ps/connected-domain.mjs +3 -3
- package/lib/ps/index.cjs +0 -0
- package/lib/ps/index.d.mjs +2 -2
- package/lib/ps/index.d.ts +2 -26
- package/lib/ps/index.js +230 -535
- package/lib/ps/index.mjs +5 -5
- package/lib/ps/isWin.cjs +0 -0
- package/lib/ps/isWin.d.ts +1 -2
- package/lib/ps/isWin.js +1 -2
- package/lib/ps/isWin.mjs +3 -3
- package/lib/ps/table-parser.cjs +0 -0
- package/lib/ps/table-parser.d.ts +1 -3
- package/lib/ps/table-parser.js +254 -345
- package/lib/ps/table-parser.mjs +4 -4
- package/lib/submodule-install.cjs +118 -0
- package/lib/submodule-install.d.cts +2 -0
- package/lib/submodule-install.d.mts +141 -0
- package/lib/submodule-install.d.ts +141 -0
- package/lib/submodule-install.mjs +116 -0
- package/lib/utils.cjs +12 -12
- package/lib/utils.d.ts +4 -8
- package/lib/utils.js +43 -28
- package/lib/utils.mjs +3 -3
- package/lib/yarn-reinstall.cjs +42 -0
- package/lib/yarn-reinstall.d.cts +1 -0
- package/lib/yarn-reinstall.d.mts +45 -0
- package/lib/yarn-reinstall.d.ts +45 -0
- package/lib/yarn-reinstall.mjs +50 -0
- package/package.json +37 -39
- package/readme.md +174 -49
- package/eslint.config.cjs +0 -97
- package/lib/chunk-7MSZ52XC.mjs +0 -14
- package/lib/chunk-AVDT32AY.mjs +0 -20
- package/lib/chunk-S4SJ7SDW.mjs +0 -625
- package/lib/package-resolutions.js +0 -28
- package/lib/ps/index.d.js +0 -17
|
@@ -1,156 +1,202 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
1
|
+
/**
|
|
2
|
+
* calculate all the connected domains based on the given two-dimensional array
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* @param {Array} tdArray
|
|
6
|
+
* @param {Function} indicator It receive the raw point data as the first parameter and decide what kind of domain the point belongs to, it should return a string as a domain identifier.
|
|
7
|
+
* @param {Boolean} hardlink If use hard link. Default to false.
|
|
8
|
+
* @return {Object} [{ bounding: { w: 12, h: 19, x: 0, y: 1 }, points: [ { x: 1, y: 2, point: {} } ], identifier: 'blue', domainId: 1 } ]
|
|
9
|
+
*/
|
|
10
|
+
module.exports = function (tdArray, indicator, hardlink) {
|
|
11
|
+
hardlink = hardlink || false;
|
|
12
|
+
if (!tdArray) {
|
|
13
|
+
throw new Error("tdArray must be provided");
|
|
14
|
+
}
|
|
15
|
+
if (!indicator) {
|
|
16
|
+
throw new Error("indicator must be provided");
|
|
17
|
+
}
|
|
18
|
+
// clone 一份数据,因为需要对饮用进行修改,方便执行
|
|
19
|
+
tdArray = JSON.parse(JSON.stringify(tdArray));
|
|
20
|
+
// Result
|
|
21
|
+
var domains = {};
|
|
22
|
+
var domainUUID = 0;
|
|
23
|
+
var pointsHash = {};
|
|
24
|
+
// 遍历数组,划分domain
|
|
25
|
+
tdArray.forEach(function (row, y) {
|
|
26
|
+
row.forEach(function (colItem, x) {
|
|
27
|
+
// get the current point identifier.
|
|
28
|
+
var identifier = indicator(colItem, x, y);
|
|
29
|
+
// get neighbours
|
|
30
|
+
// Except for Undefined every data type is valid.
|
|
31
|
+
var neighbours = [];
|
|
32
|
+
// top neighbour
|
|
33
|
+
if (tdArray[y - 1] && tdArray[y - 1][x] !== undefined) {
|
|
34
|
+
neighbours.push(pointsHash[x + "_" + (y - 1)]);
|
|
35
|
+
}
|
|
36
|
+
// left neighbour
|
|
37
|
+
if (row[x - 1] !== undefined) {
|
|
38
|
+
neighbours.push(pointsHash[x - 1 + "_" + y]);
|
|
39
|
+
}
|
|
40
|
+
// soft link will treat corner link as domain link.
|
|
41
|
+
if (!hardlink) {
|
|
42
|
+
// top left neighbour
|
|
43
|
+
if (tdArray[y - 1] && tdArray[y - 1][x - 1] !== undefined) {
|
|
44
|
+
neighbours.push(pointsHash[x - 1 + "_" + (y - 1)]);
|
|
45
|
+
}
|
|
46
|
+
// top right neighbour
|
|
47
|
+
if (tdArray[y - 1] && tdArray[y - 1][x + 1] !== undefined) {
|
|
48
|
+
neighbours.push(pointsHash[x + 1 + "_" + (y - 1)]);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
if (neighbours.length) {
|
|
52
|
+
var matched = false;
|
|
53
|
+
neighbours.forEach(function (neighbour) {
|
|
54
|
+
if (neighbour.identifier == identifier) {
|
|
55
|
+
// If the neighbour is the first neighbour has the same identifier
|
|
56
|
+
if (!matched) {
|
|
57
|
+
addPointToDomain(colItem, x, y, neighbour.domainId);
|
|
58
|
+
matched = true;
|
|
59
|
+
}
|
|
60
|
+
// If more than one neighbour matched, check if these neighbours belong to the same domain
|
|
61
|
+
// If not, merge these domains since they connects to each other.
|
|
62
|
+
else {
|
|
63
|
+
var colItemPoint = pointsHash[x + "_" + y];
|
|
64
|
+
if (neighbour.domainId != colItemPoint.domainId) {
|
|
65
|
+
mergeDomains(neighbour.domainId, colItemPoint.domainId);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
if (!matched) {
|
|
71
|
+
addNewDomain(colItem, x, y, identifier);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
addNewDomain(colItem, x, y, identifier);
|
|
44
76
|
}
|
|
45
|
-
}
|
|
46
77
|
});
|
|
47
|
-
if (!matched) {
|
|
48
|
-
addNewDomain(colItem, x, y, identifier2);
|
|
49
|
-
}
|
|
50
|
-
} else {
|
|
51
|
-
addNewDomain(colItem, x, y, identifier2);
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
});
|
|
55
|
-
var result = {
|
|
56
|
-
domains: [],
|
|
57
|
-
totalDomains: 0,
|
|
58
|
-
groupByIdentifier: {},
|
|
59
|
-
totalIdentifiers: 0
|
|
60
|
-
};
|
|
61
|
-
var domainId = null;
|
|
62
|
-
var identifier = null;
|
|
63
|
-
var domain = null;
|
|
64
|
-
for (domainId in domains) {
|
|
65
|
-
domain = domains[domainId];
|
|
66
|
-
domain.bounding = calculateBounding(domain.points);
|
|
67
|
-
identifier = domain.identifier;
|
|
68
|
-
result.domains.push(domain);
|
|
69
|
-
result.totalDomains++;
|
|
70
|
-
if (!(identifier in result.groupByIdentifier)) {
|
|
71
|
-
result.groupByIdentifier[identifier] = [];
|
|
72
|
-
result.totalIdentifiers++;
|
|
73
|
-
}
|
|
74
|
-
result.groupByIdentifier[identifier].push(domain);
|
|
75
|
-
}
|
|
76
|
-
function calculateBounding(points) {
|
|
77
|
-
var minX = null;
|
|
78
|
-
var minY = null;
|
|
79
|
-
var maxX = null;
|
|
80
|
-
var maxY = null;
|
|
81
|
-
points.forEach(function(point) {
|
|
82
|
-
if (minX === null || point.x < minX) {
|
|
83
|
-
minX = point.x;
|
|
84
|
-
}
|
|
85
|
-
if (minY === null || point.y < minY) {
|
|
86
|
-
minY = point.y;
|
|
87
|
-
}
|
|
88
|
-
if (maxX === null || point.x > maxX) {
|
|
89
|
-
maxX = point.x;
|
|
90
|
-
}
|
|
91
|
-
if (maxY === null || point.y > maxY) {
|
|
92
|
-
maxY = point.y;
|
|
93
|
-
}
|
|
94
78
|
});
|
|
95
|
-
|
|
96
|
-
var
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
h
|
|
102
|
-
};
|
|
103
|
-
}
|
|
104
|
-
function addNewDomain(point, x, y, identifier2) {
|
|
105
|
-
var newDomain = {
|
|
106
|
-
identifier: identifier2,
|
|
107
|
-
domainId: ++domainUUID,
|
|
108
|
-
bounding: {},
|
|
109
|
-
points: []
|
|
110
|
-
};
|
|
111
|
-
var newPoint = {
|
|
112
|
-
value: point,
|
|
113
|
-
x,
|
|
114
|
-
y,
|
|
115
|
-
identifier: identifier2,
|
|
116
|
-
domainId: newDomain.domainId
|
|
117
|
-
};
|
|
118
|
-
pointsHash[x + "_" + y] = {
|
|
119
|
-
value: point,
|
|
120
|
-
identifier: identifier2,
|
|
121
|
-
domainId: newDomain.domainId
|
|
79
|
+
// some summary
|
|
80
|
+
var result = {
|
|
81
|
+
domains: [],
|
|
82
|
+
totalDomains: 0,
|
|
83
|
+
groupByIdentifier: {},
|
|
84
|
+
totalIdentifiers: 0
|
|
122
85
|
};
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
86
|
+
var domainId = null;
|
|
87
|
+
var identifier = null;
|
|
88
|
+
var domain = null;
|
|
89
|
+
for (domainId in domains) {
|
|
90
|
+
domain = domains[domainId];
|
|
91
|
+
domain.bounding = calculateBounding(domain.points);
|
|
92
|
+
identifier = domain.identifier;
|
|
93
|
+
result.domains.push(domain);
|
|
94
|
+
result.totalDomains++;
|
|
95
|
+
if (!(identifier in result.groupByIdentifier)) {
|
|
96
|
+
result.groupByIdentifier[identifier] = [];
|
|
97
|
+
result.totalIdentifiers++;
|
|
98
|
+
}
|
|
99
|
+
result.groupByIdentifier[identifier].push(domain);
|
|
100
|
+
}
|
|
101
|
+
function calculateBounding(points) {
|
|
102
|
+
var minX = null;
|
|
103
|
+
var minY = null;
|
|
104
|
+
var maxX = null;
|
|
105
|
+
var maxY = null;
|
|
106
|
+
points.forEach(function (point) {
|
|
107
|
+
if (minX === null || point.x < minX) {
|
|
108
|
+
minX = point.x;
|
|
109
|
+
}
|
|
110
|
+
if (minY === null || point.y < minY) {
|
|
111
|
+
minY = point.y;
|
|
112
|
+
}
|
|
113
|
+
if (maxX === null || point.x > maxX) {
|
|
114
|
+
maxX = point.x;
|
|
115
|
+
}
|
|
116
|
+
if (maxY === null || point.y > maxY) {
|
|
117
|
+
maxY = point.y;
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
var w = maxX - minX;
|
|
121
|
+
var h = maxY - minY;
|
|
122
|
+
return {
|
|
123
|
+
x: minX,
|
|
124
|
+
y: minY,
|
|
125
|
+
w: w,
|
|
126
|
+
h: h
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
*
|
|
131
|
+
* @param point
|
|
132
|
+
* @param x
|
|
133
|
+
* @param y
|
|
134
|
+
* @param identifier
|
|
135
|
+
*/
|
|
136
|
+
function addNewDomain(point, x, y, identifier) {
|
|
137
|
+
var newDomain = {
|
|
138
|
+
identifier: identifier,
|
|
139
|
+
domainId: ++domainUUID,
|
|
140
|
+
bounding: {},
|
|
141
|
+
points: []
|
|
142
|
+
};
|
|
143
|
+
var newPoint = {
|
|
144
|
+
value: point,
|
|
145
|
+
x: x,
|
|
146
|
+
y: y,
|
|
147
|
+
identifier: identifier,
|
|
148
|
+
domainId: newDomain.domainId
|
|
149
|
+
};
|
|
150
|
+
pointsHash[x + "_" + y] = {
|
|
151
|
+
value: point,
|
|
152
|
+
identifier: identifier,
|
|
153
|
+
domainId: newDomain.domainId
|
|
154
|
+
};
|
|
155
|
+
newDomain.points.push(newPoint);
|
|
156
|
+
domains[newDomain.domainId] = newDomain;
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* add a point to a existing domain, and attach properties domainId and identifier to point.
|
|
160
|
+
* @param point
|
|
161
|
+
* @param x
|
|
162
|
+
* @param y
|
|
163
|
+
* @param domainId
|
|
164
|
+
*/
|
|
165
|
+
function addPointToDomain(point, x, y, domainId) {
|
|
166
|
+
var domain = domains[domainId];
|
|
167
|
+
var newPoint = {
|
|
168
|
+
value: point,
|
|
169
|
+
x: x,
|
|
170
|
+
y: y,
|
|
171
|
+
identifier: domain.identifier,
|
|
172
|
+
domainId: domainId
|
|
173
|
+
};
|
|
174
|
+
pointsHash[x + "_" + y] = {
|
|
175
|
+
value: point,
|
|
176
|
+
identifier: domain.identifier,
|
|
177
|
+
domainId: domainId
|
|
178
|
+
};
|
|
179
|
+
domain.points.push(newPoint);
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* 将 domainB 合并到 domainA
|
|
183
|
+
* @param domainAId
|
|
184
|
+
* @param domainBId
|
|
185
|
+
*/
|
|
186
|
+
function mergeDomains(domainAId, domainBId) {
|
|
187
|
+
var domainA = domains[domainAId];
|
|
188
|
+
var domainB = domains[domainBId];
|
|
189
|
+
if (domainA.identifier == domainB.identifier) {
|
|
190
|
+
// 更新 domainB 的domainId
|
|
191
|
+
domainB.domainId = domainA.domainId;
|
|
192
|
+
domainB.points.forEach(function (point) {
|
|
193
|
+
point.domainId = domainA.domainId;
|
|
194
|
+
pointsHash[point.x + "_" + point.y].domainId = domainA.domainId;
|
|
195
|
+
});
|
|
196
|
+
domainA.points = domainA.points.concat(domainB.points);
|
|
197
|
+
// 删除domainB
|
|
198
|
+
delete domains[domainBId];
|
|
199
|
+
}
|
|
153
200
|
}
|
|
154
|
-
|
|
155
|
-
return result;
|
|
201
|
+
return result;
|
|
156
202
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
require_connected_domain
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-4LEXWIIF.mjs";
|
|
5
|
+
import "../chunk-VXZQNLPU.mjs";
|
|
6
|
+
import "../chunk-FB6YIQYR.mjs";
|
|
7
7
|
export default require_connected_domain();
|
package/lib/ps/index.cjs
CHANGED
|
File without changes
|
package/lib/ps/index.d.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
init_esm_shims
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-VXZQNLPU.mjs";
|
|
5
|
+
import "../chunk-FB6YIQYR.mjs";
|
|
6
6
|
|
|
7
7
|
// src/ps/index.d.ts
|
|
8
8
|
init_esm_shims();
|
package/lib/ps/index.d.ts
CHANGED
|
@@ -1,26 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
command: string;
|
|
4
|
-
pid: number;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
interface Query {
|
|
8
|
-
pid?: string | string[] | number | undefined;
|
|
9
|
-
ppid?: number | undefined;
|
|
10
|
-
command?: string | RegExp | undefined;
|
|
11
|
-
arguments?: string | RegExp | undefined;
|
|
12
|
-
psargs?: string | string[] | undefined;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
interface Signal {
|
|
16
|
-
signal: string;
|
|
17
|
-
timeout: number;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
/** Query Process: Focus on pid & cmd */
|
|
21
|
-
declare function lookup(query: Query, cb: (err: Error, list: Program[]) => void): void;
|
|
22
|
-
|
|
23
|
-
declare function kill(pID: number | string, cb?: (err?: Error) => void): void;
|
|
24
|
-
declare function kill(pID: number | string, signal?: string | Signal, cb?: (err?: Error) => void): void;
|
|
25
|
-
|
|
26
|
-
export { type Program, type Query, type Signal, kill, lookup };
|
|
1
|
+
declare const _exports: Function;
|
|
2
|
+
export = _exports;
|