Skip to content

Commit

Permalink
fix: follow same structure as before
Browse files Browse the repository at this point in the history
  • Loading branch information
soulgalore committed Dec 30, 2024
1 parent 3662ef1 commit 553d6b9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/support/fileUtil.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import { readdir } from 'node:fs/promises';
import path from 'node:path';

export async function recursiveReaddir(dir, includeDirectories = false) {
export async function recursiveReaddir(dir, ignoreDirectories = false) {
const results = [];
const entries = await readdir(dir, { withFileTypes: true });

for (const entry of entries) {
const fullPath = path.join(dir, entry.name);

if (entry.isDirectory()) {
if (includeDirectories) {
if (!ignoreDirectories) {
results.push(fullPath);
}
const subPaths = await recursiveReaddir(fullPath, includeDirectories);
const subPaths = await recursiveReaddir(fullPath, ignoreDirectories);
results.push(...subPaths);
} else {
results.push(fullPath);
Expand Down

0 comments on commit 553d6b9

Please sign in to comment.