* Is the package `name` installed in `modules` a copy of one of the * project's own packages? It is when a project manifest names it (see * projectPackageNames), under the name it is imported by or under the name * its own package.json gives, which differs when an install put it under *
(modules: string, name: string)
| 5000 | * another name (`"kit": "file:../libs/lib"`). |
| 5001 | */ |
| 5002 | private isProjectPackageCopy(modules: string, name: string): boolean { |
| 5003 | const own = this.projectPackageNames(); |
| 5004 | if (own.has(name)) return true; |
| 5005 | const key = modules + '\0' + name; |
| 5006 | let installedAs = this.installedNames.get(key); |
| 5007 | if (installedAs === undefined) { |
| 5008 | const json = readPackageJson(path.join(modules, name, 'package.json')); |
| 5009 | installedAs = typeof json?.name === 'string' ? json.name : ''; |
| 5010 | this.installedNames.set(key, installedAs); |
| 5011 | } |
| 5012 | return installedAs !== '' && own.has(installedAs); |
| 5013 | } |
| 5014 | |
| 5015 | /** |
| 5016 | * The names of the project's own packages: the `name` of every package.json |
no test coverage detected