(dirPath: string)
| 19 | } |
| 20 | |
| 21 | export function readPackageJson(dirPath: string): PackageJson { |
| 22 | const packageJsonPath = join(dirPath, "package.json"); |
| 23 | if (existsSync(packageJsonPath)) { |
| 24 | try { |
| 25 | return JSON.parse(readFileSync(packageJsonPath, "utf-8")); |
| 26 | } catch (e) { |
| 27 | // Ignore package.json parsing errors |
| 28 | } |
| 29 | } |
| 30 | return {}; |
| 31 | } |
| 32 | |
| 33 | export function getDefaultAuthorName(packageData: PackageJson): string { |
| 34 | if (typeof packageData.author === "string") { |
no outgoing calls
no test coverage detected
searching dependent graphs…