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

Function getExperimentConfig

build-system/common/utils.js:33–41  ·  view source on GitHub ↗

* Extracts and validates the config for the given experiment. * @param {string} experiment * @return {?Object}

(experiment)

Source from the content-addressed store, hash-verified

31 * @return {?Object}
32 */
33function getExperimentConfig(experiment) {
34 const config = experimentsConfig[experiment];
35 const valid =
36 config?.name &&
37 config?.define_experiment_constant &&
38 config?.expiration_date_utc &&
39 Number(new Date(config.expiration_date_utc)) >= Date.now();
40 return valid ? config : null;
41}
42
43/**
44 * Gets the list of files changed on the current branch that match the given

Callers 3

pushBuildWorkflowFunction · 0.85
pushBuildWorkflowFunction · 0.85
pushBuildWorkflowFunction · 0.85

Calls 1

nowMethod · 0.80

Tested by

no test coverage detected