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

Function formatExtractedMessages

build-system/compile/log-messages.js:32–42  ·  view source on GitHub ↗

* Format extracted messages table in multiple outputs, keyed by id. * @return {!Promise}

()

Source from the content-addressed store, hash-verified

30 * @return {!Promise}
31 */
32async function formatExtractedMessages() {
33 const items = await extractedItems();
34 return Promise.all(
35 Object.entries(formats).map(async ([path, format]) => {
36 const formatted = {};
37 items.forEach((item) => (formatted[item.id] = format(item)));
38 await fs.outputJson(path, formatted);
39 log('Formatted', cyan(path));
40 })
41 );
42}
43
44module.exports = {extractedPath, formatExtractedMessages};

Callers 1

distFunction · 0.85

Calls 6

extractedItemsFunction · 0.85
cyanFunction · 0.85
formatFunction · 0.50
logFunction · 0.50
entriesMethod · 0.45
forEachMethod · 0.45

Tested by

no test coverage detected