AngularJS assert module provides a set of assertion functions for verifying invariants.
Include the file in HTML
<script src="/node_modules/@contasystemer/angularjs-assert/src/angularjs-assert.js"></script>
or require the file
require('@contasystemer/angularjs-assert');
In angular, include the module into your app.
angular.module('app', ['conta.assert']);
csAssert.ok(angular.isObject(result), 'Result should be an object');
It's an equvivalent of:
if (angular.isObject(result) === false) {
throw new Error('Result should be an object');
}