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

Function removeFromRuntimeSource

build-system/tasks/sweep-experiments/index.js:138–153  ·  view source on GitHub ↗

* @param {string} id * @param {number} percentage * @return {Array } modified files

(id, percentage)

Source from the content-addressed store, hash-verified

136 * @return {Array<string>} modified files
137 */
138function removeFromRuntimeSource(id, percentage) {
139 const possiblyModifiedSourceFiles = filesContainingPattern(
140 containRuntimeSource.map((dir) => `${dir}/**/*.js`),
141 id
142 );
143 if (possiblyModifiedSourceFiles.length > 0) {
144 jscodeshift([
145 `--no-babel`,
146 `--transform ${__dirname}/jscodeshift/remove-experiment-runtime.js`,
147 `--isExperimentOnLaunched=${percentage}`,
148 `--isExperimentOnExperiment=${id}`,
149 ...possiblyModifiedSourceFiles,
150 ]);
151 }
152 return possiblyModifiedSourceFiles;
153}
154
155/**
156 * @param {string} id

Callers 1

sweepExperimentsFunction · 0.85

Calls 2

filesContainingPatternFunction · 0.85
jscodeshiftFunction · 0.85

Tested by

no test coverage detected