MCPcopy Index your code
hub / github.com/ember-cli/ember-cli / assert

Function assert

lib/debug/assert.js:25–35  ·  view source on GitHub ↗

* Verify that a certain condition is met, or throw an error if otherwise. * * This is useful for communicating expectations in the code to other human * readers as well as catching bugs that accidentally violate these expectations. * * ```js * const { assert } = require('ember-cli/lib/debug');

(description, condition)

Source from the content-addressed store, hash-verified

23 * If falsy, an error will be thrown.
24 */
25function assert(description, condition) {
26 if (!description) {
27 throw new Error('When calling `assert`, you must provide a description as the first argument.');
28 }
29
30 if (condition) {
31 return;
32 }
33
34 throw new Error(`ASSERTION FAILED: ${description}`);
35}
36
37module.exports = assert;

Callers 4

_initVendorFilesMethod · 0.85
assert-test.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…