UNPKG

poly2tri

Version:

A 2D constrained Delaunay triangulation library

34 lines (28 loc) 766 B
/* * Poly2Tri Copyright (c) 2009-2014, Poly2Tri Contributors * http://code.google.com/p/poly2tri/ * * poly2tri.js (JavaScript port) (c) 2009-2014, Poly2Tri Contributors * https://github.com/r3mi/poly2tri.js * * All rights reserved. * * Distributed under the 3-clause BSD License, see LICENSE.txt */ "use strict"; /* * Function added in the JavaScript version (was not present in the c++ version) */ /** * assert and throw an exception. * * @private * @param {boolean} condition the condition which is asserted * @param {string} message the message which is display is condition is falsy */ function assert(condition, message) { if (!condition) { throw new Error(message || "Assert Failed"); } } module.exports = assert;