microboard-temp 0.5.94 → 0.5.95
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/cjs/browser.js +9 -9
- package/dist/cjs/index.js +9 -9
- package/dist/cjs/node.js +9 -9
- package/dist/esm/browser.js +9 -9
- package/dist/esm/index.js +9 -9
- package/dist/esm/node.js +9 -9
- package/package.json +1 -1
package/dist/cjs/browser.js
CHANGED
|
@@ -36849,15 +36849,15 @@ function findPath(start, end, grid, obstacles, existingPath, newStart, newEnd) {
|
|
|
36849
36849
|
return;
|
|
36850
36850
|
}
|
|
36851
36851
|
function findPathPoints(points, grid, obstacles, newStart, newEnd) {
|
|
36852
|
-
|
|
36853
|
-
|
|
36854
|
-
if (points.length > 0) {
|
|
36855
|
-
finalPath.push(points[0]);
|
|
36856
|
-
const startKey = `${points[0].x},${points[0].y}`;
|
|
36857
|
-
existingPathSegments.add(startKey);
|
|
36852
|
+
if (points.length < 2) {
|
|
36853
|
+
return points;
|
|
36858
36854
|
}
|
|
36855
|
+
const finalPath = [points[0]];
|
|
36856
|
+
const existingPathSegments = new Set([`${points[0].x},${points[0].y}`]);
|
|
36859
36857
|
for (let i = 0;i < points.length - 1; i += 1) {
|
|
36860
|
-
const
|
|
36858
|
+
const startSegment = points[i];
|
|
36859
|
+
const endSegment = points[i + 1];
|
|
36860
|
+
const segmentPath = findPath(startSegment, endSegment, grid, obstacles, existingPathSegments, newStart, newEnd);
|
|
36861
36861
|
if (segmentPath && segmentPath.length > 0) {
|
|
36862
36862
|
for (let j = 1;j < segmentPath.length; j++) {
|
|
36863
36863
|
const point5 = segmentPath[j];
|
|
@@ -36866,8 +36866,8 @@ function findPathPoints(points, grid, obstacles, newStart, newEnd) {
|
|
|
36866
36866
|
existingPathSegments.add(key);
|
|
36867
36867
|
}
|
|
36868
36868
|
} else {
|
|
36869
|
-
|
|
36870
|
-
|
|
36869
|
+
console.error(`Could not find path from ${startSegment.x},${startSegment.y} to ${endSegment.x},${endSegment.y}`);
|
|
36870
|
+
return [];
|
|
36871
36871
|
}
|
|
36872
36872
|
}
|
|
36873
36873
|
return finalPath;
|
package/dist/cjs/index.js
CHANGED
|
@@ -36849,15 +36849,15 @@ function findPath(start, end, grid, obstacles, existingPath, newStart, newEnd) {
|
|
|
36849
36849
|
return;
|
|
36850
36850
|
}
|
|
36851
36851
|
function findPathPoints(points, grid, obstacles, newStart, newEnd) {
|
|
36852
|
-
|
|
36853
|
-
|
|
36854
|
-
if (points.length > 0) {
|
|
36855
|
-
finalPath.push(points[0]);
|
|
36856
|
-
const startKey = `${points[0].x},${points[0].y}`;
|
|
36857
|
-
existingPathSegments.add(startKey);
|
|
36852
|
+
if (points.length < 2) {
|
|
36853
|
+
return points;
|
|
36858
36854
|
}
|
|
36855
|
+
const finalPath = [points[0]];
|
|
36856
|
+
const existingPathSegments = new Set([`${points[0].x},${points[0].y}`]);
|
|
36859
36857
|
for (let i = 0;i < points.length - 1; i += 1) {
|
|
36860
|
-
const
|
|
36858
|
+
const startSegment = points[i];
|
|
36859
|
+
const endSegment = points[i + 1];
|
|
36860
|
+
const segmentPath = findPath(startSegment, endSegment, grid, obstacles, existingPathSegments, newStart, newEnd);
|
|
36861
36861
|
if (segmentPath && segmentPath.length > 0) {
|
|
36862
36862
|
for (let j = 1;j < segmentPath.length; j++) {
|
|
36863
36863
|
const point5 = segmentPath[j];
|
|
@@ -36866,8 +36866,8 @@ function findPathPoints(points, grid, obstacles, newStart, newEnd) {
|
|
|
36866
36866
|
existingPathSegments.add(key);
|
|
36867
36867
|
}
|
|
36868
36868
|
} else {
|
|
36869
|
-
|
|
36870
|
-
|
|
36869
|
+
console.error(`Could not find path from ${startSegment.x},${startSegment.y} to ${endSegment.x},${endSegment.y}`);
|
|
36870
|
+
return [];
|
|
36871
36871
|
}
|
|
36872
36872
|
}
|
|
36873
36873
|
return finalPath;
|
package/dist/cjs/node.js
CHANGED
|
@@ -39322,15 +39322,15 @@ function findPath(start, end, grid, obstacles, existingPath, newStart, newEnd) {
|
|
|
39322
39322
|
return;
|
|
39323
39323
|
}
|
|
39324
39324
|
function findPathPoints(points, grid, obstacles, newStart, newEnd) {
|
|
39325
|
-
|
|
39326
|
-
|
|
39327
|
-
if (points.length > 0) {
|
|
39328
|
-
finalPath.push(points[0]);
|
|
39329
|
-
const startKey = `${points[0].x},${points[0].y}`;
|
|
39330
|
-
existingPathSegments.add(startKey);
|
|
39325
|
+
if (points.length < 2) {
|
|
39326
|
+
return points;
|
|
39331
39327
|
}
|
|
39328
|
+
const finalPath = [points[0]];
|
|
39329
|
+
const existingPathSegments = new Set([`${points[0].x},${points[0].y}`]);
|
|
39332
39330
|
for (let i = 0;i < points.length - 1; i += 1) {
|
|
39333
|
-
const
|
|
39331
|
+
const startSegment = points[i];
|
|
39332
|
+
const endSegment = points[i + 1];
|
|
39333
|
+
const segmentPath = findPath(startSegment, endSegment, grid, obstacles, existingPathSegments, newStart, newEnd);
|
|
39334
39334
|
if (segmentPath && segmentPath.length > 0) {
|
|
39335
39335
|
for (let j = 1;j < segmentPath.length; j++) {
|
|
39336
39336
|
const point5 = segmentPath[j];
|
|
@@ -39339,8 +39339,8 @@ function findPathPoints(points, grid, obstacles, newStart, newEnd) {
|
|
|
39339
39339
|
existingPathSegments.add(key);
|
|
39340
39340
|
}
|
|
39341
39341
|
} else {
|
|
39342
|
-
|
|
39343
|
-
|
|
39342
|
+
console.error(`Could not find path from ${startSegment.x},${startSegment.y} to ${endSegment.x},${endSegment.y}`);
|
|
39343
|
+
return [];
|
|
39344
39344
|
}
|
|
39345
39345
|
}
|
|
39346
39346
|
return finalPath;
|
package/dist/esm/browser.js
CHANGED
|
@@ -36694,15 +36694,15 @@ function findPath(start, end, grid, obstacles, existingPath, newStart, newEnd) {
|
|
|
36694
36694
|
return;
|
|
36695
36695
|
}
|
|
36696
36696
|
function findPathPoints(points, grid, obstacles, newStart, newEnd) {
|
|
36697
|
-
|
|
36698
|
-
|
|
36699
|
-
if (points.length > 0) {
|
|
36700
|
-
finalPath.push(points[0]);
|
|
36701
|
-
const startKey = `${points[0].x},${points[0].y}`;
|
|
36702
|
-
existingPathSegments.add(startKey);
|
|
36697
|
+
if (points.length < 2) {
|
|
36698
|
+
return points;
|
|
36703
36699
|
}
|
|
36700
|
+
const finalPath = [points[0]];
|
|
36701
|
+
const existingPathSegments = new Set([`${points[0].x},${points[0].y}`]);
|
|
36704
36702
|
for (let i = 0;i < points.length - 1; i += 1) {
|
|
36705
|
-
const
|
|
36703
|
+
const startSegment = points[i];
|
|
36704
|
+
const endSegment = points[i + 1];
|
|
36705
|
+
const segmentPath = findPath(startSegment, endSegment, grid, obstacles, existingPathSegments, newStart, newEnd);
|
|
36706
36706
|
if (segmentPath && segmentPath.length > 0) {
|
|
36707
36707
|
for (let j = 1;j < segmentPath.length; j++) {
|
|
36708
36708
|
const point5 = segmentPath[j];
|
|
@@ -36711,8 +36711,8 @@ function findPathPoints(points, grid, obstacles, newStart, newEnd) {
|
|
|
36711
36711
|
existingPathSegments.add(key);
|
|
36712
36712
|
}
|
|
36713
36713
|
} else {
|
|
36714
|
-
|
|
36715
|
-
|
|
36714
|
+
console.error(`Could not find path from ${startSegment.x},${startSegment.y} to ${endSegment.x},${endSegment.y}`);
|
|
36715
|
+
return [];
|
|
36716
36716
|
}
|
|
36717
36717
|
}
|
|
36718
36718
|
return finalPath;
|
package/dist/esm/index.js
CHANGED
|
@@ -36687,15 +36687,15 @@ function findPath(start, end, grid, obstacles, existingPath, newStart, newEnd) {
|
|
|
36687
36687
|
return;
|
|
36688
36688
|
}
|
|
36689
36689
|
function findPathPoints(points, grid, obstacles, newStart, newEnd) {
|
|
36690
|
-
|
|
36691
|
-
|
|
36692
|
-
if (points.length > 0) {
|
|
36693
|
-
finalPath.push(points[0]);
|
|
36694
|
-
const startKey = `${points[0].x},${points[0].y}`;
|
|
36695
|
-
existingPathSegments.add(startKey);
|
|
36690
|
+
if (points.length < 2) {
|
|
36691
|
+
return points;
|
|
36696
36692
|
}
|
|
36693
|
+
const finalPath = [points[0]];
|
|
36694
|
+
const existingPathSegments = new Set([`${points[0].x},${points[0].y}`]);
|
|
36697
36695
|
for (let i = 0;i < points.length - 1; i += 1) {
|
|
36698
|
-
const
|
|
36696
|
+
const startSegment = points[i];
|
|
36697
|
+
const endSegment = points[i + 1];
|
|
36698
|
+
const segmentPath = findPath(startSegment, endSegment, grid, obstacles, existingPathSegments, newStart, newEnd);
|
|
36699
36699
|
if (segmentPath && segmentPath.length > 0) {
|
|
36700
36700
|
for (let j = 1;j < segmentPath.length; j++) {
|
|
36701
36701
|
const point5 = segmentPath[j];
|
|
@@ -36704,8 +36704,8 @@ function findPathPoints(points, grid, obstacles, newStart, newEnd) {
|
|
|
36704
36704
|
existingPathSegments.add(key);
|
|
36705
36705
|
}
|
|
36706
36706
|
} else {
|
|
36707
|
-
|
|
36708
|
-
|
|
36707
|
+
console.error(`Could not find path from ${startSegment.x},${startSegment.y} to ${endSegment.x},${endSegment.y}`);
|
|
36708
|
+
return [];
|
|
36709
36709
|
}
|
|
36710
36710
|
}
|
|
36711
36711
|
return finalPath;
|
package/dist/esm/node.js
CHANGED
|
@@ -39155,15 +39155,15 @@ function findPath(start, end, grid, obstacles, existingPath, newStart, newEnd) {
|
|
|
39155
39155
|
return;
|
|
39156
39156
|
}
|
|
39157
39157
|
function findPathPoints(points, grid, obstacles, newStart, newEnd) {
|
|
39158
|
-
|
|
39159
|
-
|
|
39160
|
-
if (points.length > 0) {
|
|
39161
|
-
finalPath.push(points[0]);
|
|
39162
|
-
const startKey = `${points[0].x},${points[0].y}`;
|
|
39163
|
-
existingPathSegments.add(startKey);
|
|
39158
|
+
if (points.length < 2) {
|
|
39159
|
+
return points;
|
|
39164
39160
|
}
|
|
39161
|
+
const finalPath = [points[0]];
|
|
39162
|
+
const existingPathSegments = new Set([`${points[0].x},${points[0].y}`]);
|
|
39165
39163
|
for (let i = 0;i < points.length - 1; i += 1) {
|
|
39166
|
-
const
|
|
39164
|
+
const startSegment = points[i];
|
|
39165
|
+
const endSegment = points[i + 1];
|
|
39166
|
+
const segmentPath = findPath(startSegment, endSegment, grid, obstacles, existingPathSegments, newStart, newEnd);
|
|
39167
39167
|
if (segmentPath && segmentPath.length > 0) {
|
|
39168
39168
|
for (let j = 1;j < segmentPath.length; j++) {
|
|
39169
39169
|
const point5 = segmentPath[j];
|
|
@@ -39172,8 +39172,8 @@ function findPathPoints(points, grid, obstacles, newStart, newEnd) {
|
|
|
39172
39172
|
existingPathSegments.add(key);
|
|
39173
39173
|
}
|
|
39174
39174
|
} else {
|
|
39175
|
-
|
|
39176
|
-
|
|
39175
|
+
console.error(`Could not find path from ${startSegment.x},${startSegment.y} to ${endSegment.x},${endSegment.y}`);
|
|
39176
|
+
return [];
|
|
39177
39177
|
}
|
|
39178
39178
|
}
|
|
39179
39179
|
return finalPath;
|