JAVASCRIPT   96

asserts.js

Guest on 22nd July 2021 12:11:21 PM

  1. goog.provide('ol.asserts');
  2.  
  3. goog.require('ol.AssertionError');
  4.  
  5.  
  6. /**
  7.  * @param {*} assertion Assertion we expected to be truthy.
  8.  * @param {number} errorCode Error code.
  9.  */
  10. ol.asserts.assert = function(assertion, errorCode) {
  11.   if (!assertion) {
  12.     throw new ol.AssertionError(errorCode);
  13.   }
  14. };

Raw Paste


Login or Register to edit or fork this paste. It's free.