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

Function walk

build-system/tasks/firebase.js:12–25  ·  view source on GitHub ↗

* @param {string} dest * @return {Promise }

(dest)

Source from the content-addressed store, hash-verified

10 * @return {Promise<string[]>}
11 */
12async function walk(dest) {
13 const filelist = [];
14 const files = await fs.readdir(dest);
15
16 for (let i = 0; i < files.length; i++) {
17 const file = `${dest}/${files[i]}`;
18
19 fs.statSync(file).isDirectory()
20 ? Array.prototype.push.apply(filelist, await walk(file))
21 : filelist.push(file);
22 }
23
24 return filelist;
25}
26
27/**
28 * @param {string} src

Callers 1

copyAndReplaceUrlsFunction · 0.85

Calls 2

applyMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected