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

Function resolveDoc

third_party/subscriptions-project/config.js:234–244  ·  view source on GitHub ↗

* @param {!Document|!Window|!Doc} input * @return {!Doc}

(input)

Source from the content-addressed store, hash-verified

232 * @return {!Doc}
233 */
234function resolveDoc(input) {
235 // Is it a `Document`
236 if (/** @type {!Document} */ (input).nodeType === /* DOCUMENT */ 9) {
237 return new GlobalDoc(/** @type {!Document} */ (input));
238 }
239 // Is it a `Window`?
240 if (/** @type {!Window} */ (input).document) {
241 return new GlobalDoc(/** @type {!Window} */ (input));
242 }
243 return /** @type {!Doc} */ (input);
244}
245
246/**
247 * Copyright 2018 The Subscribe with Google Authors. All Rights Reserved.

Callers 1

constructorMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected