UNPKG

640 BSource Map (JSON)View Raw
1{"version":3,"sources":["../../build/is-writeable.ts"],"names":["isWriteable","directory","fs","promises","access","constants","W_OK","err"],"mappings":"qEAAA,8C,mFAEO,cAAeA,CAAAA,WAAf,CAA2BC,SAA3B,CAAgE,CACrE,GAAI,CACF,KAAMC,aAAGC,QAAH,CAAYC,MAAZ,CAAmBH,SAAnB,CAA8B,CAACC,YAAGG,SAAH,EAAgBH,WAAjB,EAAqBI,IAAnD,CAAN,CACA,MAAO,KAAP,CACD,CAAC,MAAOC,GAAP,CAAY,CACZ,MAAO,MAAP,CACD,CACF","sourcesContent":["import fs from 'fs'\n\nexport async function isWriteable(directory: string): Promise<boolean> {\n try {\n await fs.promises.access(directory, (fs.constants || fs).W_OK)\n return true\n } catch (err) {\n return false\n }\n}\n"]}
\No newline at end of file