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.
@@ -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
- const finalPath = [];
36853
- const existingPathSegments = new Set;
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 segmentPath = findPath(points[i], points[i + 1], grid, obstacles, existingPathSegments, newStart, newEnd);
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
- points.splice(i + 1, 1);
36870
- i--;
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
- const finalPath = [];
36853
- const existingPathSegments = new Set;
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 segmentPath = findPath(points[i], points[i + 1], grid, obstacles, existingPathSegments, newStart, newEnd);
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
- points.splice(i + 1, 1);
36870
- i--;
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
- const finalPath = [];
39326
- const existingPathSegments = new Set;
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 segmentPath = findPath(points[i], points[i + 1], grid, obstacles, existingPathSegments, newStart, newEnd);
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
- points.splice(i + 1, 1);
39343
- i--;
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;
@@ -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
- const finalPath = [];
36698
- const existingPathSegments = new Set;
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 segmentPath = findPath(points[i], points[i + 1], grid, obstacles, existingPathSegments, newStart, newEnd);
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
- points.splice(i + 1, 1);
36715
- i--;
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
- const finalPath = [];
36691
- const existingPathSegments = new Set;
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 segmentPath = findPath(points[i], points[i + 1], grid, obstacles, existingPathSegments, newStart, newEnd);
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
- points.splice(i + 1, 1);
36708
- i--;
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
- const finalPath = [];
39159
- const existingPathSegments = new Set;
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 segmentPath = findPath(points[i], points[i + 1], grid, obstacles, existingPathSegments, newStart, newEnd);
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
- points.splice(i + 1, 1);
39176
- i--;
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "microboard-temp",
3
- "version": "0.5.94",
3
+ "version": "0.5.95",
4
4
  "description": "A flexible interactive whiteboard library",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",