1 line
1.3 KiB
Plaintext
1 line
1.3 KiB
Plaintext
{"version":3,"sources":["../src/resolvePackageJson.ts"],"names":["fileExists","file","isFile","e","getRootPackageJsonPath","projectRoot","packageJsonPath","ConfigError"],"mappings":";;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA,SAASA,UAAT,CAAoBC,IAApB,EAA2C;AACzC,MAAI;AACF,WAAO,oBAASA,IAAT,EAAeC,MAAf,EAAP;AACD,GAFD,CAEE,OAAOC,CAAP,EAAU;AACV,WAAO,KAAP;AACD;AACF;;AAEM,SAASC,sBAAT,CAAgCC,WAAhC,EAA6D;AAClE,QAAMC,eAAe,GAAG,kBAAKD,WAAL,EAAkB,cAAlB,CAAxB;;AACA,MAAI,CAACL,UAAU,CAACM,eAAD,CAAf,EAAkC;AAChC,UAAM,KAAIC,qBAAJ,EACH,mCAAkCD,eAAgB,iBAD/C,EAEJ,kBAFI,CAAN;AAID;;AACD,SAAOA,eAAP;AACD","sourcesContent":["import { statSync } from 'fs';\nimport { join } from 'path';\n\nimport { ConfigError } from './Errors';\n\nfunction fileExists(file: string): boolean {\n try {\n return statSync(file).isFile();\n } catch (e) {\n return false;\n }\n}\n\nexport function getRootPackageJsonPath(projectRoot: string): string {\n const packageJsonPath = join(projectRoot, 'package.json');\n if (!fileExists(packageJsonPath)) {\n throw new ConfigError(\n `The expected package.json path: ${packageJsonPath} does not exist`,\n 'MODULE_NOT_FOUND'\n );\n }\n return packageJsonPath;\n}\n"],"file":"resolvePackageJson.js"} |