Open BioPhoton opened 9 months ago
Lets threat this ticket as a research and refine separate issues for glob and file access.
Spike: 2md
export async function crawlFileSystemAndLoad<T = string>(options: {
file: ['**/tmp/**', '(search|test).component.ts', (path: string) => boolean ],
// is Angular inline styles present
content: [string | RegExp, (content: string) => boolean]
}) => Promise<T[]>
const filePaths = await crawlFileSystem<T = string>({
file: [(path: string) => boolean ],
content: [(content: string) => boolean]
}): Promise<T[]> {
}
filePaths.map(loadFile)
The file helpers do not really scale at the moment.
The current API of the
crawlFileSystem
function looks like this:API Improvements:
file
typing to acceptstring
orGlobPattern
for path pattern matchingcontent
typing to acceptstring
orRegExp
for content pattern matchingLogic improvements:
The potential API of the
crawlFileSystem
function looks like this: