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

Function getMode_

src/mode.js:45–60  ·  view source on GitHub ↗

* Provides info about the current app. * @param {!Window} win * @return {!ModeDef}

(win)

Source from the content-addressed store, hash-verified

43 * @return {!ModeDef}
44 */
45function getMode_(win) {
46 const hashParams = getHashParams(win);
47
48 // The `minified`, `test` and `localDev` properties are replaced
49 // as boolean literals when we run `amp dist` without the `--fortesting`
50 // flags. This improved DCE on the production file we deploy as the code
51 // paths for localhost/testing/development are eliminated.
52 return {
53 localDev: coreMode.isLocalDev(win),
54 development: isModeDevelopment(win, hashParams),
55 esm: coreMode.isEsm(),
56 test: coreMode.isTest(win),
57 rtvVersion: getRtvVersion(win),
58 ssrReady: coreMode.isSsrCss(),
59 };
60}
61
62/**
63 * Retrieve the `rtvVersion` which will have a numeric prefix

Callers 1

getModeFunction · 0.85

Calls 3

getHashParamsFunction · 0.90
isModeDevelopmentFunction · 0.85
getRtvVersionFunction · 0.85

Tested by

no test coverage detected