'use strict'; const fs = require('node:fs'); const nodePath = require('node:path'); function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; } const fs__default = /*#__PURE__*/_interopDefaultCompat(fs); const nodePath__default = /*#__PURE__*/_interopDefaultCompat(nodePath); function isDirectory(path) { try { const stat = fs__default.statSync(path); return stat.isDirectory(); } catch (error) { return false; } } function index(basePath) { const readdirResults = []; const pathsQueue = [basePath]; function readdir(path) { try { const readdirResult = fs__default.readdirSync(path, { encoding: "utf-8" }); for (let i = 0; i < readdirResult.length; i++) { const resultPath = nodePath__default.join(path, readdirResult[i]); const relativeResultPath = nodePath__default.relative(basePath, resultPath); readdirResults.push(relativeResultPath); if (isDirectory(resultPath)) { pathsQueue.push(resultPath); } } } catch (error) { console.error(error); } } for (let i = 0; i < pathsQueue.length; i++) { readdir(pathsQueue[i]); } return readdirResults; } module.exports = index;