rm-graphical-computing-node 1.0.122 → 1.0.126
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/dist/index.mjs +361 -99
- package/package.json +3 -1
package/dist/index.mjs
CHANGED
|
@@ -3953,8 +3953,11 @@ var getBeamLine = async (lines, runDataList, pcdData, lineReader, lineEditor, on
|
|
|
3953
3953
|
for (let line2 of lines) {
|
|
3954
3954
|
let allRegion = [];
|
|
3955
3955
|
line2.checkResults = lineReader.getLineCheckReultsById(line2.id);
|
|
3956
|
-
if (!line2.checkResults || line2.checkResults.length <= 0)
|
|
3956
|
+
if (!line2.checkResults || line2.checkResults.length <= 0) {
|
|
3957
|
+
if (line2.mergeCheckRegion && line2.mergeCheckRegion.length > 0)
|
|
3958
|
+
line2.mergeCheckRegion.length = 0;
|
|
3957
3959
|
continue;
|
|
3960
|
+
}
|
|
3958
3961
|
for (let r = 0; r < line2.checkResults.length; r++) {
|
|
3959
3962
|
let find = function(i) {
|
|
3960
3963
|
while (parent[i] !== i) {
|
|
@@ -5261,8 +5264,8 @@ var getBeamLine = async (lines, runDataList, pcdData, lineReader, lineEditor, on
|
|
|
5261
5264
|
for (let g = 0; g < findDoorIndexs.length; g++) {
|
|
5262
5265
|
if (j == g)
|
|
5263
5266
|
continue;
|
|
5264
|
-
const start2 = lines[findDoorIndexs[g]].start
|
|
5265
|
-
const end2 = lines[findDoorIndexs[g]].end
|
|
5267
|
+
const start2 = getPt3(lines[findDoorIndexs[g]].start);
|
|
5268
|
+
const end2 = getPt3(lines[findDoorIndexs[g]].end);
|
|
5266
5269
|
start2.z = end2.z = 0;
|
|
5267
5270
|
if (ptIsEqual(start1, start2, tol) || ptIsEqual(start1, end2, tol)) {
|
|
5268
5271
|
startIsEq = true;
|
|
@@ -5701,7 +5704,7 @@ var getBeamLine = async (lines, runDataList, pcdData, lineReader, lineEditor, on
|
|
|
5701
5704
|
newDoorAndBeamIdToCheckResults.push(line4.doorAndBeamIdToCheckResults[h][0] + data1LineIndex.checkResults.length - 1, line4.doorAndBeamIdToCheckResults[h][1]);
|
|
5702
5705
|
}
|
|
5703
5706
|
}
|
|
5704
|
-
let tmpDoorPoints3 = [line3.start, line3.end, line4.start, line4.end];
|
|
5707
|
+
let tmpDoorPoints3 = [getPt3(line3.start), getPt3(line3.end), getPt3(line4.start), getPt3(line4.end)];
|
|
5705
5708
|
let twoPoint3 = getFarthestPoints(tmpDoorPoints3);
|
|
5706
5709
|
const newLine = {
|
|
5707
5710
|
checkResults: newCheckResults,
|
|
@@ -5804,7 +5807,7 @@ var getBeamLine = async (lines, runDataList, pcdData, lineReader, lineEditor, on
|
|
|
5804
5807
|
else
|
|
5805
5808
|
newDoorAndBeamIdToCheckResults.push(line22.doorAndBeamIdToCheckResults[h][0] + data1LineIndex.checkResults.length - 1, line22.doorAndBeamIdToCheckResults[h][1]);
|
|
5806
5809
|
}
|
|
5807
|
-
let tmpDoorPoints3 = [line2.start, line2.end, line22.start, line22.end];
|
|
5810
|
+
let tmpDoorPoints3 = [getPt3(line2.start), getPt3(line2.end), getPt3(line22.start), getPt3(line22.end)];
|
|
5808
5811
|
let twoPoint3 = getFarthestPoints(tmpDoorPoints3);
|
|
5809
5812
|
const newLine = {
|
|
5810
5813
|
checkResults: newCheckResults,
|
|
@@ -5926,7 +5929,7 @@ var getBeamLine = async (lines, runDataList, pcdData, lineReader, lineEditor, on
|
|
|
5926
5929
|
else
|
|
5927
5930
|
newDoorAndBeamIdToCheckResults.push(line22.doorAndBeamIdToCheckResults[h][0] + data1LineIndex.checkResults.length - 1, line22.doorAndBeamIdToCheckResults[h][1]);
|
|
5928
5931
|
}
|
|
5929
|
-
let tmpDoorPoints3 = [line2.start, line2.end, line22.start, line22.end];
|
|
5932
|
+
let tmpDoorPoints3 = [getPt3(line2.start), getPt3(line2.end), getPt3(line22.start), getPt3(line22.end)];
|
|
5930
5933
|
let twoPoint3 = getFarthestPoints(tmpDoorPoints3);
|
|
5931
5934
|
const newLine = {
|
|
5932
5935
|
checkResults: newCheckResults,
|
|
@@ -6001,7 +6004,7 @@ var getBeamLine = async (lines, runDataList, pcdData, lineReader, lineEditor, on
|
|
|
6001
6004
|
else
|
|
6002
6005
|
newDoorAndBeamIdToCheckResults2.push(line4.doorAndBeamIdToCheckResults[h][0] + data1LineIndex.checkResults.length - 1, line4.doorAndBeamIdToCheckResults[h][1]);
|
|
6003
6006
|
}
|
|
6004
|
-
let tmpDoorPoints4 = [line3.start, line3.end, line4.start, line4.end];
|
|
6007
|
+
let tmpDoorPoints4 = [getPt3(line3.start), getPt3(line3.end), getPt3(line4.start), getPt3(line4.end)];
|
|
6005
6008
|
let twoPoint4 = getFarthestPoints(tmpDoorPoints4);
|
|
6006
6009
|
const newLine2 = {
|
|
6007
6010
|
checkResults: newCheckResults2,
|
|
@@ -9645,14 +9648,14 @@ var getMergeMeaning = (allProjectionResults, wallLines, wallVerifyType, averageP
|
|
|
9645
9648
|
if (word === "wall" || word === "stair guardrail")
|
|
9646
9649
|
continue;
|
|
9647
9650
|
let threePoints = [];
|
|
9648
|
-
let
|
|
9651
|
+
let threePointsStr = [];
|
|
9649
9652
|
for (let u4 = 0; u4 < allProjectionResults[i].points.length; u4++) {
|
|
9650
9653
|
threePoints.push(new THREE8.Vector3(
|
|
9651
9654
|
allProjectionResults[i].points[u4].x,
|
|
9652
9655
|
allProjectionResults[i].points[u4].y,
|
|
9653
9656
|
allProjectionResults[i].points[u4].z
|
|
9654
9657
|
));
|
|
9655
|
-
|
|
9658
|
+
threePointsStr.push(`${allProjectionResults[i].points[u4].x},${allProjectionResults[i].points[u4].y},${allProjectionResults[i].points[u4].z}`);
|
|
9656
9659
|
}
|
|
9657
9660
|
if (wallLines && wallLines.length && wallVerifyType && wallVerifyType.length && wallVerifyType.includes(word)) {
|
|
9658
9661
|
threePoints = checkNearObjects(wallLines, threePoints);
|
|
@@ -9687,7 +9690,7 @@ var getMergeMeaning = (allProjectionResults, wallLines, wallVerifyType, averageP
|
|
|
9687
9690
|
let mapPosition = /* @__PURE__ */ new Map();
|
|
9688
9691
|
mapPosition.set(
|
|
9689
9692
|
`${allProjectionResults[i].position.x},${allProjectionResults[i].position.y},${allProjectionResults[i].position.z}`,
|
|
9690
|
-
|
|
9693
|
+
threePointsStr
|
|
9691
9694
|
);
|
|
9692
9695
|
const data = {
|
|
9693
9696
|
points: threePoints,
|
|
@@ -9871,14 +9874,16 @@ var getMergeMeaning = (allProjectionResults, wallLines, wallVerifyType, averageP
|
|
|
9871
9874
|
delData.add(k);
|
|
9872
9875
|
let nowIndex = cloneData.points.length;
|
|
9873
9876
|
let threePoints = [];
|
|
9877
|
+
let threePointsStr = [];
|
|
9874
9878
|
for (let m = 0; m < array[k].points.length; m++) {
|
|
9875
9879
|
if (array[k].points[m].z > averagePz2 && array[k].points[m].z - averagePz2 > 0.1 || cloneData.type == "floor" || cloneData.type == "Staircase") {
|
|
9876
9880
|
cloneData.points.push(array[k].points[m]);
|
|
9877
9881
|
threePoints.push(array[k].points[m]);
|
|
9882
|
+
threePointsStr.push(`${array[k].points[m].x},${array[k].points[m].y},${array[k].points[m].z}`);
|
|
9878
9883
|
}
|
|
9879
9884
|
}
|
|
9880
9885
|
if (cloneData.type != "floor") {
|
|
9881
|
-
cloneData.mapPosition.set(`${array[k].positionArr[0].x},${array[k].positionArr[0].y},${array[k].positionArr[0].z}`,
|
|
9886
|
+
cloneData.mapPosition.set(`${array[k].positionArr[0].x},${array[k].positionArr[0].y},${array[k].positionArr[0].z}`, threePointsStr);
|
|
9882
9887
|
}
|
|
9883
9888
|
let tmpPoints = cloneData.points.map((p) => [p.x, p.y]);
|
|
9884
9889
|
if (cloneData.type == "floor") {
|
|
@@ -10329,6 +10334,27 @@ var getMergeMeaning = (allProjectionResults, wallLines, wallVerifyType, averageP
|
|
|
10329
10334
|
for (let i = 0; i < pcdPointsArr.length; i++) {
|
|
10330
10335
|
const array = pcdPointsArr[i].array;
|
|
10331
10336
|
for (let j = 0; j < array.length; j++) {
|
|
10337
|
+
const allPtIndexMap = /* @__PURE__ */ new Map();
|
|
10338
|
+
array[j].points.forEach((item, index) => {
|
|
10339
|
+
const ptStr = `${item.x},${item.y},${item.z}`;
|
|
10340
|
+
if (!allPtIndexMap.has(ptStr)) {
|
|
10341
|
+
allPtIndexMap.set(ptStr, index);
|
|
10342
|
+
}
|
|
10343
|
+
});
|
|
10344
|
+
const mapTmp = /* @__PURE__ */ new Map();
|
|
10345
|
+
if (array[j].mapPosition) {
|
|
10346
|
+
for (const [key, value] of array[j].mapPosition) {
|
|
10347
|
+
const indexes = value.reduce((result, item) => {
|
|
10348
|
+
if (allPtIndexMap.has(item)) {
|
|
10349
|
+
result.push(allPtIndexMap.get(item));
|
|
10350
|
+
}
|
|
10351
|
+
return result;
|
|
10352
|
+
}, []);
|
|
10353
|
+
if (indexes.length > 0) {
|
|
10354
|
+
mapTmp.set(key, indexes);
|
|
10355
|
+
}
|
|
10356
|
+
}
|
|
10357
|
+
}
|
|
10332
10358
|
retPcdPointArr.push({
|
|
10333
10359
|
obbBox: array[j].obb,
|
|
10334
10360
|
box: new THREE8.Box3().setFromPoints(array[j].points),
|
|
@@ -10339,7 +10365,7 @@ var getMergeMeaning = (allProjectionResults, wallLines, wallVerifyType, averageP
|
|
|
10339
10365
|
pcdPoints: array[j].points,
|
|
10340
10366
|
positionArr: array[j].positionArr,
|
|
10341
10367
|
isStaircaseBalconyRailing: array[j].isStaircaseBalconyRailing,
|
|
10342
|
-
mapPosition:
|
|
10368
|
+
mapPosition: mapTmp
|
|
10343
10369
|
});
|
|
10344
10370
|
}
|
|
10345
10371
|
}
|
|
@@ -11960,6 +11986,7 @@ import { Readable, Writable, Duplex as Duplex2 } from "node:stream";
|
|
|
11960
11986
|
var defs_exports = {};
|
|
11961
11987
|
__export(defs_exports, {
|
|
11962
11988
|
Stop: () => Stop,
|
|
11989
|
+
abortSymbol: () => abortSymbol,
|
|
11963
11990
|
clearFunctionList: () => clearFunctionList,
|
|
11964
11991
|
combineMany: () => combineMany,
|
|
11965
11992
|
combineManyMut: () => combineManyMut,
|
|
@@ -11995,6 +12022,7 @@ var stop = /* @__PURE__ */ Symbol.for("object-stream.stop");
|
|
|
11995
12022
|
var finalSymbol = /* @__PURE__ */ Symbol.for("object-stream.final");
|
|
11996
12023
|
var manySymbol = /* @__PURE__ */ Symbol.for("object-stream.many");
|
|
11997
12024
|
var flushSymbol = /* @__PURE__ */ Symbol.for("object-stream.flush");
|
|
12025
|
+
var abortSymbol = /* @__PURE__ */ Symbol.for("object-stream.abort");
|
|
11998
12026
|
var fListSymbol = /* @__PURE__ */ Symbol.for("object-stream.fList");
|
|
11999
12027
|
var finalValue = (value) => ({ [finalSymbol]: 1, value });
|
|
12000
12028
|
var many = (values) => ({ [manySymbol]: 1, values });
|
|
@@ -12005,9 +12033,10 @@ var isFunctionList = (o) => o && o[fListSymbol] === 1;
|
|
|
12005
12033
|
var getFinalValue = (o) => o.value;
|
|
12006
12034
|
var getManyValues = (o) => o.values;
|
|
12007
12035
|
var getFunctionList = (o) => o.fList;
|
|
12008
|
-
var flushable = (write2, final3 = null) => {
|
|
12036
|
+
var flushable = (write2, final3 = null, abort = null) => {
|
|
12009
12037
|
const fn = final3 ? (value) => value === none ? final3() : write2(value) : write2;
|
|
12010
12038
|
fn[flushSymbol] = 1;
|
|
12039
|
+
if (abort) fn[abortSymbol] = abort;
|
|
12011
12040
|
return fn;
|
|
12012
12041
|
};
|
|
12013
12042
|
var setFunctionList = (o, fns) => {
|
|
@@ -12069,14 +12098,48 @@ var isDuplexNodeStream = (obj) => obj && typeof obj.pipe === "function" && obj._
|
|
|
12069
12098
|
var final = finalValue;
|
|
12070
12099
|
|
|
12071
12100
|
// node_modules/stream-chain/src/exec.js
|
|
12101
|
+
var cancelSymbol = /* @__PURE__ */ Symbol("cancel");
|
|
12102
|
+
var stopAtSymbol = /* @__PURE__ */ Symbol("stopAt");
|
|
12103
|
+
var markStop = (error, index) => {
|
|
12104
|
+
if (error instanceof Stop) error[stopAtSymbol] = index;
|
|
12105
|
+
throw error;
|
|
12106
|
+
};
|
|
12107
|
+
var stopIndex = (stop2, fns) => stop2[stopAtSymbol] ?? fns.length;
|
|
12108
|
+
var withCleanupError = (err, cleanupErr) => {
|
|
12109
|
+
if (err == null || err instanceof Stop) return cleanupErr;
|
|
12110
|
+
return err instanceof Error ? new AggregateError([err, cleanupErr], "pipeline error; generator cleanup also failed") : err;
|
|
12111
|
+
};
|
|
12112
|
+
var hasAborters = (fns) => fns.some((fn) => fn[abortSymbol]);
|
|
12113
|
+
var noteFinal = (value, fn, finished) => {
|
|
12114
|
+
if (value && typeof value.then == "function") return value.then((v2) => (finished.add(fn), v2));
|
|
12115
|
+
finished.add(fn);
|
|
12116
|
+
return value;
|
|
12117
|
+
};
|
|
12118
|
+
var abortStages = async (fns, finished, to = fns.length) => {
|
|
12119
|
+
let failure;
|
|
12120
|
+
for (let i = 0; i < to; ++i) {
|
|
12121
|
+
const fn = fns[i], abort = fn[abortSymbol];
|
|
12122
|
+
if (!abort || finished.has(fn)) continue;
|
|
12123
|
+
finished.add(fn);
|
|
12124
|
+
try {
|
|
12125
|
+
await abort();
|
|
12126
|
+
} catch (error) {
|
|
12127
|
+
failure = failure === void 0 ? error : new AggregateError([failure, error], "stage cleanup failed more than once");
|
|
12128
|
+
}
|
|
12129
|
+
}
|
|
12130
|
+
return failure;
|
|
12131
|
+
};
|
|
12072
12132
|
var next = (value, fns, index, push) => {
|
|
12073
12133
|
for (let i = index; ; ) {
|
|
12074
12134
|
if (value && typeof value.then == "function") {
|
|
12075
12135
|
const ii = i;
|
|
12076
|
-
return value.then(
|
|
12136
|
+
return value.then(
|
|
12137
|
+
(v2) => next(v2, fns, ii, push),
|
|
12138
|
+
(e) => markStop(e, ii)
|
|
12139
|
+
);
|
|
12077
12140
|
}
|
|
12078
12141
|
if (value == null || value === none) return;
|
|
12079
|
-
if (value === stop)
|
|
12142
|
+
if (value === stop) markStop(new Stop(), i);
|
|
12080
12143
|
if (isFinalValue(value)) {
|
|
12081
12144
|
return push(getFinalValue(value));
|
|
12082
12145
|
}
|
|
@@ -12089,7 +12152,11 @@ var next = (value, fns, index, push) => {
|
|
|
12089
12152
|
if (i >= fns.length) {
|
|
12090
12153
|
return push(value);
|
|
12091
12154
|
}
|
|
12092
|
-
|
|
12155
|
+
try {
|
|
12156
|
+
value = fns[i++](value);
|
|
12157
|
+
} catch (error) {
|
|
12158
|
+
markStop(error, i);
|
|
12159
|
+
}
|
|
12093
12160
|
}
|
|
12094
12161
|
};
|
|
12095
12162
|
var nextMany = (values, fns, i, push) => {
|
|
@@ -12107,13 +12174,22 @@ var nextMany = (values, fns, i, push) => {
|
|
|
12107
12174
|
var nextGen = (it, fns, i, push) => {
|
|
12108
12175
|
const step = () => {
|
|
12109
12176
|
for (; ; ) {
|
|
12110
|
-
|
|
12177
|
+
if (push[cancelSymbol]) throw push[cancelSymbol];
|
|
12178
|
+
let data;
|
|
12179
|
+
try {
|
|
12180
|
+
data = it.next();
|
|
12181
|
+
} catch (error) {
|
|
12182
|
+
markStop(error, i);
|
|
12183
|
+
}
|
|
12111
12184
|
if (data && typeof data.then == "function") {
|
|
12112
|
-
return data.then(
|
|
12113
|
-
|
|
12114
|
-
|
|
12115
|
-
|
|
12116
|
-
|
|
12185
|
+
return data.then(
|
|
12186
|
+
(d) => {
|
|
12187
|
+
if (d.done) return;
|
|
12188
|
+
const r3 = next(d.value, fns, i, push);
|
|
12189
|
+
return r3 && typeof r3.then == "function" ? r3.then(step) : step();
|
|
12190
|
+
},
|
|
12191
|
+
(e) => markStop(e, i)
|
|
12192
|
+
);
|
|
12117
12193
|
}
|
|
12118
12194
|
if (data.done) return;
|
|
12119
12195
|
const r2 = next(data.value, fns, i, push);
|
|
@@ -12121,7 +12197,7 @@ var nextGen = (it, fns, i, push) => {
|
|
|
12121
12197
|
}
|
|
12122
12198
|
};
|
|
12123
12199
|
const abort = (err) => {
|
|
12124
|
-
const onCleanupError = (cleanupErr) =>
|
|
12200
|
+
const onCleanupError = (cleanupErr) => withCleanupError(err, cleanupErr);
|
|
12125
12201
|
let ret;
|
|
12126
12202
|
try {
|
|
12127
12203
|
ret = it.return ? it.return() : void 0;
|
|
@@ -12148,40 +12224,86 @@ var nextGen = (it, fns, i, push) => {
|
|
|
12148
12224
|
}
|
|
12149
12225
|
return r && typeof r.then == "function" ? r.then(void 0, abort) : r;
|
|
12150
12226
|
};
|
|
12151
|
-
var flush = (fns, index, push) => {
|
|
12227
|
+
var flush = (fns, index, push, finished) => {
|
|
12228
|
+
let stop2 = null;
|
|
12229
|
+
const resume = (error) => {
|
|
12230
|
+
if (!(error instanceof Stop)) throw error;
|
|
12231
|
+
stop2 = error;
|
|
12232
|
+
return step(stopIndex(error, fns));
|
|
12233
|
+
};
|
|
12152
12234
|
const step = (i) => {
|
|
12153
12235
|
for (; i < fns.length; ++i) {
|
|
12154
12236
|
const f = fns[i];
|
|
12155
|
-
if (!isFlushable(f)) continue;
|
|
12156
|
-
|
|
12237
|
+
if (!isFlushable(f) || finished?.has(f)) continue;
|
|
12238
|
+
let r;
|
|
12239
|
+
try {
|
|
12240
|
+
let value;
|
|
12241
|
+
try {
|
|
12242
|
+
value = f(none);
|
|
12243
|
+
} catch (error) {
|
|
12244
|
+
markStop(error, i + 1);
|
|
12245
|
+
}
|
|
12246
|
+
if (finished) value = noteFinal(value, f, finished);
|
|
12247
|
+
r = next(value, fns, i + 1, push);
|
|
12248
|
+
} catch (error) {
|
|
12249
|
+
return resume(error);
|
|
12250
|
+
}
|
|
12157
12251
|
if (r && typeof r.then == "function") {
|
|
12158
12252
|
const ii = i;
|
|
12159
|
-
return r.then(() => step(ii + 1));
|
|
12253
|
+
return r.then(() => step(ii + 1), resume);
|
|
12160
12254
|
}
|
|
12161
12255
|
}
|
|
12256
|
+
if (stop2) throw stop2;
|
|
12162
12257
|
};
|
|
12163
12258
|
return step(index);
|
|
12164
12259
|
};
|
|
12165
|
-
|
|
12166
|
-
|
|
12167
|
-
|
|
12260
|
+
var releaseStopped = async (fns, finished, stop2) => {
|
|
12261
|
+
const failure = await abortStages(fns, finished, stopIndex(stop2, fns));
|
|
12262
|
+
if (failure === void 0) return void 0;
|
|
12263
|
+
const more = await abortStages(fns, finished);
|
|
12264
|
+
return more === void 0 ? failure : new AggregateError([failure, more], "stage cleanup failed more than once");
|
|
12265
|
+
};
|
|
12266
|
+
var finishStop = async (fns, stop2, push, finished) => {
|
|
12267
|
+
let error;
|
|
12268
|
+
try {
|
|
12269
|
+
await flush(fns, stopIndex(stop2, fns), push, finished);
|
|
12270
|
+
} catch (e) {
|
|
12271
|
+
if (e instanceof Stop) stop2 = e;
|
|
12272
|
+
else error = e;
|
|
12273
|
+
}
|
|
12274
|
+
const failure = error === void 0 ? await releaseStopped(fns, finished, stop2) : await abortStages(fns, finished);
|
|
12275
|
+
if (failure !== void 0) error = withCleanupError(error, failure);
|
|
12276
|
+
if (error !== void 0) throw error;
|
|
12277
|
+
};
|
|
12278
|
+
var genBridge = (fns, once) => {
|
|
12168
12279
|
fns = fns.filter((fn) => fn).flat(Infinity).map((fn) => isFunctionList(fn) ? getFunctionList(fn) : fn).flat(Infinity);
|
|
12169
12280
|
if (!fns.length) {
|
|
12170
12281
|
fns = [(x) => x];
|
|
12171
12282
|
}
|
|
12172
|
-
|
|
12283
|
+
const canAbort = hasAborters(fns), finished = /* @__PURE__ */ new Set();
|
|
12284
|
+
let flushed = false, stopAt = 0;
|
|
12285
|
+
const drive = async (value, push) => {
|
|
12286
|
+
try {
|
|
12287
|
+
await next(value, fns, 0, push);
|
|
12288
|
+
} catch (error) {
|
|
12289
|
+
if (!(error instanceof Stop)) throw error;
|
|
12290
|
+
await finishStop(fns, error, push, finished);
|
|
12291
|
+
throw error;
|
|
12292
|
+
}
|
|
12293
|
+
await flush(fns, 0, push, finished);
|
|
12294
|
+
};
|
|
12173
12295
|
let g = async function* (value) {
|
|
12174
12296
|
if (flushed) throw Error("Call to a flushed pipe.");
|
|
12175
|
-
const isFlush = value === none;
|
|
12176
|
-
if (isFlush) flushed = true;
|
|
12297
|
+
const isFlush = !once && value === none;
|
|
12298
|
+
if (isFlush || once) flushed = true;
|
|
12177
12299
|
const pending = [];
|
|
12178
12300
|
let wakeConsumer = null;
|
|
12179
12301
|
let resolveProducer = null;
|
|
12180
12302
|
let rejectProducer = null;
|
|
12181
|
-
let done = false, error = null, cancelled = false;
|
|
12182
|
-
const
|
|
12303
|
+
let done = false, error = null, cancelled = false, completed = false;
|
|
12304
|
+
const CANCEL3 = /* @__PURE__ */ Symbol("cancel");
|
|
12183
12305
|
const push = (v2) => {
|
|
12184
|
-
if (cancelled) throw
|
|
12306
|
+
if (cancelled) throw CANCEL3;
|
|
12185
12307
|
pending.push(v2);
|
|
12186
12308
|
if (wakeConsumer) {
|
|
12187
12309
|
const w = wakeConsumer;
|
|
@@ -12193,11 +12315,15 @@ var gen = (...fns) => {
|
|
|
12193
12315
|
rejectProducer = rej;
|
|
12194
12316
|
});
|
|
12195
12317
|
};
|
|
12196
|
-
Promise.resolve().then(
|
|
12318
|
+
Promise.resolve().then(
|
|
12319
|
+
() => once ? drive(value, push) : isFlush ? flush(fns, stopAt, push, finished) : next(value, fns, 0, push)
|
|
12320
|
+
).then(
|
|
12197
12321
|
() => {
|
|
12198
12322
|
},
|
|
12199
12323
|
(e) => {
|
|
12200
|
-
if (e
|
|
12324
|
+
if (e === CANCEL3) return;
|
|
12325
|
+
error = e;
|
|
12326
|
+
if (!isFlush && e instanceof Stop) stopAt = stopIndex(e, fns);
|
|
12201
12327
|
}
|
|
12202
12328
|
).finally(() => {
|
|
12203
12329
|
done = true;
|
|
@@ -12219,57 +12345,84 @@ var gen = (...fns) => {
|
|
|
12219
12345
|
yield v2;
|
|
12220
12346
|
}
|
|
12221
12347
|
if (error) throw error;
|
|
12222
|
-
if (done)
|
|
12348
|
+
if (done) {
|
|
12349
|
+
completed = true;
|
|
12350
|
+
return;
|
|
12351
|
+
}
|
|
12223
12352
|
await new Promise((res) => wakeConsumer = res);
|
|
12224
12353
|
}
|
|
12225
12354
|
} finally {
|
|
12226
12355
|
cancelled = true;
|
|
12356
|
+
push[cancelSymbol] = CANCEL3;
|
|
12227
12357
|
if (rejectProducer) {
|
|
12228
12358
|
const rj = rejectProducer;
|
|
12229
12359
|
resolveProducer = rejectProducer = null;
|
|
12230
|
-
rj(
|
|
12360
|
+
rj(CANCEL3);
|
|
12361
|
+
}
|
|
12362
|
+
if (!completed && canAbort) {
|
|
12363
|
+
const failure = error instanceof Stop ? await releaseStopped(fns, finished, error) : await abortStages(fns, finished);
|
|
12364
|
+
if (failure !== void 0) throw withCleanupError(error, failure);
|
|
12231
12365
|
}
|
|
12232
12366
|
}
|
|
12233
12367
|
};
|
|
12368
|
+
if (once) return g;
|
|
12234
12369
|
const needToFlush = fns.some((fn) => isFlushable(fn));
|
|
12235
12370
|
if (needToFlush) g = flushable(g);
|
|
12236
12371
|
return setFunctionList(g, fns);
|
|
12237
12372
|
};
|
|
12373
|
+
|
|
12374
|
+
// node_modules/stream-chain/src/gen.js
|
|
12375
|
+
var gen = (...fns) => genBridge(fns, false);
|
|
12238
12376
|
var gen_default = gen;
|
|
12239
12377
|
|
|
12240
12378
|
// node_modules/stream-chain/src/asStream.js
|
|
12241
12379
|
import { Duplex } from "node:stream";
|
|
12380
|
+
var CANCEL = /* @__PURE__ */ Symbol("cancel");
|
|
12242
12381
|
var asStream = (fn, options) => {
|
|
12243
12382
|
if (typeof fn != "function") {
|
|
12244
12383
|
throw TypeError("Only a function is accepted as the first argument");
|
|
12245
12384
|
}
|
|
12246
12385
|
const innerFns = isFunctionList(fn) ? fn.fList : null;
|
|
12386
|
+
const stages = innerFns ?? [fn];
|
|
12387
|
+
const canAbort = hasAborters(stages), finished = /* @__PURE__ */ new Set();
|
|
12247
12388
|
let stopped = false;
|
|
12389
|
+
let destroyed = false;
|
|
12390
|
+
let flushed = false;
|
|
12248
12391
|
let nullPushed = false;
|
|
12249
12392
|
let resolvePaused = null;
|
|
12393
|
+
let rejectPaused = null;
|
|
12250
12394
|
let stream = null;
|
|
12251
12395
|
const resume = () => {
|
|
12252
12396
|
if (!resolvePaused) return;
|
|
12253
12397
|
const resolve = resolvePaused;
|
|
12254
|
-
resolvePaused = null;
|
|
12398
|
+
resolvePaused = rejectPaused = null;
|
|
12255
12399
|
resolve();
|
|
12256
12400
|
};
|
|
12401
|
+
const cancelPaused = () => {
|
|
12402
|
+
if (!rejectPaused) return;
|
|
12403
|
+
const reject = rejectPaused;
|
|
12404
|
+
resolvePaused = rejectPaused = null;
|
|
12405
|
+
reject(CANCEL);
|
|
12406
|
+
};
|
|
12257
12407
|
const signalEnd = () => {
|
|
12258
12408
|
if (nullPushed) return;
|
|
12259
12409
|
nullPushed = true;
|
|
12260
12410
|
stream.push(null);
|
|
12261
12411
|
};
|
|
12262
12412
|
const enqueue = (value) => {
|
|
12263
|
-
if (
|
|
12413
|
+
if (destroyed) throw CANCEL;
|
|
12414
|
+
if (nullPushed) return;
|
|
12264
12415
|
if (!stream.push(value)) {
|
|
12265
|
-
return new Promise((resolve) => {
|
|
12416
|
+
return new Promise((resolve, reject) => {
|
|
12266
12417
|
resolvePaused = resolve;
|
|
12418
|
+
rejectPaused = reject;
|
|
12267
12419
|
});
|
|
12268
12420
|
}
|
|
12269
12421
|
};
|
|
12270
12422
|
const queue = [];
|
|
12271
12423
|
const pump = async () => {
|
|
12272
12424
|
while (queue.length) {
|
|
12425
|
+
if (destroyed) throw CANCEL;
|
|
12273
12426
|
const g = queue[queue.length - 1];
|
|
12274
12427
|
let result = g.next();
|
|
12275
12428
|
if (result && typeof result.then == "function") result = await result;
|
|
@@ -12283,6 +12436,17 @@ var asStream = (fn, options) => {
|
|
|
12283
12436
|
if (r) await r;
|
|
12284
12437
|
}
|
|
12285
12438
|
};
|
|
12439
|
+
const release = async (error) => {
|
|
12440
|
+
while (queue.length) {
|
|
12441
|
+
const g = queue.pop();
|
|
12442
|
+
try {
|
|
12443
|
+
if (g.return) await g.return();
|
|
12444
|
+
} catch (cleanupErr) {
|
|
12445
|
+
error = withCleanupError(error, cleanupErr);
|
|
12446
|
+
}
|
|
12447
|
+
}
|
|
12448
|
+
throw error;
|
|
12449
|
+
};
|
|
12286
12450
|
const processValue = (value) => {
|
|
12287
12451
|
if (value && typeof value.then == "function") {
|
|
12288
12452
|
return value.then(processValue);
|
|
@@ -12308,22 +12472,26 @@ var asStream = (fn, options) => {
|
|
|
12308
12472
|
}
|
|
12309
12473
|
if (value && typeof value.next == "function") {
|
|
12310
12474
|
queue.push(value);
|
|
12311
|
-
return pump();
|
|
12475
|
+
return pump().catch(release);
|
|
12312
12476
|
}
|
|
12313
12477
|
return enqueue(value);
|
|
12314
12478
|
};
|
|
12315
|
-
const
|
|
12316
|
-
if (error
|
|
12479
|
+
const finishWrite = (callback, error) => {
|
|
12480
|
+
if (!error || error === CANCEL) {
|
|
12481
|
+
callback(null);
|
|
12482
|
+
} else if (!(error instanceof Stop)) {
|
|
12483
|
+
callback(error);
|
|
12484
|
+
} else {
|
|
12317
12485
|
stopped = true;
|
|
12318
|
-
|
|
12319
|
-
|
|
12486
|
+
finishStop(stages, error, enqueue, finished).then(
|
|
12487
|
+
() => {
|
|
12488
|
+
flushed = true;
|
|
12489
|
+
signalEnd();
|
|
12490
|
+
callback(null);
|
|
12491
|
+
},
|
|
12492
|
+
(failure) => callback(failure)
|
|
12493
|
+
);
|
|
12320
12494
|
}
|
|
12321
|
-
return false;
|
|
12322
|
-
};
|
|
12323
|
-
const finishWrite = (callback, error) => {
|
|
12324
|
-
if (!error) return callback(null);
|
|
12325
|
-
if (absorbStop(error)) return callback(null);
|
|
12326
|
-
callback(error);
|
|
12327
12495
|
};
|
|
12328
12496
|
stream = new Duplex({
|
|
12329
12497
|
writableObjectMode: true,
|
|
@@ -12365,13 +12533,18 @@ var asStream = (fn, options) => {
|
|
|
12365
12533
|
},
|
|
12366
12534
|
final(callback) {
|
|
12367
12535
|
const onComplete = () => {
|
|
12536
|
+
flushed = true;
|
|
12368
12537
|
signalEnd();
|
|
12369
12538
|
callback(null);
|
|
12370
12539
|
};
|
|
12540
|
+
if (stopped) {
|
|
12541
|
+
onComplete();
|
|
12542
|
+
return;
|
|
12543
|
+
}
|
|
12371
12544
|
if (innerFns) {
|
|
12372
12545
|
let r2;
|
|
12373
12546
|
try {
|
|
12374
|
-
r2 = flush(innerFns, 0, enqueue);
|
|
12547
|
+
r2 = flush(innerFns, 0, enqueue, finished);
|
|
12375
12548
|
} catch (error) {
|
|
12376
12549
|
return finishWrite(callback, error);
|
|
12377
12550
|
}
|
|
@@ -12388,7 +12561,8 @@ var asStream = (fn, options) => {
|
|
|
12388
12561
|
}
|
|
12389
12562
|
let r;
|
|
12390
12563
|
try {
|
|
12391
|
-
|
|
12564
|
+
const value = fn(none, null);
|
|
12565
|
+
r = processValue(noteFinal(value, fn, finished));
|
|
12392
12566
|
} catch (error) {
|
|
12393
12567
|
return finishWrite(callback, error);
|
|
12394
12568
|
}
|
|
@@ -12404,9 +12578,21 @@ var asStream = (fn, options) => {
|
|
|
12404
12578
|
// Unblock any pending paused-promise so an in-flight write can settle —
|
|
12405
12579
|
// mirrors asWebStream's controller.signal listener for writer.abort().
|
|
12406
12580
|
destroy(error, callback) {
|
|
12407
|
-
stopped = true;
|
|
12408
|
-
|
|
12409
|
-
|
|
12581
|
+
stopped = destroyed = true;
|
|
12582
|
+
enqueue[cancelSymbol] = CANCEL;
|
|
12583
|
+
cancelPaused();
|
|
12584
|
+
if (flushed || !canAbort) {
|
|
12585
|
+
callback(error);
|
|
12586
|
+
return;
|
|
12587
|
+
}
|
|
12588
|
+
abortStages(stages, finished).then(
|
|
12589
|
+
(failure) => callback(
|
|
12590
|
+
failure === void 0 ? error : (
|
|
12591
|
+
/** @type {Error} */
|
|
12592
|
+
withCleanupError(error, failure)
|
|
12593
|
+
)
|
|
12594
|
+
)
|
|
12595
|
+
);
|
|
12410
12596
|
}
|
|
12411
12597
|
});
|
|
12412
12598
|
return stream;
|
|
@@ -12414,6 +12600,7 @@ var asStream = (fn, options) => {
|
|
|
12414
12600
|
var asStream_default = asStream;
|
|
12415
12601
|
|
|
12416
12602
|
// node_modules/stream-chain/src/asWebStream.js
|
|
12603
|
+
var CANCEL2 = /* @__PURE__ */ Symbol("cancel");
|
|
12417
12604
|
var asWebStream = (fn, options) => {
|
|
12418
12605
|
if (isDuplexWebStream(fn) || isReadableWebStream(fn) || isWritableWebStream(fn)) {
|
|
12419
12606
|
return fn;
|
|
@@ -12425,18 +12612,30 @@ var asWebStream = (fn, options) => {
|
|
|
12425
12612
|
const readableStrategy = options?.readableStrategy ?? strategy;
|
|
12426
12613
|
const writableStrategy = options?.writableStrategy ?? strategy;
|
|
12427
12614
|
const innerFns = isFunctionList(fn) ? fn.fList : null;
|
|
12615
|
+
const stages = innerFns ?? [fn];
|
|
12616
|
+
const canAbort = hasAborters(stages), finished = /* @__PURE__ */ new Set();
|
|
12428
12617
|
let stopped = false;
|
|
12618
|
+
let cancelled = false;
|
|
12619
|
+
let flushed = false;
|
|
12620
|
+
let releasing = null;
|
|
12429
12621
|
let readableClosed = false;
|
|
12430
12622
|
let writableErrored = false;
|
|
12431
12623
|
let readableController;
|
|
12432
12624
|
let writableController;
|
|
12433
12625
|
let pendingDrain = null;
|
|
12626
|
+
let rejectDrain = null;
|
|
12434
12627
|
const unblockDrain = () => {
|
|
12435
12628
|
if (!pendingDrain) return;
|
|
12436
12629
|
const resolve = pendingDrain;
|
|
12437
|
-
pendingDrain = null;
|
|
12630
|
+
pendingDrain = rejectDrain = null;
|
|
12438
12631
|
resolve();
|
|
12439
12632
|
};
|
|
12633
|
+
const cancelDrain = () => {
|
|
12634
|
+
if (!rejectDrain) return;
|
|
12635
|
+
const reject = rejectDrain;
|
|
12636
|
+
pendingDrain = rejectDrain = null;
|
|
12637
|
+
reject(CANCEL2);
|
|
12638
|
+
};
|
|
12440
12639
|
const closeReadable = () => {
|
|
12441
12640
|
if (readableClosed) return;
|
|
12442
12641
|
readableClosed = true;
|
|
@@ -12461,26 +12660,42 @@ var asWebStream = (fn, options) => {
|
|
|
12461
12660
|
unblockDrain();
|
|
12462
12661
|
},
|
|
12463
12662
|
cancel(reason) {
|
|
12464
|
-
stopped = true;
|
|
12465
12663
|
readableClosed = true;
|
|
12466
|
-
|
|
12664
|
+
cancelProducer();
|
|
12467
12665
|
errorWritable(reason);
|
|
12666
|
+
return releaseStages().then(rethrow);
|
|
12468
12667
|
}
|
|
12469
12668
|
},
|
|
12470
12669
|
readableStrategy
|
|
12471
12670
|
);
|
|
12472
12671
|
const enqueue = (value) => {
|
|
12473
|
-
if (
|
|
12672
|
+
if (cancelled) throw CANCEL2;
|
|
12673
|
+
if (readableClosed) return;
|
|
12474
12674
|
readableController.enqueue(value);
|
|
12475
12675
|
if (readableController.desiredSize <= 0) {
|
|
12476
|
-
return new Promise((resolve) => {
|
|
12676
|
+
return new Promise((resolve, reject) => {
|
|
12477
12677
|
pendingDrain = resolve;
|
|
12678
|
+
rejectDrain = reject;
|
|
12478
12679
|
});
|
|
12479
12680
|
}
|
|
12480
12681
|
};
|
|
12682
|
+
const cancelProducer = () => {
|
|
12683
|
+
stopped = cancelled = true;
|
|
12684
|
+
enqueue[cancelSymbol] = CANCEL2;
|
|
12685
|
+
cancelDrain();
|
|
12686
|
+
};
|
|
12687
|
+
const releaseStages = () => {
|
|
12688
|
+
if (flushed || !canAbort) return Promise.resolve(void 0);
|
|
12689
|
+
releasing ??= abortStages(stages, finished);
|
|
12690
|
+
return releasing;
|
|
12691
|
+
};
|
|
12692
|
+
const rethrow = (failure) => {
|
|
12693
|
+
if (failure !== void 0) throw failure;
|
|
12694
|
+
};
|
|
12481
12695
|
const queue = [];
|
|
12482
12696
|
const pump = async () => {
|
|
12483
12697
|
while (queue.length) {
|
|
12698
|
+
if (cancelled) throw CANCEL2;
|
|
12484
12699
|
const g = queue[queue.length - 1];
|
|
12485
12700
|
let result = g.next();
|
|
12486
12701
|
if (result && typeof result.then == "function") result = await result;
|
|
@@ -12494,6 +12709,17 @@ var asWebStream = (fn, options) => {
|
|
|
12494
12709
|
if (r) await r;
|
|
12495
12710
|
}
|
|
12496
12711
|
};
|
|
12712
|
+
const release = async (error) => {
|
|
12713
|
+
while (queue.length) {
|
|
12714
|
+
const g = queue.pop();
|
|
12715
|
+
try {
|
|
12716
|
+
if (g.return) await g.return();
|
|
12717
|
+
} catch (cleanupErr) {
|
|
12718
|
+
error = withCleanupError(error, cleanupErr);
|
|
12719
|
+
}
|
|
12720
|
+
}
|
|
12721
|
+
throw error;
|
|
12722
|
+
};
|
|
12497
12723
|
const processValue = (value) => {
|
|
12498
12724
|
if (value && typeof value.then == "function") {
|
|
12499
12725
|
return value.then(processValue);
|
|
@@ -12519,16 +12745,20 @@ var asWebStream = (fn, options) => {
|
|
|
12519
12745
|
}
|
|
12520
12746
|
if (value && typeof value.next == "function") {
|
|
12521
12747
|
queue.push(value);
|
|
12522
|
-
return pump();
|
|
12748
|
+
return pump().catch(release);
|
|
12523
12749
|
}
|
|
12524
12750
|
return enqueue(value);
|
|
12525
12751
|
};
|
|
12526
|
-
const
|
|
12527
|
-
|
|
12528
|
-
|
|
12529
|
-
|
|
12752
|
+
const endAfterStop = async (stop2) => {
|
|
12753
|
+
stopped = true;
|
|
12754
|
+
try {
|
|
12755
|
+
await finishStop(stages, stop2, enqueue, finished);
|
|
12756
|
+
} catch (error) {
|
|
12757
|
+
errorReadable(error);
|
|
12758
|
+
throw error;
|
|
12530
12759
|
}
|
|
12531
|
-
|
|
12760
|
+
flushed = true;
|
|
12761
|
+
closeReadable();
|
|
12532
12762
|
};
|
|
12533
12763
|
const writable = new WritableStream(
|
|
12534
12764
|
{
|
|
@@ -12543,10 +12773,7 @@ var asWebStream = (fn, options) => {
|
|
|
12543
12773
|
// Bun, which only loses the abort wakeup.
|
|
12544
12774
|
start(controller) {
|
|
12545
12775
|
writableController = controller;
|
|
12546
|
-
controller.signal?.addEventListener("abort",
|
|
12547
|
-
stopped = true;
|
|
12548
|
-
unblockDrain();
|
|
12549
|
-
});
|
|
12776
|
+
controller.signal?.addEventListener("abort", cancelProducer);
|
|
12550
12777
|
},
|
|
12551
12778
|
async write(chunk) {
|
|
12552
12779
|
if (stopped) return;
|
|
@@ -12559,34 +12786,39 @@ var asWebStream = (fn, options) => {
|
|
|
12559
12786
|
const r = processValue(fn(chunk));
|
|
12560
12787
|
if (r) await r;
|
|
12561
12788
|
} catch (error) {
|
|
12562
|
-
if (
|
|
12789
|
+
if (error === CANCEL2) return;
|
|
12790
|
+
if (error instanceof Stop) return endAfterStop(error);
|
|
12563
12791
|
errorReadable(error);
|
|
12564
|
-
|
|
12792
|
+
const failure = await releaseStages();
|
|
12793
|
+
throw failure === void 0 ? error : withCleanupError(error, failure);
|
|
12565
12794
|
}
|
|
12566
12795
|
},
|
|
12567
12796
|
async close() {
|
|
12568
12797
|
try {
|
|
12569
12798
|
if (!stopped) {
|
|
12570
12799
|
if (innerFns) {
|
|
12571
|
-
const r = flush(innerFns, 0, enqueue);
|
|
12800
|
+
const r = flush(innerFns, 0, enqueue, finished);
|
|
12572
12801
|
if (r) await r;
|
|
12573
12802
|
} else if (isFlushable(fn)) {
|
|
12574
|
-
const r = processValue(fn(none));
|
|
12803
|
+
const r = processValue(noteFinal(fn(none), fn, finished));
|
|
12575
12804
|
if (r) await r;
|
|
12576
12805
|
}
|
|
12806
|
+
flushed = true;
|
|
12577
12807
|
}
|
|
12578
12808
|
} catch (error) {
|
|
12579
|
-
if (
|
|
12809
|
+
if (error instanceof Stop) return endAfterStop(error);
|
|
12810
|
+
if (error !== CANCEL2) {
|
|
12580
12811
|
errorReadable(error);
|
|
12581
|
-
|
|
12812
|
+
const failure = await releaseStages();
|
|
12813
|
+
throw failure === void 0 ? error : withCleanupError(error, failure);
|
|
12582
12814
|
}
|
|
12583
12815
|
}
|
|
12584
12816
|
closeReadable();
|
|
12585
12817
|
},
|
|
12586
12818
|
abort(reason) {
|
|
12587
|
-
|
|
12588
|
-
unblockDrain();
|
|
12819
|
+
cancelProducer();
|
|
12589
12820
|
errorReadable(reason);
|
|
12821
|
+
return releaseStages().then(rethrow);
|
|
12590
12822
|
}
|
|
12591
12823
|
},
|
|
12592
12824
|
writableStrategy
|
|
@@ -12726,7 +12958,13 @@ var chain = (fns, options) => {
|
|
|
12726
12958
|
writable: isWritableNodeStream2(input),
|
|
12727
12959
|
write: writeMethod,
|
|
12728
12960
|
final: finalMethod,
|
|
12729
|
-
read: readMethod
|
|
12961
|
+
read: readMethod,
|
|
12962
|
+
destroy(error, callback) {
|
|
12963
|
+
if (!stream.writableFinished || !stream.readableEnded) {
|
|
12964
|
+
for (const item of streams) item.destroy();
|
|
12965
|
+
}
|
|
12966
|
+
callback(error);
|
|
12967
|
+
}
|
|
12730
12968
|
});
|
|
12731
12969
|
stream.streams = streams;
|
|
12732
12970
|
stream.input = input;
|
|
@@ -12754,6 +12992,7 @@ chain.getManyValues = getManyValues;
|
|
|
12754
12992
|
chain.flushSymbol = flushSymbol;
|
|
12755
12993
|
chain.flushable = flushable;
|
|
12756
12994
|
chain.isFlushable = isFlushable;
|
|
12995
|
+
chain.abortSymbol = abortSymbol;
|
|
12757
12996
|
chain.fListSymbol = fListSymbol;
|
|
12758
12997
|
chain.isFunctionList = isFunctionList;
|
|
12759
12998
|
chain.getFunctionList = getFunctionList;
|
|
@@ -12776,7 +13015,11 @@ var asArray = (...fns) => {
|
|
|
12776
13015
|
if (!fns.length) {
|
|
12777
13016
|
fns = [(x) => x];
|
|
12778
13017
|
}
|
|
12779
|
-
let flushed = false;
|
|
13018
|
+
let flushed = false, stopAt = 0;
|
|
13019
|
+
const noteStop = (error) => {
|
|
13020
|
+
if (error instanceof Stop) stopAt = stopIndex(error, fns);
|
|
13021
|
+
throw error;
|
|
13022
|
+
};
|
|
12780
13023
|
let g = (value) => {
|
|
12781
13024
|
if (flushed) throw Error("Call to a flushed pipe.");
|
|
12782
13025
|
const results = [], push = (v2) => {
|
|
@@ -12784,12 +13027,16 @@ var asArray = (...fns) => {
|
|
|
12784
13027
|
};
|
|
12785
13028
|
let pending;
|
|
12786
13029
|
if (value !== none) {
|
|
12787
|
-
|
|
13030
|
+
try {
|
|
13031
|
+
pending = next(value, fns, 0, push);
|
|
13032
|
+
} catch (error) {
|
|
13033
|
+
noteStop(error);
|
|
13034
|
+
}
|
|
12788
13035
|
} else {
|
|
12789
13036
|
flushed = true;
|
|
12790
|
-
pending = flush(fns,
|
|
13037
|
+
pending = flush(fns, stopAt, push);
|
|
12791
13038
|
}
|
|
12792
|
-
return pending && typeof pending.then == "function" ? pending.then(() => results) : results;
|
|
13039
|
+
return pending && typeof pending.then == "function" ? pending.then(() => results, noteStop) : results;
|
|
12793
13040
|
};
|
|
12794
13041
|
const needToFlush = fns.some((fn) => isFlushable(fn));
|
|
12795
13042
|
if (needToFlush) g = flushable(g);
|
|
@@ -12901,6 +13148,7 @@ chain2.getManyValues = getManyValues;
|
|
|
12901
13148
|
chain2.flushSymbol = flushSymbol;
|
|
12902
13149
|
chain2.flushable = flushable;
|
|
12903
13150
|
chain2.isFlushable = isFlushable;
|
|
13151
|
+
chain2.abortSymbol = abortSymbol;
|
|
12904
13152
|
chain2.fListSymbol = fListSymbol;
|
|
12905
13153
|
chain2.isFunctionList = isFunctionList;
|
|
12906
13154
|
chain2.getFunctionList = getFunctionList;
|
|
@@ -12949,6 +13197,7 @@ chain3.getManyValues = getManyValues;
|
|
|
12949
13197
|
chain3.flushSymbol = flushSymbol;
|
|
12950
13198
|
chain3.flushable = flushable;
|
|
12951
13199
|
chain3.isFlushable = isFlushable;
|
|
13200
|
+
chain3.abortSymbol = abortSymbol;
|
|
12952
13201
|
chain3.fListSymbol = fListSymbol;
|
|
12953
13202
|
chain3.isFunctionList = isFunctionList;
|
|
12954
13203
|
chain3.getFunctionList = getFunctionList;
|
|
@@ -12965,22 +13214,33 @@ chain3.fun = fun_default;
|
|
|
12965
13214
|
chain3.dataSource = dataSource_default;
|
|
12966
13215
|
|
|
12967
13216
|
// node_modules/stream-chain/src/utils/fixUtf8Stream.js
|
|
12968
|
-
var
|
|
12969
|
-
|
|
13217
|
+
var dropBOM = (s) => s.charCodeAt(0) === 65279 ? s.slice(1) : s;
|
|
13218
|
+
var makeTextDecoderImpl = (options) => {
|
|
13219
|
+
const textDecoder = new TextDecoder("utf-8", { ignoreBOM: true });
|
|
13220
|
+
let atStart = !options?.ignoreBOM;
|
|
12970
13221
|
return flushable((chunk) => {
|
|
12971
|
-
|
|
12972
|
-
if (
|
|
12973
|
-
if (chunk
|
|
12974
|
-
|
|
13222
|
+
let s;
|
|
13223
|
+
if (chunk === none) s = textDecoder.decode();
|
|
13224
|
+
else if (typeof chunk == "string") s = chunk;
|
|
13225
|
+
else if (chunk instanceof Uint8Array) s = textDecoder.decode(chunk, { stream: true });
|
|
13226
|
+
else throw new TypeError("Expected a string or a Uint8Array");
|
|
13227
|
+
if (!atStart || !s) return s;
|
|
13228
|
+
atStart = false;
|
|
13229
|
+
return dropBOM(s);
|
|
12975
13230
|
});
|
|
12976
13231
|
};
|
|
12977
|
-
var makeStringDecoderImpl = (StringDecoder) => () => {
|
|
13232
|
+
var makeStringDecoderImpl = (StringDecoder) => (options) => {
|
|
12978
13233
|
const stringDecoder = new StringDecoder();
|
|
13234
|
+
let atStart = !options?.ignoreBOM;
|
|
12979
13235
|
return flushable((chunk) => {
|
|
12980
|
-
|
|
12981
|
-
if (
|
|
12982
|
-
if (chunk
|
|
12983
|
-
|
|
13236
|
+
let s;
|
|
13237
|
+
if (chunk === none) s = stringDecoder.end();
|
|
13238
|
+
else if (typeof chunk == "string") s = chunk;
|
|
13239
|
+
else if (chunk instanceof Uint8Array) s = stringDecoder.write(chunk);
|
|
13240
|
+
else throw new TypeError("Expected a string or a Uint8Array");
|
|
13241
|
+
if (!atStart || !s) return s;
|
|
13242
|
+
atStart = false;
|
|
13243
|
+
return dropBOM(s);
|
|
12984
13244
|
});
|
|
12985
13245
|
};
|
|
12986
13246
|
var impl = makeTextDecoderImpl;
|
|
@@ -12995,7 +13255,7 @@ var readyPromise = isNode ? import("node:string_decoder").then(
|
|
|
12995
13255
|
}
|
|
12996
13256
|
// squelch — stick with TextDecoder
|
|
12997
13257
|
) : Promise.resolve();
|
|
12998
|
-
var fixUtf8Stream = () => impl();
|
|
13258
|
+
var fixUtf8Stream = (options) => impl(options);
|
|
12999
13259
|
var fixUtf8Stream_default = fixUtf8Stream;
|
|
13000
13260
|
|
|
13001
13261
|
// node_modules/stream-json/src/core/parser.js
|
|
@@ -15089,6 +15349,8 @@ var getWindowData = (lines, pcdData, lineReader) => {
|
|
|
15089
15349
|
if (inRectPercentage < 0.8)
|
|
15090
15350
|
continue;
|
|
15091
15351
|
}
|
|
15352
|
+
if (windowPcd.maxZ < doorAndBeamDataObj.windowBottomSt.z || Math.abs(windowPcd.maxZ - doorAndBeamDataObj.windowBottomSt.z) < 0.3)
|
|
15353
|
+
continue;
|
|
15092
15354
|
line2.windowIdToCheckResults.push([region.index, id]);
|
|
15093
15355
|
if (windowDatas[findDoorDataIndex].findLineIndex.length > 0) {
|
|
15094
15356
|
let lineIndex = windowDatas[findDoorDataIndex].findLineIndex[0];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rm-graphical-computing-node",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.126",
|
|
4
4
|
"description": "墙体/梁线/点云语义计算库(依赖 Python 与 three.js)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.mjs",
|
|
@@ -22,6 +22,8 @@
|
|
|
22
22
|
"geojson-minimum-bounding-rectangle": "^2.0.3",
|
|
23
23
|
"rm-gxf-computing-rusts": "^0.0.61",
|
|
24
24
|
"rm-point-cloud-calculation": "^1.0.4",
|
|
25
|
+
"stream-chain": "^4.3.0",
|
|
26
|
+
"stream-json": "^3.7.0",
|
|
25
27
|
"three": "^0.184.0"
|
|
26
28
|
},
|
|
27
29
|
"devDependencies": {
|