rittenhop-dev/versions/5.94.2/node_modules/@sentry/node/cjs/utils.js.map
2024-09-23 19:40:12 -04:00

1 line
2.8 KiB
Plaintext

{"version":3,"file":"utils.js","sources":["../../src/utils.ts"],"sourcesContent":["import * as fs from 'fs';\nimport * as path from 'path';\n\n/**\n * Recursively read the contents of a directory.\n *\n * @param targetDir Absolute or relative path of the directory to scan. All returned paths will be relative to this\n * directory.\n * @returns Array holding all relative paths\n * @deprecated This function will be removed in the next major version.\n */\nexport function deepReadDirSync(targetDir: string): string[] {\n const targetDirAbsPath = path.resolve(targetDir);\n\n if (!fs.existsSync(targetDirAbsPath)) {\n throw new Error(`Cannot read contents of ${targetDirAbsPath}. Directory does not exist.`);\n }\n\n if (!fs.statSync(targetDirAbsPath).isDirectory()) {\n throw new Error(`Cannot read contents of ${targetDirAbsPath}, because it is not a directory.`);\n }\n\n // This does the same thing as its containing function, `deepReadDirSync` (except that - purely for convenience - it\n // deals in absolute paths rather than relative ones). We need this to be separate from the outer function to preserve\n // the difference between `targetDirAbsPath` and `currentDirAbsPath`.\n const deepReadCurrentDir = (currentDirAbsPath: string): string[] => {\n return fs.readdirSync(currentDirAbsPath).reduce((absPaths: string[], itemName: string) => {\n const itemAbsPath = path.join(currentDirAbsPath, itemName);\n\n if (fs.statSync(itemAbsPath).isDirectory()) {\n return absPaths.concat(deepReadCurrentDir(itemAbsPath));\n }\n\n absPaths.push(itemAbsPath);\n return absPaths;\n }, []);\n };\n\n return deepReadCurrentDir(targetDirAbsPath).map(absPath => path.relative(targetDirAbsPath, absPath));\n}\n"],"names":[],"mappings":";;;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,eAAe,CAAC,SAAS,EAAoB;AAC7D,EAAE,MAAM,mBAAmB,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAA;AAClD;AACA,EAAE,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,gBAAgB,CAAC,EAAE;AACxC,IAAI,MAAM,IAAI,KAAK,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