Change the param name to clarify the intent
parent
e3c8fceb42
commit
b9a8b2c30c
|
@ -1,10 +1,10 @@
|
||||||
import { readdir } from 'node:fs/promises'
|
import { readdir } from 'node:fs/promises'
|
||||||
import { join } from 'node:path'
|
import { join } from 'node:path'
|
||||||
const walkDir = async function* (dir = '.', ignores = []) {
|
const walkDir = async function* (dir = '.', exclude = []) {
|
||||||
const files = await readdir(dir, { withFileTypes: true })
|
const files = await readdir(dir, { withFileTypes: true })
|
||||||
|
|
||||||
for (const file of files) {
|
for (const file of files) {
|
||||||
if (ignores.includes(file.name)) continue
|
if (exclude.includes(file.name)) continue
|
||||||
|
|
||||||
if (file.isDirectory()) {
|
if (file.isDirectory()) {
|
||||||
yield* walkDir(join(dir, file.name))
|
yield* walkDir(join(dir, file.name))
|
||||||
|
|
Loading…
Reference in New Issue