MCPcopy Create free account
hub / github.com/ChromeDevTools/devtools-frontend / parse

Method parse

scripts/devtools_build.mjs:176–204  ·  view source on GitHub ↗
(text)

Source from the content-addressed store, hash-verified

174 }
175
176 static parse(text) {
177 if (!text) {
178 return [];
179 }
180 const features = [];
181 for (const str of text.split(',')) {
182 const parts = str.split(':');
183 if (parts.length < 1 || parts.length > 2) {
184 throw new Error(`Invalid feature declaration '${str}'`);
185 }
186 const feature = parts[0];
187 const parameters = Object.create(null);
188 if (parts.length > 1) {
189 const args = parts[1].split('/');
190 if (args.length % 2 !== 0) {
191 throw new Error(
192 `Invalid parameters '${parts[1]}' for feature ${feature}`,
193 );
194 }
195 for (let i = 0; i < args.length; i += 2) {
196 const key = args[i + 0];
197 const value = args[i + 1];
198 parameters[key] = value;
199 }
200 }
201 features.push({ feature, parameters });
202 }
203 return features;
204 }
205}
206
207/**

Callers 15

rebaseFunction · 0.45
getSinkDataFunction · 0.45
describeTitleFunction · 0.45
submitAndWaitTillDoneFunction · 0.45
isVisibleFunction · 0.45
getCurrentRecordingFunction · 0.45
loadMethod · 0.45
getEditorSelectionFunction · 0.45
describeTitleFunction · 0.45
getExperimentNameEnumFunction · 0.45

Calls 3

splitMethod · 0.80
createMethod · 0.65
pushMethod · 0.45

Tested by 4

submitAndWaitTillDoneFunction · 0.36
isVisibleFunction · 0.36
getEditorSelectionFunction · 0.36
getParsedExpressionFunction · 0.36