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

Function getElementServiceIfAvailableForDocInEmbedScope

src/element-service.js:128–138  ·  view source on GitHub ↗
(
  element,
  id,
  extension
)

Source from the content-addressed store, hash-verified

126 * @return {!Promise<?Object>}
127 */
128export function getElementServiceIfAvailableForDocInEmbedScope(
129 element,
130 id,
131 extension
132) {
133 const s = getServiceForDocOrNull(element, id);
134 if (s) {
135 return /** @type {!Promise<?Object>} */ (Promise.resolve(s));
136 }
137 return getElementServiceIfAvailableForDoc(element, id, extension);
138}
139
140/**
141 * Throws user error if `service` is null.

Callers 2

index.jsFile · 0.90

Calls 3

getServiceForDocOrNullFunction · 0.90
resolveMethod · 0.80

Tested by

no test coverage detected