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

Function assertString

src/core/assert/base.js:149–157  ·  view source on GitHub ↗
(assertFn, shouldBeString, opt_message)

Source from the content-addressed store, hash-verified

147 * @throws {Error} when shouldBeString is not an String
148 */
149export function assertString(assertFn, shouldBeString, opt_message) {
150 return assertType_(
151 assertFn,
152 shouldBeString,
153 isString(shouldBeString),
154 'String expected',
155 opt_message
156 );
157}
158
159/**
160 * Throws an error if the first argument isn't a number. The allowed values

Callers

nothing calls this directly

Calls 2

isStringFunction · 0.90
assertType_Function · 0.85

Tested by

no test coverage detected