NET-Web-API-w-Angular/my-app/node_modules/@npmcli/fs/lib/readdir-scoped.js

21 lines
431 B
JavaScript
Raw Normal View History

2024-02-09 00:38:41 +00:00
const { readdir } = require('fs/promises')
const { join } = require('path')
const readdirScoped = async (dir) => {
const results = []
for (const item of await readdir(dir)) {
if (item.startsWith('@')) {
for (const scopedItem of await readdir(join(dir, item))) {
results.push(join(item, scopedItem))
}
} else {
results.push(item)
}
}
return results
}
module.exports = readdirScoped