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

Function getMetaByName

src/preact/utils/docInfo.js:8–19  ·  view source on GitHub ↗

* @param {string} metaName * @return {string|null}

(metaName)

Source from the content-addressed store, hash-verified

6 * @return {string|null}
7 */
8 getMetaByName(metaName) {
9 const metas = self.document.head.querySelectorAll('meta[name]');
10 return (
11 Array.from(metas)
12 .find(
13 (meta) =>
14 meta.getAttribute('name') === metaName &&
15 meta.getAttribute('content')
16 )
17 ?.getAttribute('content') || null
18 );
19 },
20
21 /**
22 * @return {string}

Callers

nothing calls this directly

Calls 1

getAttributeMethod · 0.80

Tested by

no test coverage detected