next.js/packages/next/src/compiled/find-up/index.js
index.js1 lines2.9 KB
(()=>{"use strict";var r={116:(r,e,t)=>{const s=t(928);const n=t(738);const c=t(219);const o=Symbol("findUp.stop");r.exports=async(r,e={})=>{let t=s.resolve(e.cwd||"");const{root:c}=s.parse(t);const i=[].concat(r);const runMatcher=async e=>{if(typeof r!=="function"){return n(i,e)}const t=await r(e.cwd);if(typeof t==="string"){return n([t],e)}return t};while(true){const r=await runMatcher({...e,cwd:t});if(r===o){return}if(r){return s.resolve(t,r)}if(t===c){return}t=s.dirname(t)}};r.exports.sync=(r,e={})=>{let t=s.resolve(e.cwd||"");const{root:c}=s.parse(t);const i=[].concat(r);const runMatcher=e=>{if(typeof r!=="function"){return n.sync(i,e)}const t=r(e.cwd);if(typeof t==="string"){return n.sync([t],e)}return t};while(true){const r=runMatcher({...e,cwd:t});if(r===o){return}if(r){return s.resolve(t,r)}if(t===c){return}t=s.dirname(t)}};r.exports.exists=c;r.exports.sync.exists=c.sync;r.exports.stop=o},738:(r,e,t)=>{const s=t(928);const n=t(896);const{promisify:c}=t(23);const o=t(296);const i=c(n.stat);const a=c(n.lstat);const u={directory:"isDirectory",file:"isFile"};function checkType({type:r}){if(r in u){return}throw new Error(`Invalid type specified: ${r}`)}const matchType=(r,e)=>r===undefined||e[u[r]]();r.exports=async(r,e)=>{e={cwd:process.cwd(),type:"file",allowSymlinks:true,...e};checkType(e);const t=e.allowSymlinks?i:a;return o(r,(async r=>{try{const n=await t(s.resolve(e.cwd,r));return matchType(e.type,n)}catch(r){return false}}),e)};r.exports.sync=(r,e)=>{e={cwd:process.cwd(),allowSymlinks:true,type:"file",...e};checkType(e);const t=e.allowSymlinks?n.statSync:n.lstatSync;for(const n of r){try{const r=t(s.resolve(e.cwd,n));if(matchType(e.type,r)){return n}}catch(r){}}}},296:(r,e,t)=>{const s=t(802);class EndError extends Error{constructor(r){super();this.value=r}}const testElement=async(r,e)=>e(await r);const finder=async r=>{const e=await Promise.all(r);if(e[1]===true){throw new EndError(e[0])}return false};const pLocate=async(r,e,t)=>{t={concurrency:Infinity,preserveOrder:true,...t};const n=s(t.concurrency);const c=[...r].map((r=>[r,n(testElement,r,e)]));const o=s(t.preserveOrder?1:Infinity);try{await Promise.all(c.map((r=>o(finder,r))))}catch(r){if(r instanceof EndError){return r.value}throw r}};r.exports=pLocate;r.exports["default"]=pLocate},219:(r,e,t)=>{const s=t(896);const{promisify:n}=t(23);const c=n(s.access);r.exports=async r=>{try{await c(r);return true}catch(r){return false}};r.exports.sync=r=>{try{s.accessSync(r);return true}catch(r){return false}}},896:r=>{r.exports=require("fs")},802:r=>{r.exports=require("next/dist/compiled/p-limit")},928:r=>{r.exports=require("path")},23:r=>{r.exports=require("util")}};var e={};function __nccwpck_require__(t){var s=e[t];if(s!==undefined){return s.exports}var n=e[t]={exports:{}};var c=true;try{r[t](n,n.exports,__nccwpck_require__);c=false}finally{if(c)delete e[t]}return n.exports}if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var t=__nccwpck_require__(116);module.exports=t})();
Quest for Codev2.0.0
/
SIGN IN