MCPcopy
hub / github.com/ampproject/amphtml / userAssert

Function userAssert

src/core/assert/user.js:28–55  ·  view source on GitHub ↗
(
  shouldBeTruthy,
  opt_message,
  opt_1,
  opt_2,
  opt_3,
  opt_4,
  opt_5,
  opt_6,
  opt_7,
  opt_8,
  opt_9
)

Source from the content-addressed store, hash-verified

26 * @throws {UserError} when shouldBeTruthy is not truthy.
27 */
28export function userAssert(
29 shouldBeTruthy,
30 opt_message,
31 opt_1,
32 opt_2,
33 opt_3,
34 opt_4,
35 opt_5,
36 opt_6,
37 opt_7,
38 opt_8,
39 opt_9
40) {
41 return assertions.assert(
42 USER_ERROR_SENTINEL,
43 shouldBeTruthy,
44 opt_message,
45 opt_1,
46 opt_2,
47 opt_3,
48 opt_4,
49 opt_5,
50 opt_6,
51 opt_7,
52 opt_8,
53 opt_9
54 );
55}
56
57/**
58 * Throws an error if the first argument isn't an Element.

Callers 15

test-assert.jsFile · 0.90
parseEmbedFunction · 0.90
fromStructuredCloneableFunction · 0.90
parseDateAttrsFunction · 0.90
srcsetFromElementFunction · 0.90
constructorMethod · 0.90
sortByWidthFunction · 0.90
sortByDprFunction · 0.90
assertLengthFunction · 0.90
assertLengthOrPercentFunction · 0.90

Calls 1

assertMethod · 0.80

Tested by

no test coverage detected