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

Function draw3pInternal

3p/integration-lib.js:121–138  ·  view source on GitHub ↗
(win, data, configCallback)

Source from the content-addressed store, hash-verified

119 * on this.
120 */
121export function draw3pInternal(win, data, configCallback) {
122 const type = data['type'];
123
124 userAssert(
125 isTagNameAllowed(type, win.context.tagName),
126 'Embed type %s not allowed with tag %s',
127 type,
128 win.context.tagName
129 );
130 if (configCallback) {
131 configCallback(data, (data) => {
132 userAssert(data, 'Expected configuration to be passed as first argument');
133 run(type, win, data);
134 });
135 } else {
136 run(type, win, data);
137 }
138}
139
140/**
141 * Draws an embed, optionally synchronously, to the DOM.

Callers 2

draw3pFunction · 0.85

Calls 3

userAssertFunction · 0.90
runFunction · 0.90
isTagNameAllowedFunction · 0.85

Tested by

no test coverage detected