{"version":3,"file":"file.mjs","names":[],"sources":["../../../src/server/externals/file.ts"],"sourcesContent":["import { readFile, stat, writeFile } from 'node:fs/promises'\nimport { type GlobOptionsWithFileTypesUnset, glob } from 'glob'\nimport { mkdirp } from 'mkdirp'\n\nexport const file = {\n\texistFile(filePath: string) {\n\t\treturn stat(filePath)\n\t\t\t.then((s) => s.isFile())\n\t\t\t.catch(() => false)\n\t},\n\tglob(pattern: string | string[], options?: GlobOptionsWithFileTypesUnset | undefined) {\n\t\treturn glob(pattern, options)\n\t},\n\tmkdirp: mkdirp as (path: string) => Promise<string | undefined>,\n\tasync tryReadFile(filePath: string | undefined): Promise<Buffer | undefined> {\n\t\tif (!filePath) return undefined\n\n\t\treturn readFile(filePath).catch(() => undefined)\n\t},\n\twriteFile,\n}\n"],"mappings":";;;;;AAIA,MAAa,OAAO;CACnB,UAAU,UAAkB;AAC3B,SAAO,KAAK,SAAS,CACnB,MAAM,MAAM,EAAE,QAAQ,CAAC,CACvB,YAAY,MAAM;;CAErB,KAAK,SAA4B,SAAqD;AACrF,SAAO,KAAK,SAAS,QAAQ;;CAEtB;CACR,MAAM,YAAY,UAA2D;AAC5E,MAAI,CAAC,SAAU,QAAO;AAEtB,SAAO,SAAS,SAAS,CAAC,YAAY,OAAU;;CAEjD;CACA"}