MCPcopy Index your code
hub / github.com/nodejs/node / getMeta

Method getMeta

test/common/wpt.js:391–412  ·  view source on GitHub ↗

* @returns {{ script?: string[]; variant?: string[]; [key: string]: string }} parsed META tags of a spec file

()

Source from the content-addressed store, hash-verified

389 * @returns {{ script?: string[]; variant?: string[]; [key: string]: string }} parsed META tags of a spec file
390 */
391 getMeta() {
392 const matches = this.getContent().match(/\/\/ META: .+/g);
393 if (!matches) {
394 return {};
395 }
396 const result = {};
397 for (const match of matches) {
398 const parts = match.match(/\/\/ META: ([^=]+?)=(.+)/);
399 const key = parts[1];
400 const value = parts[2];
401 if (key === 'script' || key === 'variant') {
402 if (result[key]) {
403 result[key].push(value);
404 } else {
405 result[key] = [value];
406 }
407 } else {
408 result[key] = value;
409 }
410 }
411 return result;
412 }
413}
414
415const kIntlRequirement = {

Callers 3

fromMethod · 0.95
fullInitScriptMethod · 0.80
runJsTestsMethod · 0.80

Calls 3

getContentMethod · 0.95
matchMethod · 0.65
pushMethod · 0.45

Tested by

no test coverage detected