MCPcopy Create free account
hub / github.com/formkit/formkit / getAllFiles

Function getAllFiles

scripts/utils.mjs:50–61  ·  view source on GitHub ↗
(dirPath, arrayOfFiles)

Source from the content-addressed store, hash-verified

48 * Given a directory return all files recursively from subdirectories
49 */
50export function getAllFiles(dirPath, arrayOfFiles) {
51 const files = fs.readdirSync(dirPath)
52 arrayOfFiles = arrayOfFiles || []
53 files.forEach(function (file) {
54 if (fs.statSync(dirPath + '/' + file).isDirectory()) {
55 arrayOfFiles = getAllFiles(dirPath + '/' + file, arrayOfFiles)
56 } else {
57 arrayOfFiles.push(join(dirPath, '/', file))
58 }
59 })
60 return arrayOfFiles
61}
62
63/**
64 * Get the available packages from the packages directory.

Callers 1

getIconsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected