Remove circular dep

feat/remove-ga
Mark Tolmacs 5 days ago
parent 72eaf1cdd6
commit b49ccbf497
No known key found for this signature in database

@ -1,4 +1,3 @@
import { invariant } from "../excalidraw/utils";
import { line, linesIntersectAt } from "./line";
import { pointFrom } from "./point";
import {
@ -30,10 +29,13 @@ export function rectangleFromPair<P extends GlobalPoint | LocalPoint>(
export function rectangleFromArray<P extends GlobalPoint | LocalPoint>(
pointArray: P[],
): Rectangle<P> {
invariant(
pointArray.length === 4,
"Point array contains more or less points to create a rectangle from",
);
if (!import.meta.env.PROD) {
if (pointArray.length !== 4) {
throw new Error(
"Point array contains more or less points to create a rectangle from",
);
}
}
return pointArray as Rectangle<P>;
}

Loading…
Cancel
Save