GoScrobble/web/node_modules/cosmiconfig/dist/Explorer.js.map

1 line
6.5 KiB
Plaintext
Raw Normal View History

2022-04-25 02:47:15 +00:00
{"version":3,"sources":["../src/Explorer.ts"],"names":["Explorer","ExplorerBase","constructor","options","search","searchFrom","process","cwd","startDirectory","result","searchFromDirectory","dir","absoluteDir","path","resolve","run","searchDirectory","nextDir","nextDirectoryToSearch","transformResult","config","transform","searchCache","place","searchPlaces","placeResult","loadSearchPlace","shouldSearchStopWithResult","filepath","join","fileContents","createCosmiconfigResult","loadFileContent","content","trim","undefined","loader","getLoaderEntryForFile","loaderResult","fileContent","loadedContentToCosmiconfigResult","load","validateFilePath","absoluteFilePath","runLoad","throwNotFound","loadCache"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;;;AAGA,MAAMA,QAAN,SAAuBC,0BAAvB,CAAqD;AAC5CC,EAAAA,WAAP,CAAmBC,OAAnB,EAA6C;AAC3C,UAAMA,OAAN;AACD;;AAED,QAAaC,MAAb,CACEC,UAAkB,GAAGC,OAAO,CAACC,GAAR,EADvB,EAE8B;AAC5B,UAAMC,cAAc,GAAG,MAAM,gCAAaH,UAAb,CAA7B;AACA,UAAMI,MAAM,GAAG,MAAM,KAAKC,mBAAL,CAAyBF,cAAzB,CAArB;AAEA,WAAOC,MAAP;AACD;;AAED,QAAcC,mBAAd,CAAkCC,GAAlC,EAA2E;AACzE,UAAMC,WAAW,GAAGC,cAAKC,OAAL,CAAaR,OAAO,CAACC,GAAR,EAAb,EAA4BI,GAA5B,CAApB;;AAEA,UAAMI,GAAG,GAAG,YAAwC;AAClD,YAAMN,MAAM,GAAG,MAAM,KAAKO,eAAL,CAAqBJ,WAArB,CAArB;AACA,YAAMK,OAAO,GAAG,KAAKC,qBAAL,CAA2BN,WAA3B,EAAwCH,MAAxC,CAAhB;;AAEA,UAAIQ,OAAJ,EAAa;AACX,eAAO,KAAKP,mBAAL,CAAyBO,OAAzB,CAAP;AACD;;AAED,YAAME,eAAe,GAAG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F,EAG8B;AAC5B,UAAMM,WAAW,GAAG,MAAM,KAAKP,eAAL,CAAqBJ,QAArB,EAA+BK,OAA/B,CAA1B;AACA,UAAMxB,MAAM,GAAG,KAAK+B,gCAAL,CAAsCZ,QAAtC,EAAgDW,WAAhD,CAAf;AAEA,WAAO9B,MAAP;AACD;;AAED,QAAagC,IAAb,CAAkBb,QAAlB,EAAgE;AAC9D,SAAKc,gBAAL,CAAsBd,QAAtB;;AACA,UAAMe,gBAAgB,GAAG9B,cAAKC,OAAL,CAAaR,OAAO,CAACC,GAAR,EAAb,EAA4BqB,QAA5B,CAAzB;;AAEA,UAAMgB,OAAO,GAAG,YAAwC;AACtD,YAAMd,YAAY,GAAG,MAAM,wBAASa,gBAAT,EAA2B;AACpDE,QAAAA,aAAa,EAAE;AADqC,OAA3B,CAA3B;AAIA,YAAMpC,MAAM,GAAG,MAAM,KAAKsB,uBAAL,CACnBY,gBADmB,EAEnBb,YAFmB,CAArB;AAKA,YAAMX,eAAe,GAAG,MAAM,KAAKC,MAAL,CAAYC,SAAZ,CAAsBZ,MAAtB,CAA9B;AAEA,aAAOU,eAAP;AACD,KAbD;;AAeA,QAAI,KAAK2B,SAAT,EAAoB;AAClB,aAAO,gCAAa,KAAKA,SAAlB,EAA6BH,gBAA7B,EAA+CC,OAA/C,CAAP;AACD;;AAED,WAAOA,OAAO,EAAd;AACD;;AA/GkD","sourcesContent":["import path from 'path';\nimport { ExplorerBase } from './ExplorerBase';\nimport { readFile } from './readFile';\nimport { cacheWrapper } from './cacheWrapper';\nimport { getDirectory } from './getDirectory';\nimport { CosmiconfigResult, ExplorerOptions, LoadedFileContent } from './types';\n\nclass Explorer extends ExplorerBase<ExplorerOptions> {\n public constructor(options: ExplorerOptions) {\n super(options);\n }\n\n public async search(\n searchFrom: string = process.cwd(),\n ): Promise<CosmiconfigResult> {\n const startDirectory = await getDirectory(searchFrom);\n const result = await this.searchFromDirectory(startDirectory);\n\n return result;\n }\n\n private async searchFromDirectory(dir: string): Promise<CosmiconfigResult> {\n const absoluteDir = path.resolve(process.cwd(), dir);\n\n const run = async (): Promise<CosmiconfigResult> => {\n