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

Function getFileGroups

build-system/tasks/validate-html-fixtures.js:64–73  ·  view source on GitHub ↗

* Separates the list of files to check into groups based on their AMP formats. * @param {Array } filesToCheck * @return {Promise }

(filesToCheck)

Source from the content-addressed store, hash-verified

62 * @return {Promise<Object>}
63 */
64async function getFileGroups(filesToCheck) {
65 logLocalDev(green('Sorting HTML fixtures into format groups...'));
66 const fileGroups = {AMP4ADS: [], AMP4EMAIL: [], AMP: []};
67 await Promise.all(
68 filesToCheck.map(async (file) =>
69 fileGroups[await getAmpFormat(file)].push(file)
70 )
71 );
72 return fileGroups;
73}
74
75/**
76 * Checks for the existence of a local wasm / js validator binary and returns

Callers 1

runCheckFunction · 0.85

Calls 4

logLocalDevFunction · 0.85
greenFunction · 0.85
getAmpFormatFunction · 0.85
pushMethod · 0.45

Tested by

no test coverage detected