1import * as _ from 'lodash-es'2import fs from 'fs'3import { getFilesRec, globallyIgnoredPaths } from '../fileutilsF/getFilesRecF.mts'4import { type absFileDirPath } from '../../ptDirF.mts'6export const getIsDir = async (path: string): Promise<boolean | null> => {7 try {8 return (await fs.promises.stat(path)).isDirectory()9 } catch (err) {10 if ((err as NodeJS.ErrnoException).code == 'ENOENT') return null11 throw err12 }13}15export const lsFilePathsRec = async (dir: string): Promise<absFileDirPath[]> => {16 let filePaths = await getFilesRec(dir)18 filePaths = _.filter(filePaths, (path: absFileDirPath) => {19 const pathA = path.split('/')21 if (_.intersection(pathA, globallyIgnoredPaths).length > 0) {22 return false23 }24 return true25 })26 return filePaths27}