diff --git a/src/operation.js b/src/operation.js index 793f748..f2308d0 100644 --- a/src/operation.js +++ b/src/operation.js @@ -7,14 +7,14 @@ import SweepEvent from "./sweep-event" import SweepLine from "./sweep-line" // Limits on iterative processes to prevent infinite loops - usually caused by floating-point math round-off errors. +const env = + typeof process !== "undefined" && typeof process.env !== "undefined" + ? process.env + : {} const POLYGON_CLIPPING_MAX_QUEUE_SIZE = - (typeof process !== "undefined" && - process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE) || - 1000000 + env.POLYGON_CLIPPING_MAX_QUEUE_SIZE || 1000000 const POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS = - (typeof process !== "undefined" && - process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS) || - 1000000 + env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS || 1000000 export class Operation { run(type, geom, moreGeoms) {