rsnext/packages/next/compiled/cacache/index.js

1 line
208 KiB
JavaScript
Raw Normal View History

module.exports=(()=>{var __webpack_modules__={9838:t=>{"use strict";t.exports=JSON.parse('{"Jw":{"k":"2","K":"5"}}')},3485:(t,e,r)=>{const{dirname:n}=r(5622);const{promisify:i}=r(1669);const{access:s,accessSync:o,copyFile:a,copyFileSync:c,unlink:u,unlinkSync:l,rename:f,renameSync:h}=r(5747);const p=i(s);const d=i(a);const y=i(u);const m=i(f);const v=r(7424);const _=async t=>{try{await p(t);return true}catch(t){return t.code!=="ENOENT"}};const g=t=>{try{o(t);return true}catch(t){return t.code!=="ENOENT"}};t.exports=(async(t,e,r={})=>{if(!t||!e){throw new TypeError("`source` and `destination` file required")}r={overwrite:true,...r};if(!r.overwrite&&await _(e)){throw new Error(`The destination file exists: ${e}`)}await v(n(e));try{await m(t,e)}catch(r){if(r.code==="EXDEV"){await d(t,e);await y(t)}else{throw r}}});t.exports.sync=((t,e,r={})=>{if(!t||!e){throw new TypeError("`source` and `destination` file required")}r={overwrite:true,...r};if(!r.overwrite&&g(e)){throw new Error(`The destination file exists: ${e}`)}v.sync(n(e));try{h(t,e)}catch(r){if(r.code==="EXDEV"){c(t,e);l(t)}else{throw r}}})},7424:(t,e,r)=>{const n=r(3430);const i=r(2253);const{mkdirpNative:s,mkdirpNativeSync:o}=r(9863);const{mkdirpManual:a,mkdirpManualSync:c}=r(4906);const{useNative:u,useNativeSync:l}=r(7721);const f=(t,e)=>{t=i(t);e=n(e);return u(e)?s(t,e):a(t,e)};const h=(t,e)=>{t=i(t);e=n(e);return l(e)?o(t,e):c(t,e)};f.sync=h;f.native=((t,e)=>s(i(t),n(e)));f.manual=((t,e)=>a(i(t),n(e)));f.nativeSync=((t,e)=>o(i(t),n(e)));f.manualSync=((t,e)=>c(i(t),n(e)));t.exports=f},7496:(t,e,r)=>{const{dirname:n}=r(5622);const i=(t,e,r=undefined)=>{if(r===e)return Promise.resolve();return t.statAsync(e).then(t=>t.isDirectory()?r:undefined,r=>r.code==="ENOENT"?i(t,n(e),e):undefined)};const s=(t,e,r=undefined)=>{if(r===e)return undefined;try{return t.statSync(e).isDirectory()?r:undefined}catch(r){return r.code==="ENOENT"?s(t,n(e),e):undefined}};t.exports={findMade:i,findMadeSync:s}},4906:(t,e,r)=>{const{dirname:n}=r(5622);const i=(t,e,r)=>{e.recursive=false;const s=n(t);if(s===t){return e.mkdirAsync(t,e).catch(t=>{if(t.code!=="EISDIR")throw t})}return e.mkdirAsync(t,e).then(()=>r||t,n=>{if(n.code==="ENOENT")return i(s,e).then(r=>i(t,e,r));if(n.code!=="EEXIST"&&n.code!=="EROFS")throw n;return e.statAsync(t).then(t=>{if(t.isDirectory())return r;else throw n},()=>{throw n})})};const s=(t,e,r)=>{const i=n(t);e.recursive=false;if(i===t){try{return e.mkdirSync(t,e)}catch(t){if(t.code!=="EISDIR")throw t;else return}}try{e.mkdirSync(t,e);return r||t}catch(n){if(n.code==="ENOENT")return s(t,e,s(i,e,r));if(n.code!=="EEXIST"&&n.code!=="EROFS")throw n;try{if(!e.statSync(t).isDirectory())throw n}catch(t){throw n}}};t.exports={mkdirpManual:i,mkdirpManualSync:s}},9863:(t,e,r)=>{const{dirname:n}=r(5622);const{findMade:i,findMadeSync:s}=r(7496);const{mkdirpManual:o,mkdirpManualSync:a}=r(4906);const c=(t,e)=>{e.recursive=true;const r=n(t);if(r===t)return e.mkdirAsync(t,e);return i(e,t).then(r=>e.mkdirAsync(t,e).then(()=>r).catch(r=>{if(r.code==="ENOENT")return o(t,e);else throw r}))};const u=(t,e)=>{e.recursive=true;const r=n(t);if(r===t)return e.mkdirSync(t,e);const i=s(e,t);try{e.mkdirSync(t,e);return i}catch(r){if(r.code==="ENOENT")return a(t,e);else throw r}};t.exports={mkdirpNative:c,mkdirpNativeSync:u}},3430:(t,e,r)=>{const{promisify:n}=r(1669);const i=r(5747);const s=t=>{if(!t)t={mode:511,fs:i};else if(typeof t==="object")t={mode:511,fs:i,...t};else if(typeof t==="number")t={mode:t,fs:i};else if(typeof t==="string")t={mode:parseInt(t,8),fs:i};else throw new TypeError("invalid options argument");t.mkdir=t.mkdir||t.fs.mkdir||i.mkdir;t.mkdirAsync=n(t.mkdir);t.stat=t.stat||t.fs.stat||i.stat;t.statAsync=n(t.stat);t.statSync=t.statSync||t.fs.statSync||i.statSync;t.mkdirSync=t.mkdirSync||t.fs.mkdirSync||i.mkdirSync;return t};t.exports=s},2253:(t,e,r)=>{const n=process.env.__TESTING_MKDIRP_PLATFORM__||process.platform;const{resolve:i,parse:s}=r(5622);const o=t=>{if(/\0/.test(t)){throw Object.assign(new TypeError("path must be a string without null bytes"),{path:t,code:"ERR_INVALID_A