18 lines
376 B
JavaScript
18 lines
376 B
JavaScript
/**
|
|
* @module ol/asserts
|
|
*/
|
|
import _ol_AssertionError_ from './AssertionError.js';
|
|
var _ol_asserts_ = {};
|
|
|
|
|
|
/**
|
|
* @param {*} assertion Assertion we expected to be truthy.
|
|
* @param {number} errorCode Error code.
|
|
*/
|
|
_ol_asserts_.assert = function(assertion, errorCode) {
|
|
if (!assertion) {
|
|
throw new _ol_AssertionError_(errorCode);
|
|
}
|
|
};
|
|
export default _ol_asserts_;
|