forked from rDrama/rDrama
1 line
6.4 KiB
Plaintext
1 line
6.4 KiB
Plaintext
|
{"version":3,"sources":["../src/ExplorerSync.ts"],"names":["ExplorerSync","ExplorerBase","constructor","options","searchSync","searchFrom","process","cwd","startDirectory","result","searchFromDirectorySync","dir","absoluteDir","path","resolve","run","searchDirectorySync","nextDir","nextDirectoryToSearch","transformResult","config","transform","searchCache","place","searchPlaces","placeResult","loadSearchPlaceSync","shouldSearchStopWithResult","filepath","join","content","createCosmiconfigResultSync","loadFileContentSync","trim","undefined","loader","getLoaderEntryForFile","loaderResult","fileContent","loadedContentToCosmiconfigResult","loadSync","validateFilePath","absoluteFilePath","runLoadSync","throwNotFound","cosmiconfigResult","loadCache"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;;;AAOA,MAAMA,YAAN,SAA2BC,0BAA3B,CAA6D;AACpDC,EAAAA,WAAW,CAACC,OAAD,EAA+B;AAC/C,UAAMA,OAAN;AACD;;AAEMC,EAAAA,UAAU,CAACC,UAAkB,GAAGC,OAAO,CAACC,GAAR,EAAtB,EAAwD;AACvE,UAAMC,cAAc,GAAG,oCAAiBH,UAAjB,CAAvB;AACA,UAAMI,MAAM,GAAG,KAAKC,uBAAL,CAA6BF,cAA7B,CAAf;AAEA,WAAOC,MAAP;AACD;;AAEOC,EAAAA,uBAAuB,CAACC,GAAD,EAAiC;AAC9D,UAAMC,WAAW,GAAGC,cAAKC,OAAL,CAAaR,OAAO,CAACC,GAAR,EAAb,EAA4BI,GAA5B,CAApB;;AAEA,UAAMI,GAAG,GAAG,MAAyB;AACnC,YAAMN,MAAM,GAAG,KAAKO,mBAAL,CAAyBJ,WAAzB,CAAf;AACA,YAAMK,OAAO,GAAG,KAAKC,qBAAL,CAA2BN,WAA3B,EAAwCH,MAAxC,CAAhB;;AAEA,UAAIQ,OAAJ,EAAa;AACX,eAAO,KAAKP,uBAAL,CAA6BO,OAA7B,CAAP;AACD;;AAED,YAAME,eAAe,GAAG,KAAKC,MAA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UAAMQ,WAAW,GAAG,KAAKN,mBAAL,CAAyBJ,QAAzB,EAAmCE,OAAnC,CAApB;AACA,UAAMrB,MAAM,GAAG,KAAK8B,gCAAL,CAAsCX,QAAtC,EAAgDU,WAAhD,CAAf;AAEA,WAAO7B,MAAP;AACD;;AAEM+B,EAAAA,QAAQ,CAACZ,QAAD,EAAsC;AACnD,SAAKa,gBAAL,CAAsBb,QAAtB;;AACA,UAAMc,gBAAgB,GAAG7B,cAAKC,OAAL,CAAaR,OAAO,CAACC,GAAR,EAAb,EAA4BqB,QAA5B,CAAzB;;AAEA,UAAMe,WAAW,GAAG,MAAyB;AAC3C,YAAMb,OAAO,GAAG,4BAAaY,gBAAb,EAA+B;AAAEE,QAAAA,aAAa,EAAE;AAAjB,OAA/B,CAAhB;AACA,YAAMC,iBAAiB,GAAG,KAAKd,2BAAL,CACxBW,gBADwB,EAExBZ,OAFwB,CAA1B;AAKA,YAAMX,eAAe,GAAG,KAAKC,MAAL,CAAYC,SAAZ,CAAsBwB,iBAAtB,CAAxB;AAEA,aAAO1B,eAAP;AACD,KAVD;;AAYA,QAAI,KAAK2B,SAAT,EAAoB;AAClB,aAAO,oCAAiB,KAAKA,SAAtB,EAAiCJ,gBAAjC,EAAmDC,WAAnD,CAAP;AACD;;AAED,WAAOA,WAAW,EAAlB;AACD;;AAxG0D","sourcesContent":["import path from 'path';\nimport { ExplorerBase } from './ExplorerBase';\nimport { readFileSync } from './readFile';\nimport { cacheWrapperSync } from './cacheWrapper';\nimport { getDirectorySync } from './getDirectory';\nimport {\n CosmiconfigResult,\n ExplorerOptionsSync,\n LoadedFileContent,\n} from './types';\n\nclass ExplorerSync extends ExplorerBase<ExplorerOptionsSync> {\n public constructor(options: ExplorerOptionsSync) {\n super(options);\n }\n\n public searchSync(searchFrom: string = process.cwd()): CosmiconfigResult {\n const startDirectory = getDirectorySync(searchFrom);\n const result = this.searchFromDirectorySync(startDirectory);\n\n return result;\n }\n\n private searchFromDirectorySync(dir: string): CosmiconfigResult {\n const absoluteDir = path.resolve(process.cwd(), dir);\n\n const run = (): CosmiconfigResult => {\n const r
|