MCPcopy Index your code
hub / github.com/ampproject/amphtml / getRtvVersion

Function getRtvVersion

src/mode.js:69–80  ·  view source on GitHub ↗

* Retrieve the `rtvVersion` which will have a numeric prefix * denoting canary/prod/experiment (unless `isLocalDev` is true). * * @param {!Window} win * @return {string}

(win)

Source from the content-addressed store, hash-verified

67 * @return {string}
68 */
69function getRtvVersion(win) {
70 // Ignore memoized copy during testing to allow override.
71 if (!rtvVersion || coreMode.isTest(win)) {
72 // Currently `internalRuntimeVersion` and thus `mode.version` contain only
73 // major version. The full version however must also carry the minor version.
74 // We will default to production default `01` minor version for now.
75 // TODO(erwinmombay): decide whether internalRuntimeVersion should contain
76 // minor version.
77 rtvVersion = win.AMP_CONFIG?.v || `01${coreMode.version()}`;
78 }
79 return rtvVersion;
80}
81
82/**
83 * Triggers validation or enable pub level logging. Validation can be

Callers 2

getMode_Function · 0.85
getRtvVersionForTestingFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected