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

Function getExperimentConstant

build-system/babel-config/helpers.js:13–25  ·  view source on GitHub ↗

* Get experiment constant to define from command line arguments, if any * * @return {string|undefined}

()

Source from the content-addressed store, hash-verified

11 * @return {string|undefined}
12 */
13function getExperimentConstant() {
14 const flag = argv['define_experiment_constant'];
15 // add define flags from arguments
16 if (Array.isArray(flag)) {
17 if (flag.length > 1) {
18 throw new Error('Only one define_experiment_constant flag is allowed');
19 }
20 return flag[0];
21 }
22 if (flag) {
23 return flag;
24 }
25}
26
27/**
28 * Computes options for minify-replace and returns the plugin object.

Callers 1

getReplacePluginFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected