{"ast":null,"code":"'use strict';\n\nvar _asyncToGenerator = require(\"D:/Development/Work/CENOS/cenos-ui/node_modules/@babel/runtime/helpers/asyncToGenerator\").default;\n\nconst {\n  promisify\n} = require('util');\n\nconst fs = require('graceful-fs');\n\nconst makeDir = require('make-dir');\n\nconst pEvent = require('p-event');\n\nconst CpFileError = require('./cp-file-error');\n\nconst stat = promisify(fs.stat);\nconst lstat = promisify(fs.lstat);\nconst utimes = promisify(fs.utimes);\nconst chmod = promisify(fs.chmod);\nconst chown = promisify(fs.chown);\nexports.closeSync = fs.closeSync.bind(fs);\nexports.createWriteStream = fs.createWriteStream.bind(fs);\n\nexports.createReadStream = /*#__PURE__*/function () {\n  var _ref = _asyncToGenerator(function* (path, options) {\n    const read = fs.createReadStream(path, options);\n\n    try {\n      yield pEvent(read, ['readable', 'end']);\n    } catch (error) {\n      throw new CpFileError(`Cannot read from \\`${path}\\`: ${error.message}`, error);\n    }\n\n    return read;\n  });\n\n  return function (_x, _x2) {\n    return _ref.apply(this, arguments);\n  };\n}();\n\nexports.stat = path => stat(path).catch(error => {\n  throw new CpFileError(`Cannot stat path \\`${path}\\`: ${error.message}`, error);\n});\n\nexports.lstat = path => lstat(path).catch(error => {\n  throw new CpFileError(`lstat \\`${path}\\` failed: ${error.message}`, error);\n});\n\nexports.utimes = (path, atime, mtime) => utimes(path, atime, mtime).catch(error => {\n  throw new CpFileError(`utimes \\`${path}\\` failed: ${error.message}`, error);\n});\n\nexports.chmod = (path, mode) => chmod(path, mode).catch(error => {\n  throw new CpFileError(`chmod \\`${path}\\` failed: ${error.message}`, error);\n});\n\nexports.chown = (path, uid, gid) => chown(path, uid, gid).catch(error => {\n  throw new CpFileError(`chown \\`${path}\\` failed: ${error.message}`, error);\n});\n\nexports.statSync = path => {\n  try {\n    return fs.statSync(path);\n  } catch (error) {\n    throw new CpFileError(`stat \\`${path}\\` failed: ${error.message}`, error);\n  }\n};\n\nexports.utimesSync = (path, atime, mtime) => {\n  try {\n    return fs.utimesSync(path, atime, mtime);\n  } catch (error) {\n    throw new CpFileError(`utimes \\`${path}\\` failed: ${error.message}`, error);\n  }\n};\n\nexports.chmodSync = (path, mode) => {\n  try {\n    return fs.chmodSync(path, mode);\n  } catch (error) {\n    throw new CpFileError(`chmod \\`${path}\\` failed: ${error.message}`, error);\n  }\n};\n\nexports.chownSync = (path, uid, gid) => {\n  try {\n    return fs.chownSync(path, uid, gid);\n  } catch (error) {\n    throw new CpFileError(`chown \\`${path}\\` failed: ${error.message}`, error);\n  }\n};\n\nexports.makeDir = path => makeDir(path, {\n  fs\n}).catch(error => {\n  throw new CpFileError(`Cannot create directory \\`${path}\\`: ${error.message}`, error);\n});\n\nexports.makeDirSync = path => {\n  try {\n    makeDir.sync(path, {\n      fs\n    });\n  } catch (error) {\n    throw new CpFileError(`Cannot create directory \\`${path}\\`: ${error.message}`, error);\n  }\n};\n\nexports.copyFileSync = (source, destination, flags) => {\n  try {\n    fs.copyFileSync(source, destination, flags);\n  } catch (error) {\n    throw new CpFileError(`Cannot copy from \\`${source}\\` to \\`${destination}\\`: ${error.message}`, error);\n  }\n};","map":{"version":3,"sources":["D:/Development/Work/CENOS/cenos-ui/node_modules/cp-file/fs.js"],"names":["promisify","require","fs","makeDir","pEvent","CpFileError","stat","lstat","utimes","chmod","chown","exports","closeSync","bind","createWriteStream","createReadStream","path","options","read","error","message","catch","atime","mtime","mode","uid","gid","statSync","utimesSync","chmodSync","chownSync","makeDirSync","sync","copyFileSync","source","destination","flags"],"mappings":"AAAA;;;;AACA,MAAM;AAACA,EAAAA;AAAD,IAAcC,OAAO,CAAC,MAAD,CAA3B;;AACA,MAAMC,EAAE,GAAGD,OAAO,CAAC,aAAD,CAAlB;;AACA,MAAME,OAAO,GAAGF,OAAO,CAAC,UAAD,CAAvB;;AACA,MAAMG,MAAM,GAAGH,OAAO,CAAC,SAAD,CAAtB;;AACA,MAAMI,WAAW,GAAGJ,OAAO,CAAC,iBAAD,CAA3B;;AAEA,MAAMK,IAAI,G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CAA1B;;AAIAR,OAAO,CAACoB,WAAR,GAAsBf,IAAI,IAAI;AAC7B,MAAI;AACHb,IAAAA,OAAO,CAAC6B,IAAR,CAAahB,IAAb,EAAmB;AAACd,MAAAA;AAAD,KAAnB;AACA,GAFD,CAEE,OAAOiB,KAAP,EAAc;AACf,UAAM,IAAId,WAAJ,CAAiB,6BAA4BW,IAAK,OAAMG,KAAK,CAACC,OAAQ,EAAtE,EAAyED,KAAzE,CAAN;AACA;AACD,CAND;;AAQAR,OAAO,CAACsB,YAAR,GAAuB,CAACC,MAAD,EAASC,WAAT,EAAsBC,KAAtB,KAAgC;AACtD,MAAI;AACHlC,IAAAA,EAAE,CAAC+B,YAAH,CAAgBC,MAAhB,EAAwBC,WAAxB,EAAqCC,KAArC;AACA,GAFD,CAEE,OAAOjB,KAAP,EAAc;AACf,UAAM,IAAId,WAAJ,CAAiB,sBAAqB6B,MAAO,WAAUC,WAAY,OAAMhB,KAAK,CAACC,OAAQ,EAAvF,EAA0FD,KAA1F,CAAN;AACA;AACD,CAND","sourcesContent":["'use strict';\nconst {promisify} = require('util');\nconst fs = require('graceful-fs');\nconst makeDir = require('make-dir');\nconst pEvent = require('p-event');\nconst CpFileError = require('./cp-file-error');\n\nconst stat = promisify(fs.stat);\nconst lstat = promisify(fs.lstat);\nconst utimes = promisify(fs.utimes);\nconst chmod = promisify(fs.chmod);\nconst chown = promisify(fs.chown);\n\nexports.closeSync = fs.closeSync.bind(fs);\nexports.createWriteStream = fs.createWriteStream.bind(fs);\n\nexports.createReadStream = async (path, options) => {\n\tconst read = fs.createReadStream(path, options);\n\n\ttry {\n\t\tawait pEvent(read, ['readable', 'end']);\n\t} catch (error) {\n\t\tthrow new CpFileError(`Cannot read from \\`${path}\\`: ${error.message}`, error);\n\t}\n\n\treturn read;\n};\n\nexports.stat = path => stat(path).catch(error => {\n\tthrow new CpFileError(`Cannot stat path \\`${path}\\`: ${error.message}`, error);\n});\n\nexports.lstat = path => lstat(path).catch(error => {\n\tthrow new CpFileError(`lstat \\`${path}\\` failed: ${error.message}`, error);\n});\n\nexports.utimes = (path, atime, mtime) => utimes(path, atime, mtime).catch(error => {\n\tthrow new CpFileError(`utimes \\`${path}\\` failed: ${error.message}`, error);\n});\n\nexports.chmod = (path, mode) => chmod(path, mode).catch(error => {\n\tthrow new CpFileError(`chmod \\`${path}\\` failed: ${error.message}`, error);\n});\n\nexports.chown = (path, uid, gid) => chown(path, uid, gid).catch(error => {\n\tthrow new CpFileError(`chown \\`${path}\\` failed: ${error.message}`, error);\n});\n\nexports.statSync = path => {\n\ttry {\n\t\treturn fs.statSync(path);\n\t} catch (error) {\n\t\tthrow new CpFileError(`stat \\`${path}\\` failed: ${error.message}`, error);\n\t}\n};\n\nexports.utimesSync = (path, atime, mtime) => {\n\ttry {\n\t\treturn fs.utimesSync(path, atime, mtime);\n\t} catch (error) {\n\t\tthrow new CpFileError(`utimes \\`${path}\\` failed: ${error.message}`, error);\n\t}\n};\n\nexports.chmodSync = (path, mode) => {\n\ttry {\n\t\treturn fs.chmodSync(path, mode);\n\t} catch (error) {\n\t\tthrow new CpFileError(`chmod \\`${path}\\` failed: ${error.message}`, error);\n\t}\n};\n\nexports.chownSync = (path, uid, gid) => {\n\ttry {\n\t\treturn fs.chownSync(path, uid, gid);\n\t} catch (error) {\n\t\tthrow new CpFileError(`chown \\`${path}\\` failed: ${error.message}`, error);\n\t}\n};\n\nexports.makeDir = path => makeDir(path, {fs}).catch(error => {\n\tthrow new CpFileError(`Cannot create directory \\`${path}\\`: ${error.message}`, error);\n});\n\nexports.makeDirSync = path => {\n\ttry {\n\t\tmakeDir.sync(path, {fs});\n\t} catch (error) {\n\t\tthrow new CpFileError(`Cannot create directory \\`${path}\\`: ${error.message}`, error);\n\t}\n};\n\nexports.copyFileSync = (source, destination, flags) => {\n\ttry {\n\t\tfs.copyFileSync(source, destination, flags);\n\t} catch (error) {\n\t\tthrow new CpFileError(`Cannot copy from \\`${source}\\` to \\`${destination}\\`: ${error.message}`, error);\n\t}\n};\n"]},"metadata":{},"sourceType":"script"}