MCPcopy Create free account
hub / github.com/ampproject/amphtml / assert

Function assert

third_party/set-dom/original.js:318–320  ·  view source on GitHub ↗

* @private * @description * Confirm that a value is truthy, throws an error message otherwise. * * @param {*} val - the val to test. * @param {string} msg - the error message on failure. * @throws {Error}

(val, msg)

Source from the content-addressed store, hash-verified

316 * @throws {Error}
317 */
318function assert (val, msg) {
319 if (!val) throw new Error('set-dom: ' + msg)
320}

Callers 1

setDOMFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected