Named export for ol/asserts

This commit is contained in:
Frederic Junod
2017-12-17 18:10:59 +01:00
parent 7202573f82
commit 9349ba5403
33 changed files with 89 additions and 92 deletions

View File

@@ -2,16 +2,13 @@
* @module ol/asserts
*/
import 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) {
export function assert(assertion, errorCode) {
if (!assertion) {
throw new AssertionError(errorCode);
}
};
export default _ol_asserts_;
}