examples/dependencies/x-div/x-div.js
function assert(condition, errorMessage) {
  var error = processCondition(condition, errorMessage);
  if (typeof error === 'string') {
    throw new Error(error);
  }
}
function assert(condition, errorMessage) {
  var error = processCondition(condition, errorMessage);
  if (typeof error === 'string') {
    throw new Error(error);
  }
}
function assert ( condition , errorMessage ) { var error = processCondition ( condition , errorMessage ) ; if ( typeof error === 'string' ) { throw new Error ( error ) ; } }
Throws an error if the boolean passed to it evaluates to false.
To be used like this:
assert(myDate !== undefined, "Date cannot be undefined.");
@api public
@method assert
@param  {Boolean} condition - Result of the evaluated condition
@param  {String} errorMessage - Message explainig the error in case it is thrown
@return void
Throws an error if the boolean passed to it evaluates to false . To be used like this : assert ( myDate ! == undefined Date cannot be undefined . ) ;